Giter VIP home page Giter VIP logo

zero-shot-semantic-parsing's Introduction

Decoupling Structure and Lexicon for Zero-Shot Semantic Parsing

Jonathan Herzig and Jonathan Berant

Code for the zero-shot semantic parser described in our EMNLP 2018 paper.

The structure mapper implementation is an extension of this code.

Setup

  1. Install Miniconda2
  2. Install Stanford CoreNLP:
$ wget http://nlp.stanford.edu/software/stanford-corenlp-full-2016-10-31.zip
$ unzip stanford-corenlp-full-2016-10-31.zip 
  1. Install python dependencies:
$ conda install --file reqs_conda.txt
$ pip install -r reqs_pip.txt

Preprocess

To delexicalize data for all domains run and prepare cross domain splits use:

$ python src/py/zero_shot/preprocess.py 

Train and evaluate

To run one of the models implemented in the paper use:

$ sh scripts/MODEL.sh SPLIT

Where: MODEL is one of the following: zero_shot, cross_lex, cross_lex_rep, in_abstract, in_lex. SPLIT is either test (the original train/test split of the OVERNIGHT dataset), or dev (in this case the original train set is split to 80%/20% train/test sets).

To run all models use:

$ sh scripts/run_all.sh

Results are saved to /res folder. To print all results use:

$ python src/py/zero_shot/print_res.py

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.