GithubHelp home page GithubHelp logo

hubayirp / eraserbenchmark Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jayded/eraserbenchmark

0.0 1.0 0.0 45 KB

A benchmark for understanding and evaluating rationales: http://www.eraserbenchmark.com/

License: Apache License 2.0

Python 90.78% Jupyter Notebook 9.22%

eraserbenchmark's Introduction

eraserbenchmark

A benchmark for understanding and evaluating rationales: http://www.eraserbenchmark.com/

Core Files

The core files are utils and metrics. These two files comprise everything you need to work with our released datasets.

utils documents everything you need to know about our input formats. Output formats and validation code are covered in metrics.

Models

At the moment we offer two forms of pipeline models:

  • (Lehman, et al., 2019) - sentence level rationale identification, followed by taking the best resulting sentence and classifying it.
    • Both portions of this pipeline function via encoding the input sentence (via a GRU), attending (conditioned on a query vector), and making a classification.
  • BERT-To-BERT - the same as above, but using a BERT model.

(Lehman, et al., 2019) Pipeline

To run this model, we need to first:

  • create a model_components, data, and output, directory
  • download GloVe vectors from http://nlp.stanford.edu/data/glove.6B.zip and extract the 200 dimensional vector to model_components
  • download http://evexdb.org/pmresources/vec-space-models/PubMed-w2v.bin to model_components
  • set up a virtual env meeting requirements.txt
  • download data from the primary website to data and extract each dataset to its respective directory
  • ensure that we have at least an 11G GPU. Reducing batch sizes may enable running on a smaller GPU.

Then we can run (as an example):

PYTHONPATH=./:$PYTHONPATH python rationale_benchmark/models/pipeline/pipeline_train.py --data_dir data/movies --output_dir output/movies --model_params param/movies.json
PYTHONPATH=./:$PYTHONPATH python rationale_benchmark/metrics.py --split test --data_dir data/movies --results output/movies/test_decoded.jsonl --score_file output/movies/test_scores.json

BERT-To-BERT Pipeline

To run this model, instructions are effectively the same as the simple pipeline above, except we also need:

Then we can run (as an example):

PYTHONPATH=./:$PYTHONPATH python rationale_benchmark/models/pipeline/bert_pipeline.py --data_dir data/movies --output_dir output_bert/movies --model_params param/movies.json
PYTHONPATH=./:$PYTHONPATH python rationale_benchmark/metrics.py --split test --data_dir data/movies --results output_bert/movies/test_decoded.jsonl --score_file output_bert/movies/test_scores.json

More models including Lei et al can be found at : https://github.com/successar/Eraser-Benchmark-Baseline-Models

eraserbenchmark's People

Contributors

jayded avatar

Watchers

 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.