transition-amr-parser
project.cuda
is enabled if you are on a machine with a GPU.make install [$isi_username]
~/miniconda3
. If it is not, replace Line 27 of setup.sh
with: source ~/PATH_TO_MINICONDA_INSTALL
.isi_username
, it will assume that you can access the minlp-dev-01
server and that you are working from a local system.
In that case, you will be prompted for a password after you see
"Downloading model..."
If not, it will assume that you are working from a /nas
-mounted server.data/
:
edl.edl_output_dir
): https://drive.google.com/file/d/16ANEPjqy4byNY3B2BmYqsu1ZcBlp9tfR/view?usp=sharingThese instructions assume that you are building the image on the SAGA cluster.
cd
into cdse-covid
and clone the following repos:
git clone https://github.com/isi-vista/aida-tools.git
git clone https://github.com/elizlee/amr-utils.git
git clone https://github.com/isi-vista/saga-tools.git
git clone https://github.com/IBM/transition-amr-parser.git
transition-amr-parser
installation is updated and on the master
branch.cd
to transition-amr-parser/preprocess
and do the following:
git clone https://github.com/jflanigan/jamr.git
git clone https://github.com/damghani/AMR_Aligner.git
mv AMR_Aligner kevin
cd transition-amr-parser/preprocess/kevin
:git clone https://github.com/moses-smt/mgiza.git
/scratch/dockermount/cdse_covid_resources
:
wikidata_classifier.state_dict
--> cdse-covid/wikidata_linker/resources
/scratch/dockermount/cdse_covid_resources/AMR2.0
--> transition-amr-parser/DATA
cd
back into cdse-covid
and run
docker build . -t isi-cdse-covid:<tag>
conda activate <cdse-covid-env>
python -m cdse_covid.pegasus_pipeline.claim_pipeline params/claim_detection.params
bash setup.sh
pegasus-status PEGASUS/RUN/DIR -w 60
We provide a simple way to run the whole pipeline without needing Pegasus WMS.
params/run_pipeline_params.params
bash ./run_pipeline.sh your/params/file
Create the AMR files
The files in TXT_FILES
should consist of sentences separated by line.
conda activate transition-amr-parser
python -m cdse_covid.pegasus_pipeline.run_amr_parsing_all \
--corpus TXT_FILES \
--output AMR_FILES \
--max-tokens MAX_TOKENS \
--amr-parser-model TRANSITION_AMR_PARSER_PATH
conda activate <cdse-covid-env>
python -m cdse_covid.pegasus_pipeline.ingesters.aida_txt_ingester \
--corpus TXT_FILES --output SPACIFIED --spacy-model SPACY_PATH
conda activate <cdse-covid-env>
python -m cdse_covid.pegasus_pipeline.ingesters.edl_output_ingester \
--edl-output EDL_OUTPUT --output EDL_MAPPING_FILE
conda activate <cdse-covid-env>
python -m cdse_covid.claim_detection.run_claim_detection \
--input SPACIFIED \
--patterns claim_detection/topics.json \
--out CLAIMS_OUT \
--spacy-model SPACY_PATH
conda activate transition-amr-parser
python -m cdse_covid.semantic_extraction.run_amr_parsing \
--input CLAIMS_OUT \
--output AMR_CLAIMS_OUT \
--amr-parser-model TRANSITION_AMR_PARSER_PATH \
--max-tokens MAX_TOKENS \
--domain DOMAIN
conda activate <cdse-covid-env>
python -m cdse_covid.semantic_extraction.run_srl \
--input AMR_CLAIMS_OUT \
--output SRL_OUT \
--spacy-model SPACY_PATH
conda activate <cdse-covid-env>
python -m cdse_covid.semantic_extraction.run_wikidata_linking \
--claim-input CLAIMS_OUT \
--srl-input SRL_OUT \
--amr-input AMR_CLAIMS_OUT \
--output WIKIDATA_OUT
conda activate <cdse-covid-env>
python -m cdse_covid.semantic_extraction.run_entity_merging \
--edl EDL_MAPPING_FILE \
--qnode-freebase QNODE_FREEBASE_MAPPING \
--freebase-to-qnodes FREEBASE_TO_QNODES \
--claims WIKIDATA_OUT \
--output ENTITY_OUT \
--include-contains
conda activate <cdse-covid-env>
python -m cdse_covid.pegasus_pipeline.convert_claims_to_json \
--input ENTITY_OUT \
--output OUTPUT_FILE
conda activate <cdse-covid-env>
python -m cdse_covid.pegasus_pipeline.ingesters.claims_json_to_aif \
--claims-json OUTPUT FILE \
--aif-dir AIF_OUTPUT_DIR
make precommit
to run all precommit checks.