Code for our paper Identifying relevant common sense information in knowledge graphs, built on top of the code from Pan et al..
This is the code for the first place in the textgraphs-15 competition
paper :DeepBlueAI at TextGraphs 2021 Shared Task: Treating Multi-HopInference Explanation Regeneration as A Ranking Problem
conda create -n deepblue python=3.8.5 numpy matplotlib ipython
conda activate deepblue
conda install pytorch=1.6 cudatoolkit=10.1 -c pytorch
pip install pandas==1.2.3 transformers==4.5.1 sklearn
- pytorch=1.6
- transformers=4.5.1
- pandas=1.2.3
- cuda=10.1
- python=3.8.5
roberta-large
https://huggingface.co/roberta-large/tree/main
ernie-2.0-large-en
https://huggingface.co/nghuyong/ernie-2.0-large-en/tree/main
recall train
python recall_trainer.py --output_dir=save_model/recall/roberta --bert_path=roberta-large --per_gpu_batch_size 48
python recall_trainer.py --output_dir=save_model/recall/ernie --bert_path=nghuyong/ernie-2.0-large-en --per_gpu_batch_size 48
recall predict
python recall_predict.py
sort train
python sort_trainer.py --output_dir=save_model/sort/roberta --bert_path=roberta-large --per_gpu_batch_size 48
python sort_trainer.py --output_dir=save_model/sort/ernie --bert_path=nghuyong/ernie-2.0-large-en --per_gpu_batch_size 48
sort predict
python sort_predict.py
The result is "result/predict.txt"