GithubHelp home page GithubHelp logo

sth4k / adversarial-squad Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robinjia/adversarial-squad

0.0 2.0 0.0 378 KB

Code from Jia and Liang, "Adversarial Examples for Evaluating Reading Comprehension Systems" (EMNLP 2017)

Python 73.75% Shell 2.75% HTML 4.78% Jupyter Notebook 13.97% Lua 4.75%

adversarial-squad's Introduction

Adversarial Examples for Evaluating Reading Comprehension Systems (EMNLP 2017)

This repository contains code for the paper:

Adversarial Examples for Evaluating Reading Comprehension Systems.
Robin Jia and Percy Liang
Empirical Methods in Natural Language Processing (EMNLP), 2017.

Note: To download our adversarial data, view all of our experiments, and find instructions for running adversarial evaluation on your own SQuAD model, please see our Codalab worksheet. This git repository just exposes the code that was used to generate some of the files on that Codalab worksheet.

Dependencies

Run pull-dependencies.sh to pull SQuAD data, GloVe vectors, Stanford CoreNLP, and some custom python utilities. Other python requirements are in requirements.txt.

Examples

The following sequence of commmands generates the raw AddSent training data described in Section 4.6 of our paper.

mkdir out
# Precompute nearby words in word vector space; takes roughly 1 hour
python src/py/find_squad_nearby_words.py glove/glove.6B.100d.txt -n 100 -f data/squad/train-v1.1.json > out/nearby_n100_glove_6B_100d.json
# Run CoreNLP on the SQuAD training data; takes roughly 1 hour, uses ~18GB memory
python src/py/convert_questions.py corenlp -d train
# Actually generate the raw AddSent examples; takes roughly 7 minutes, uses ~15GB memory
python src/py/convert_questions.py dump-highConf -d train -q

The final script will generate three files with prefix train-convHighConf in the out directory, including train-convHighConf.json. train-convHighConf-mturk.tsv is in a format that can be processed by scripts in the mturk directory.

Other one-off scripts are described in their docstrings.

adversarial-squad's People

Contributors

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