Giter VIP home page Giter VIP logo

drop-semparse-baseline's Introduction

Semantic parsing baselines for DROP

Code for the semantic parsing baseline models sescribed in the following dataset paper by Dua et al.:

DROP: A Reading Comprehension Benchmark Requiring Discrete Reasoning Over Paragraphs

Here are the instructions for using this code:

0. Install requirements

pip install -r ./requirements.txt
python -m spacy download en

1. Preprocessing

Transform passages into structured representations:

python scripts/preprocess_data.py data_file tables_output_path tagger

Where tagger indicates the underlying representation to use (one of srl, dep, or oie).

Alternatively, run preprocessing for all representations on the current train file, by running:

bash scripts/preprocess_data.sh data_file tables_output_path

2. Training

We will train a semantic parser from weak (denotation-only) supervision using Maximum Marginal Likelihood. This requires a set of approximate logical forms (those that evaluate to the correct denotation, but do not necessarily have correct semantics) for each training instance. You can generate those in the following way:

python scripts/search_for_logical_forms.py tables_output_path data_file logical_forms_output_path --use-agenda --output-separate-files --num-splits 10

Run python scripts/search_for_logical_forms.py -h to understand the arguments.

Finally, you can train a model using allennlp as follows:

allennlp train config.json -s training_output_path --include-package semparse

Here is a sample configureation file.

drop-semparse-baseline's People

Contributors

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