This director contains lasagneSP model adapted from https://github.com/endrikacupaj/LASAGNE.
For building an inverted index on wikidata entities we use elastic search. Consider the script file csqa_elasticse.py for doing so.
Before training the framework, we need to create BERT embeddings for the knowledge graph (entity) types and relations. You can do that by running.
python scripts/bert_embeddings.py
python train.py --data_path /preprocessed_data
Inference is performed per question-type.
python inference.py --question_type QTYPE --model_path experiments/snapshots/model_path.pth.tar --data_path /preprocessed_data
Where QTYPE is in ("Clarification" "Comparative Reasoning (All)" "Comparative Reasoning (Count) (All)" "Logical Reasoning (All)" "Quantitative Reasoning (All)" "Quantitative Reasoning (Count) (All)" "Simple Question (Coreferenced)" "Simple Question (Direct)" "Simple Question (Ellipsis)" "Verification (Boolean) (All)" "Simple Question (Coreferenced)" "Verification (Boolean) (All)")
To eexcute and evalute the inferred files, run the following script in evaluation folder.
bash execute_all.sh
python summarise_results.py --file_path out_dir
The repository is under MIT License.