Type-driven Incremental Semantic Parser
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
feats
lambda_expr
sampledata
utils
LICENSE
README.md
expr_templates
forceddecoding.py
geoquery.py
indep_knowledgebase.py
knowledgebase.py
model.py
parser.py
parsing_state.py
pmi.py
svector.py
trainer.py
wvector.py

README.md

Type-driven Incremental Semantic Parser

License: MIT

This repository contains an implementation of the semantic parser in paper Type-driven Incremental Semantic Parsing with Polymorphism.

Required Dependencies

  1. PyPy: due to the heavy computation required by this parser, it is strongly recommended to use PyPy instead of CPython. This program is tested with PyPy 5.4.0.
  2. Python packages including:
  3. python-gflags: used for command-line arguments parsing.
  4. pyparsing: used for parsing lambda expressions in the dataset.

Training

To train on the provided sample data set and saving the model, you can run:

trainer.py --outputprefix exps/demotrain

where exps is a directory storing all training models, and demotrain is the prefix of the saved model file. The trainer will dump its weights to a standalone weight file (a pickle file) at each training iteration.

Evaluating

To evaluate the trained model on development set and testing set, you can run:

trainer.py --eval exps/demotrain.9.pickle

where exps/demotrain.9.pickle is a weight file saved in the previous training.