Coder Social home page Coder Social logo

ml-lab / gear Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thunlp/gear

0.0 2.0 0.0 9.62 MB

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

License: MIT License

Shell 1.85% Python 98.15%

gear's Introduction

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 link.

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/
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 link 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/
chmod +x *.sh
./train_extracor.sh
./dev_extractor.sh
./test_extractor.sh
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}
}

gear's People

Contributors

jayzzhou-thu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.