Skip to content
Snippets Groups Projects
Commit 864101f7 authored by David Rouquet's avatar David Rouquet
Browse files

Add a config.ini for the convert_text_to_amr.py script

parent 9cde65ef
Branches
No related tags found
No related merge requests found
...@@ -37,7 +37,9 @@ to be processed. ...@@ -37,7 +37,9 @@ to be processed.
This project was developp under Python 3 and Manjaro Linux system, but it should This project was developp under Python 3 and Manjaro Linux system, but it should
run on any common system. 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). [virtual environment](https://docs.python.org/fr/3/tutorial/venv.html).
For example, 'ssc-env' can be create and use with the following commands: For example, 'ssc-env' can be create and use with the following commands:
......
[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/
...@@ -21,40 +21,44 @@ from rdflib import Graph ...@@ -21,40 +21,44 @@ from rdflib import Graph
import traceback import traceback
import logging import logging
import configparser
from amrlib.graph_processing.amr_plot import AMRPlot from amrlib.graph_processing.amr_plot import AMRPlot
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
config = configparser.ConfigParser()
config.read('config.ini')
#config['PARAM']['']
#============================================================================== #==============================================================================
# Parameters # Parameters
#============================================================================== #==============================================================================
# Input/Output Directories # Input/Output Directories
INPUT_DIR = "inputData/" INPUT_DIR = config['PARAM']['INPUT_DIR']
OUTPUT_DIR = "outputData/" OUTPUT_DIR = config['PARAM']['OUTPUT_DIR']
# Reference Suffix # Reference Suffix
TEXT_SUFFIX = ".txt" TEXT_SUFFIX = config['PARAM']['TEXT_SUFFIX']
SENTENCE_SUFFIX = ".sentence.txt" SENTENCE_SUFFIX = config['PARAM']['SENTENCE_SUFFIX']
PENMAN_AMR_GRAPH_SUFFIX = ".stog.amr.penman" PENMAN_AMR_GRAPH_SUFFIX = config['PARAM']['PENMAN_AMR_GRAPH_SUFFIX']
DOT_AMR_GRAPH_SUFFIX = ".stog.amr.dot" DOT_AMR_GRAPH_SUFFIX = config['PARAM']['DOT_AMR_GRAPH_SUFFIX']
PNG_AMR_GRAPH_SUFFIX = ".stog.amr.png" PNG_AMR_GRAPH_SUFFIX = config['PARAM']['PNG_AMR_GRAPH_SUFFIX']
AMR_RDF_SUFFIX = ".stog.amr.nt" AMR_RDF_SUFFIX = config['PARAM']['AMR_RDF_SUFFIX']
AMR_TTL_SUFFIX = ".stog.amr.ttl" AMR_TTL_SUFFIX = config['PARAM']['AMR_TTL_SUFFIX']
# AMR Lib Models # AMR Lib Models
AMR_MODEL_DIR = '/home/lamenji/.local/lib/python3.10/site-packages/amrlib/data/' AMR_MODEL_BASEDIR = config['PARAM']['AMR_MODEL_BASEDIR']
AMR_MODEL_DIR = 'amrModel/' AMR_MODEL_DIR = config['PARAM']['AMR_MODEL_DIR']
AMR_MODEL_XFM_LARGE = AMR_MODEL_DIR + 'model_parse_xfm_bart_large-v0_1_0'
amr_model = AMR_MODEL_XFM_LARGE
# AMRLD Parameters # AMRLD Parameters
AMRLD_DIR = 'lib/amrld/' AMRLD_DIR = config['PARAM']['AMRLD_DIR']
AMRLD_DIR_BACK = '../../' AMRLD_DIR_BACK = config['PARAM']['AMRLD_DIR_BACK']
WK_DIR = 'wk/' WK_DIR = config['PARAM']['WK_DIR']
AMRLD_WORKDIR = AMRLD_DIR + WK_DIR AMRLD_WORKDIR = AMRLD_DIR + WK_DIR
amr_model = AMR_MODEL_BASEDIR + AMR_MODEL_DIR
#============================================================================== #==============================================================================
# Functions to define filepath # Functions to define filepath
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment