Skip to main content

A framework for building semantic parsers (including neural module networks) with AllenNLP, built by the authors of AllenNLP

Project description

allennlp-semparse

Build status codecov

A framework for building semantic parsers (including neural module networks) with AllenNLP, built by the authors of AllenNLP

Supported datasets

  • ATIS
  • Text2SQL
  • NLVR
  • WikiTableQuestions

Supported models

  • Grammar-based decoding models, following the parser originally introduced in Neural Semantic Parsing with Type Constraints for Semi-Structured Tables. The models that are currently checked in are all based on this parser, applied to various datasets.
  • Neural module networks. We don't have models checked in for this yet, but DomainLanguage supports defining them, and we will add some models to the repo once papers go through peer review. The code is slow (batching is hard), but it works.

Tutorials

Coming sometime in the future... You can look at this old tutorial, but the part about using NLTK to define a grammar is outdated. Now you can use DomainLanguage to define a python executor, and we analyze the type annotations in the functions in that executor to automatically infer a grammar for you. It is much easier to use than it used to be. Until we get around to writing a better tutorial for this, the best way to get started using this is to look at some examples. The simplest is the Arithmetic language in the DomainLanguage test (there's also a bit of description in the DomainLanguage docstring). After looking at those, you can look at more complex (real) examples in the domain_languages module. Note that the executor you define can have learned parameters, making it a neural module network. The best place to get an example of that is currently this unfinished implementation of N2NMNs on the CLEVR dataset. We'll have more examples of doing this in the not-too-distant future.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for allennlp-semparse, version 0.0.1rc1
Filename, size File type Python version Upload date Hashes
Filename, size allennlp_semparse-0.0.1rc1-py3-none-any.whl (222.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size allennlp_semparse-0.0.1rc1.tar.gz (165.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page