Code Monkey home page Code Monkey logo

petra's Introduction

PeTra

Code and data for the ACL 2020 paper PeTra: A Sparsely-Supervised Memory Model for People Tracking

Requirements

Install python3 requirements:pip install -r requirements

Data

The gap files have been downloaded from the GAP repo
We created the diagnostic test of counting unique people in a document for which we annotated 100 GAP validation instances. The annotation file is data/num_people.tsv

Training/Validation

git clone https://github.com/shtoshni92/petra.git
cd petra/
export PYTHONPATH=${PWD}/src:$PYTHONPATH
python src/experiments/main.py -model_size [base/large] -mem_type [vanilla/learned/key_val] -num_cells [10/20] -data_dir data/ -base_model_dir DIRECTORY_TO_STORE_ALL_MODELS

Since we don't finetune BERT, all experiments can be done on a 12GB GPU.
Evaluation will be automatically done at the end of the training. Passing the -eval flag is another way to perform evaluation.

Important Hyperparams

  • model_size: Specify the size of the BERT model between base and large.
  • mem_type: Type of memory cell architecture: 'vanilla' -> PeTra, 'learned' -> PeTra + Learned Init., 'key_val' -> PeTra + Fixed Key
  • num_cells: Vary the memory size

For more hyperparams, check src/experiments/main.py

Pretrained Models

We release pretrained models (<20 MB in size) for a selected few configurations of the vanilla model.

Human Evaluation

We conducted a human evaluation to test the interpretability of the models.
In analysis/human_eval we share the evaluation interface code with a sample evaluation split.

Inference - Colab

Here's a Colab notebook where we perform inference with a pretrained model and visualize the memory logs.

Citation

@inproceedings{toshniwal2020petra,
    title = {{PeTra: A Sparsely Supervised Memory Model for People Tracking}},
    author = "Shubham Toshniwal and Allyson Ettinger and Kevin Gimpel and Karen Livescu",
    booktitle = "ACL",
    year = "2020",
}

petra's People

Contributors

shtoshni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

petra's Issues

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.