cd /lfs1/vzaytsev/software/metaphor-search/
HUGIN_ROOT=$PWD/hugin
SEAR_ROOT=$PWD/sear
METAPHOR_ROOT=$PWD/metaphor
export PYTHONPATH=PYTHONPATH:$HUGIN_ROOT:$SEAR_ROOT:$METAPHOR_ROOT
export NLTK_DATA=/lfs1/vzaytsev/nltk
# Specify language, choices: ru, es, en
LANG=en
SENTENCES_ROOT=/lfs1/vzaytsev/corpora2/$LANG/sentence_index
DOCUMENTS_ROOT=/lfs1/vzaytsev/corpora2/$LANG/document_index
# change this according to your query file:
QUERIES=/lfs1/vzaytsev/corpora2/$LANG/queries/query.*.json # this can be a pattern
# set any location for found metaphors
OUT_DIR=/lfs1/vzaytsev/corpora2/$LANG/found/
python scripts/run_sentence_candidates.py \
-i $SENTENCES_ROOT \
-c $DOCUMENTS_ROOT \
-l $LANG \
-f json \
-q $QUERIES \
-o $OUT_DIR \
-x 0 \
-e ".metaphors" \
-p 1
-i
,--input
LF sentences index root location.-c
,--context_input
Context index root location.-l
,--language
Data language:ru
,es
, oren
.-f
,--format
Output format:json
orplain
.-o
,--output
Location of the output directory.-x
,--output_lf
Put logic form of found metaphor to output file:0
or1
.-q
,--query
Metaphor search query file.-e
,--extension
Extension that will be addet to the output files. Default is.metaphors.json
.-p
,--use_pos
Use parts of speech. Postfixes such as-\w+
(-n
,-vb
, etc) if present, will be recognised as additional part of speech constraint in query. Default is0
.
{
"annotation": {
"label": "poverty",
"language": "english",
"corpus": "gigaword",
"source_frame": "building",
"source_concept_subdomain": "",
"target_frame": "wealth",
"target_concept_domain": "economy",
"target_concept_subdomain": "wealth"
},
"query": {
"max_path_lenght": 100,
"targets": [
"money-n"
],
"sources": [
"water-n"
]
}
}