Skip to content
forked from thunlp/GEAR

Source code for ACL 2019 paper "GEAR: Graph-based Evidence Aggregating and Reasoning for Fact Verification"

License

Notifications You must be signed in to change notification settings

WangChihYen/GEAR

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GEAR

Source code and dataset for the ACL 2019 paper "GEAR: Graph-based Evidence Aggregating and Reasoning for Fact Verification".

Requirements:

Please make sure your environment includes:

python (tested on 3.6.7)
pytorch (tested on 1.0.0)

Then, run the command:

pip install -r requirements.txt

Evidence Extraction

We use the codes from Athene UKP TU Darmstadt in the document retrieval and sentence selection steps.

Our evidence extraction results can be found in Tsinghua Cloud or Google Cloud.

Download these files and put them in the data/retrieved/ folder. Then the folder will look like

data/retrieved/
    train.ensembles.s10.jsonl
    dev.ensembles.s10.jsonl
    test.ensembles.s10.jsonl

Data Preparation

# Download the fever database
wget -O data/fever/fever.db https://s3-eu-west-1.amazonaws.com/fever.public/wiki_index/fever.db

# Extract the evidence from database
cd scripts/
#drqa一直裝不好
python retrieval_to_bert_input.py

# Build the datasets for gear
#路徑有問題
python build_gear_input_set.py

cd ..

Feature Extraction

First download our pretrained BERT-Pair model (Tsinghua Cloud or Google Cloud) and put the files into the pretrained_models/BERT-Pair/ folder.

Then the folder will look like this:

pretrained_models/BERT-Pair/
    	pytorch_model.bin
    	vocab.txt
    	bert_config.json

Then run the feature extraction scripts.

cd feature_extractor/
#sh取代下面
chmod +x *.sh
./train_extracor.sh 
#IndexError: list index out of range
./dev_extractor.sh 
#FileNotFoundError: [Errno 2] No such file or directory: '../data/gear/gear-dev-set-0_001.tsv'
./test_extractor.sh 
#FileNotFoundError: [Errno 2] No such file or directory: '../data/gear/gear-test-set-0_001.tsv'
cd ..

GEAR Training

cd gear
CUDA_VISIBLE_DEVICES=0 python train.py
#前面沒有設好 所以路徑有問題
cd ..

GEAR Testing

cd gear
CUDA_VISIBLE_DEVICES=0 python test.py
#前面沒有設好 所以路徑有問題
cd ..

Results Gathering

cd gear
python results_scorer.py
#前面沒有設好 所以路徑有問題
cd ..

Cite

If you use the code, please cite our paper:

@inproceedings{zhou2019gear,
  title={GEAR: Graph-based Evidence Aggregating and Reasoning for Fact Verification},
  author={Zhou, Jie and Han, Xu and Yang, Cheng and Liu, Zhiyuan and Wang, Lifeng and Li, Changcheng and Sun, Maosong},
  booktitle={Proceedings of ACL 2019},
  year={2019}
}

About

Source code for ACL 2019 paper "GEAR: Graph-based Evidence Aggregating and Reasoning for Fact Verification"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.2%
  • Shell 1.8%