Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Corpus Making Tool
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
corpus
Corpus Making Tool
Commits
864101f7
Commit
864101f7
authored
2 years ago
by
David Rouquet
Browse files
Options
Downloads
Patches
Plain Diff
Add a config.ini for the convert_text_to_amr.py script
parent
9cde65ef
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+3
-1
3 additions, 1 deletion
README.md
config.sample.ini
+23
-0
23 additions, 0 deletions
config.sample.ini
convert_text_to_amr.py
+20
-16
20 additions, 16 deletions
convert_text_to_amr.py
with
46 additions
and
17 deletions
README.md
+
3
−
1
View file @
864101f7
...
...
@@ -37,7 +37,9 @@ to be processed.
This project was developp under Python 3 and Manjaro Linux system, but it should
run on any common system.
First, it is recommended to use a
Copy
`config.sample.ini`
to
`config.ini`
and optionaly adapt it to your needs.
It is recommended to use a
[
virtual environment
](
https://docs.python.org/fr/3/tutorial/venv.html
)
.
For example, 'ssc-env' can be create and use with the following commands:
...
...
This diff is collapsed.
Click to expand it.
config.sample.ini
0 → 100644
+
23
−
0
View file @
864101f7
[PARAM]
# Input/Output Directories
INPUT_DIR
=
inputData/
OUTPUT_DIR
=
outputData/
# Reference Suffix
TEXT_SUFFIX
=
.txt
SENTENCE_SUFFIX
=
.sentence.txt
PENMAN_AMR_GRAPH_SUFFIX
=
.stog.amr.penman
DOT_AMR_GRAPH_SUFFIX
=
.stog.amr.dot
PNG_AMR_GRAPH_SUFFIX
=
.stog.amr.png
AMR_RDF_SUFFIX
=
.stog.amr.nt
AMR_TTL_SUFFIX
=
.stog.amr.ttl
# AMR Lib Models
AMR_MODEL_BASEDIR
=
amrModel/
AMR_MODEL_DIR
=
model_parse_xfm_bart_large-v0_1_0
# AMRLD Parameters
AMRLD_DIR
=
lib/amrld/
AMRLD_DIR_BACK
=
../../
WK_DIR
=
wk/
This diff is collapsed.
Click to expand it.
convert_text_to_amr.py
+
20
−
16
View file @
864101f7
...
...
@@ -21,40 +21,44 @@ from rdflib import Graph
import
traceback
import
logging
import
configparser
from
amrlib.graph_processing.amr_plot
import
AMRPlot
logger
=
logging
.
getLogger
(
__name__
)
config
=
configparser
.
ConfigParser
()
config
.
read
(
'
config.ini
'
)
#config['PARAM']['']
#==============================================================================
# Parameters
#==============================================================================
# Input/Output Directories
INPUT_DIR
=
"
inputData/
"
OUTPUT_DIR
=
"
outputData/
"
INPUT_DIR
=
config
[
'
PARAM
'
][
'
INPUT_DIR
'
]
OUTPUT_DIR
=
config
[
'
PARAM
'
][
'
OUTPUT_DIR
'
]
# Reference Suffix
TEXT_SUFFIX
=
"
.txt
"
SENTENCE_SUFFIX
=
"
.sentence.txt
"
PENMAN_AMR_GRAPH_SUFFIX
=
"
.stog.amr.penman
"
DOT_AMR_GRAPH_SUFFIX
=
"
.stog.amr.dot
"
PNG_AMR_GRAPH_SUFFIX
=
"
.stog.amr.png
"
AMR_RDF_SUFFIX
=
"
.stog.amr.nt
"
AMR_TTL_SUFFIX
=
"
.stog.amr.ttl
"
TEXT_SUFFIX
=
config
[
'
PARAM
'
][
'
TEXT_SUFFIX
'
]
SENTENCE_SUFFIX
=
config
[
'
PARAM
'
][
'
SENTENCE_SUFFIX
'
]
PENMAN_AMR_GRAPH_SUFFIX
=
config
[
'
PARAM
'
][
'
PENMAN_AMR_GRAPH_SUFFIX
'
]
DOT_AMR_GRAPH_SUFFIX
=
config
[
'
PARAM
'
][
'
DOT_AMR_GRAPH_SUFFIX
'
]
PNG_AMR_GRAPH_SUFFIX
=
config
[
'
PARAM
'
][
'
PNG_AMR_GRAPH_SUFFIX
'
]
AMR_RDF_SUFFIX
=
config
[
'
PARAM
'
][
'
AMR_RDF_SUFFIX
'
]
AMR_TTL_SUFFIX
=
config
[
'
PARAM
'
][
'
AMR_TTL_SUFFIX
'
]
# AMR Lib Models
AMR_MODEL_DIR
=
'
/home/lamenji/.local/lib/python3.10/site-packages/amrlib/data/
'
AMR_MODEL_DIR
=
'
amrModel/
'
AMR_MODEL_XFM_LARGE
=
AMR_MODEL_DIR
+
'
model_parse_xfm_bart_large-v0_1_0
'
amr_model
=
AMR_MODEL_XFM_LARGE
AMR_MODEL_BASEDIR
=
config
[
'
PARAM
'
][
'
AMR_MODEL_BASEDIR
'
]
AMR_MODEL_DIR
=
config
[
'
PARAM
'
][
'
AMR_MODEL_DIR
'
]
# AMRLD Parameters
AMRLD_DIR
=
'
lib/amrld/
'
AMRLD_DIR_BACK
=
'
../../
'
WK_DIR
=
'
wk/
'
AMRLD_DIR
=
config
[
'
PARAM
'
][
'
AMRLD_DIR
'
]
AMRLD_DIR_BACK
=
config
[
'
PARAM
'
][
'
AMRLD_DIR_BACK
'
]
WK_DIR
=
config
[
'
PARAM
'
][
'
WK_DIR
'
]
AMRLD_WORKDIR
=
AMRLD_DIR
+
WK_DIR
amr_model
=
AMR_MODEL_BASEDIR
+
AMR_MODEL_DIR
#==============================================================================
# Functions to define filepath
...
...
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