Giter Club home page Giter Club logo

This code is for paper "Explainable Natural Language Inference via Identifying Important Rationales".

  1. To run this code, you should obtain the data from https://github.com/OanaMariaCamburu/e-SNLI, and put the datas in the 'datas/raw_datas/' directory. Then process these data by run the 'process_data.py';

  2. go to the file of 'rationale_extra' and run the train.py and then the predict.py to predict the rationales;

  3. go to the file of 'rationales_sel' and run the main_selector.py to selector the rationales;

  4. go to the file of 'generator' and

    4.1 finetune the GPT2 model: run the 'prepare_data_for_finetune.py' and 'GPT2_finetune_lm.py';

    4.2 generate the NLEs by the finetuned model: run the 'prepare_data_for_generation.py' and 'GPT2_generate.py';

  5. go to the file of 'classify', and run the 'prepare_data_task_pred.py' to prepare data for train. Then, run the 'main_classify.py' to obtain the prediction results.

Note: All parameters use default values, and you can also set them at runtime.

After running the above code correctly, you will get the following files in the 'datas/snli_data_dir/' directory

 --train.json
 --dev.json
 --test.json
 --train-rationales.json
 --dev-rationales.json
 --test-rationales.json
 --train-with-hints.json
 --dev-with-hints.json
 --test-with-hints.json
 --train-prompts.txt  
 --train-prompts.txt
 --train-prompts.txt
 --train-finetune.txt
 --dev-finetune.txt
 --train-gen.txt
 --dev-gen.txt
 --test-gen.txt
 --train-r-with-e.txt
 --dev-r-with-e.txt
 --test-r-with-e.txt

boazyang1's Projects

exp-nli icon exp-nli

Config files for my GitHub profile.

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.