Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
amrBatch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tetras MARS
amrBatch
Commits
c3a9eb30
Commit
c3a9eb30
authored
1 year ago
by
Aurélien Lamercerie
Browse files
Options
Downloads
Patches
Plain Diff
Update requirements and gitignore
parent
2224211a
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
requirements.txt
+1
-0
1 addition, 0 deletions
requirements.txt
tests/amrbatch.log
+27
-22
27 additions, 22 deletions
tests/amrbatch.log
tests/test_amrbatch_main.py
+6
-5
6 additions, 5 deletions
tests/test_amrbatch_main.py
with
36 additions
and
27 deletions
.gitignore
+
2
−
0
View file @
c3a9eb30
...
...
@@ -5,3 +5,5 @@ __pycache__
*catalog-v001.xml
venv/*
amr_models/*
*.ipynb_checkpoints/
tests/output/*
This diff is collapsed.
Click to expand it.
requirements.txt
+
1
−
0
View file @
c3a9eb30
...
...
@@ -6,3 +6,4 @@ rdflib
graphviz
bs4
lxml
multiprocessing-logging
This diff is collapsed.
Click to expand it.
tests/amrbatch.log
+
27
−
22
View file @
c3a9eb30
...
...
@@ -6,14 +6,14 @@
=== Preparation ===
- INFO - -- base reference: test
- INFO - -- input filepath: /home/lamenji/Workspace/Tetras/amrbatch/tests/input/test.txt
- INFO - -- output dirpath: /home/lamenji/Workspace/Tetras/amrbatch/tests/output/Test-20230
314
/
- INFO - -- output dirpath: /home/lamenji/Workspace/Tetras/amrbatch/tests/output/Test-20230
628
/
- INFO - -- Reading input line set to recover a list of work data
- DEBUG - *** sentence 1 ***
<work_data.WorkData object at 0x7f5207109ba0>
The sun is a star.
- DEBUG - *** sentence 2 ***
<work_data.WorkData object at 0x7f52071087f0>
Earth is a planet.
- INFO - ----- number of sentences: 2
- DEBUG - -- Making output directory tree (/home/lamenji/Workspace/Tetras/amrbatch/tests/output/Test-20230
314
/)
- DEBUG - -- Making output directory tree (/home/lamenji/Workspace/Tetras/amrbatch/tests/output/Test-20230
628
/)
- DEBUG - -- Generating sentence file
- INFO -
=== Text Convert to AMR Graphs ===
...
...
@@ -22,31 +22,36 @@
- DEBUG - (/home/lamenji/Workspace/Tetras/amrbatch/tests/../amr_models/model_parse_xfm_bart_large-v0_1_0)
- INFO - -- Loading AMR model
- INFO - -- Converting sentences to AMR graphs
- INFO - ----- Sentence 1 successfully processed
- DEBUG - ['# ::snt The sun is a star.\n(s / star\n :domain (s2 / sun))']
- INFO - ----- Sentence 2 successfully processed
- DEBUG - ['# ::snt Earth is a planet.\n(p / planet\n :domain p\n :name (n / name\n :op1 "Earth"))']
- INFO - ----- Sentence successfully processed
- INFO - ['# ::snt The sun is a star.\n(s / star\n :domain (s2 / sun))']
- INFO - -- Loading AMR model
- INFO - -- Converting sentences to AMR graphs
- WARNING - gid=x Start paren present but planet is not a new concept
- INFO - ----- Sentence successfully processed
- INFO - ['# ::snt Earth is a planet.\n(p / planet\n :domain p\n :name (n / name\n :op1 "Earth"))']
- INFO - ----- Total processed graph number: 2
- INFO - -- Generating AMR graph files
- DEBUG - ----- AMR Graph file (penman): test-01.stog.amr.penman
- DEBUG - ----- AMR Graph file (dot): test-01.stog.amr.dot
- DEBUG - ----- AMR Graph file (png): {os.path.basename(good_png_fn)}
- DEBUG - ----- AMR Graph file (penman): test-02.stog.amr.penman
- DEBUG - ----- AMR Graph file (dot): test-02.stog.amr.dot
- DEBUG - ----- AMR Graph file (png): {os.path.basename(good_png_fn)}
- INFO - ----- AMR Graph file (penman): test-01.stog.amr.penman
- INFO - ----- AMR Graph file (penman): test-02.stog.amr.penman
- INFO - ----- AMR Graph file (dot): test-02.stog.amr.dot
- INFO - ----- AMR Graph file (dot): test-01.stog.amr.dot
- INFO - ----- AMR Graph file (png): test-01.stog.amr.png
- INFO - ----- AMR Graph file (png): test-02.stog.amr.png
- INFO - ----- AMR Graph file (svg): test-01.stog.amr.svg
- INFO - ----- AMR Graph file (svg): test-02.stog.amr.svg
- INFO -
=== AMR Graphs Serialization to AMR-RDF Representation ===
- INFO - -- library: amrld
- DEBUG - (/home/lamenji/Workspace/Tetras/amrbatch/amrbatch/amrld/)
- INFO - -- Serialize AMR graphs to RDF using amr-ld library
-
DEBUG
- ----- AMR filepath (penman):
/home/lamenji/Workspace/Tetras/amrbatch/tests/output/Test-20230314/test-01/
test-01.stog.amr.penman
-
DEBUG
- ----- AMR-RDF filepath (triple):
/home/lamenji/Workspace/Tetras/amrbatch/tests/output/Test-20230314/test-01/
test-01.stog.amr.nt
-
DEBUG
- ----- AMR-RDF filepath (turtle):
/home/lamenji/Workspace/Tetras/amrbatch/tests/output/Test-20230314/test-01/
test-01.stog.amr.ttl
-
INFO
- ----- AMR filepath (penman): test-01.stog.amr.penman
-
INFO
- ----- AMR-RDF filepath (triple): test-01.stog.amr.nt
-
INFO
- ----- AMR-RDF filepath (turtle): test-01.stog.amr.ttl
- INFO - ----- AMR-RDF triple successfully processed (test-01.stog.amr.nt)
- INFO - ----- AMR-RDF t
rip
le successfully processed (test-01.stog.amr.ttl)
- INFO - ----- AMR-RDF t
urt
le successfully processed (test-01.stog.amr.ttl)
- INFO - -- Serialize AMR graphs to RDF using amr-ld library
-
DEBUG
- ----- AMR filepath (penman):
/home/lamenji/Workspace/Tetras/amrbatch/tests/output/Test-20230314/test-02/
test-02.stog.amr.penman
-
DEBUG
- ----- AMR-RDF filepath (triple):
/home/lamenji/Workspace/Tetras/amrbatch/tests/output/Test-20230314/test-02/
test-02.stog.amr.nt
-
DEBUG
- ----- AMR-RDF filepath (turtle):
/home/lamenji/Workspace/Tetras/amrbatch/tests/output/Test-20230314/test-02/
test-02.stog.amr.ttl
-
INFO
- ----- AMR filepath (penman): test-02.stog.amr.penman
-
INFO
- ----- AMR-RDF filepath (triple): test-02.stog.amr.nt
-
INFO
- ----- AMR-RDF filepath (turtle): test-02.stog.amr.ttl
- INFO - ----- AMR-RDF triple successfully processed (test-02.stog.amr.nt)
- INFO - ----- AMR-RDF t
rip
le successfully processed (test-02.stog.amr.ttl)
- INFO - ----- AMR-RDF t
urt
le successfully processed (test-02.stog.amr.ttl)
This diff is collapsed.
Click to expand it.
tests/test_amrbatch_main.py
+
6
−
5
View file @
c3a9eb30
...
...
@@ -26,13 +26,14 @@ from utility import file_cutter
# -- Input Data
# input_filename = f'08d1b73a-bdf5-4b54-8e6e-b96665f3c2fa.txt'
#
input_filename = f'test.txt'
input_filename
=
f
'
SSC-ABSTRACT.txt
'
input_filename
=
f
'
test.txt
'
#
input_filename = f'SSC-ABSTRACT.txt'
input_filepath
=
f
'
{
INPUT_DIR_PATH
}{
input_filename
}
'
# -- Output references
base_output_name
=
f
'
SolarSystem
'
# f'Test'
base_output_name
=
f
'
Test
'
# base_output_name = f'SolarSystem'
time_ref
=
f
'
{
datetime
.
now
().
strftime
(
"
%Y%m%d
"
)
}
'
output_dirpath
=
f
'
{
OUTPUT_DIR_PATH
}{
base_output_name
}
-
{
time_ref
}
/
'
os
.
makedirs
(
output_dirpath
,
exist_ok
=
True
)
...
...
@@ -63,8 +64,8 @@ for amr_graph in amr_graph_list:
# -- Parsing from a string
reading_file
=
open
(
input_filepath
,
"
r
"
)
input_string
=
reading_file
.
read
()
#
reading_file = open(input_filepath, "r")
#
input_string = reading_file.read()
#data_reference = os.path.splitext(os.path.basename(input_filepath))[0]
# data_reference = None
# data_reference = 'testReference'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment