Code Monkey home page Code Monkey logo

predicitons_with_explanations's Introduction

Installation

  1. Clone the repository
git clone https://github.com/SanniM3/predicitons_with_explanations.git
cd feb
  1. Download and install Conda.

  2. Create and activate a Conda environment.

conda create -n feb python=3.7
conda activate feb
  1. Download the requirements.
pip install -r requirements.txt

python -m spacy download en_core_web_sm

wandb offline

Train/Eval Data

The following command will download the datasets (all except E-SNLI), but doesn't give splits we used for our experiments.

wget https://storage.googleapis.com/feb-data/data.zip
unzip data.zip

Run evaluation

T5/UnfifiedQA

We run our experiments on Google Cloud with N gpus allocated only for this project. All our experiments are done by jointly training models and evaluating them on the dev set. The command below will train and evaluate given models on chosen datasets with 60 random seeds:

python scripts/exp.py --exp_root <path_to_checkpoints_folder> --not_dryrun --model_vals <a string of models to evaluate separated by comma> --dataset_vals <a string of datasets to evaluate on, separated by comma> --n_gpus <number of available GPUs> --peft_method <PEFT method to be used>

By default these experiments will be done with IO formats (prompts) that find to work the best (according to the experiments in the paper), but you can play around with different values in format_dict in scripts/exp.py.

The same command with concrete values:

mkdir checkpoints
python scripts/exp.py --exp_root checkpoints --not_dryrun --model_vals t5-base,t5-large,t5-3b --dataset_vals esnli --n_gpus 4 --peft_method adalora
python scripts/exp.py --exp_root checkpoints --not_dryrun --model_vals allenai/unifiedqa-t5-base,allenai/unifiedqa-t5-large,allenai/unifiedqa-t5-3b --dataset_vals ecqa,sensemaking,sbic --n_gpus 4 --peft_method adalora

Collect results

After you're doing with training/eval with 60 seeds, you can collect results (mean, stddev) by running this:

mkdir out
python scripts/exp.py --exp_root <path_to_checkpoints_folder>  --collect_results

If you get the assertion error, check which runs have not been trained properly, repeat evaluating only those seeds, and run the above command again.

predicitons_with_explanations's People

Contributors

sannim3 avatar

Stargazers

SeshurajuP avatar Vincent avatar

Watchers

Pasquale Minervini avatar  avatar

Forkers

pminervini

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.