Executable Semantic Parsing

Jonathan Berant

  • Area: LaCo
  • Level: A
  • Week: 2
  • Time: 09:00 – 10:30 (we start on time!)
  • Room: C2.06


  • Thanks for attending the class! Don’t forget to give me feedback!
  • Give me feedback! Answer some simple questions here after tomorrow’s class.
  • What will we do tomorrow? You decide! Fill out this survey.
  • I didn’t get to talk about cube pruning for K-best parsing, but put a link to a presentation on the topic below.
  • If you missed class and would like to catch up one good way of doing that (other than going through the slides) is to go over the Sempre tutorial.
  • I added grammar and lexicon files for exercises and examples in class 3.
  • I updated the slides for class 1 to include the solution for the exercise + some type corrections.
  • To have better editting of your sempre commands install rlwrap.


Executable semantic parsing is the task of mapping natural language utterances into meaning representations that can be executed against a background knowledge-base. Interest in executable semantic parsers has raised dramatically in the past few years, as conversational interfaces are becoming more and more ubiquitous. The goal of this class is to provide an introduction to executable semantic parsing and to highlight the challenges in scaling semantic parsers to large domains. We will focus on three main questions: (a) What are the formal representations for natural language and how can one bridge the gap between natural language and formal language. (b) How can we learn to translate from natural language to formal language without requiring annotations of the formal language. (c) How can we develop algorithms that search through the space of logical forms efficiently.


Classes will include hands-on sections in which students will use the SEMPRE package to practice the material taught in class. ESSLLI will provide a virtual machine that students can connect to with SEMPRE already installed. However, it is easy and recommended to install SEMPRE on your own laptop if you have one by following these steps:

  1. Install all requirements as described in the installation section of SEMPRE.
  2. Install rlwrap (not required but makes life a lot easier).
  3. Install SEMPRE:

git clone https://github.com/percyliang/sempre
cd sempre

Download external dependencies (this might take a few minutes):

./pull-dependencies core corenlp esslli_2016 tables

Create a symbolic link for easier access later on:

ln -s lib/data/esslli_2016/esslli_2016 esslli_2016


ant core corenlp tables

Now test by running:

./run @mode=simple-lambdadcs

You will see a prompt. Use the following command to load a database:

(loadgraph esslli_2016/geo880.kg)

To verify you uploaded the database type:


You will see a lot of text. Now try to issue a simple query:

(execute mountain.maroon)

If SEMPRE returns a list containing mountain.marron you succeeded and you are done! To exit type ctrl+D

Compliation problem

If you get a compilation error complaining about the “Pair” class among other things do the following:

ant clean
rm -rf fig
./pull-dependencies core
ant core corenlp tables

Tentative Schedule

Class 1: slides

  • Introduction
  • Representations
    • Lambda calculus
    • Lambda-DCS


Class 2: slides

  • Compositionality
    • Grammars
    • Lexicons
    • Derivations

simple grammar
simple lexicon

Suggested solution for exercise 2. Try to use it only when stuck…
ex2 grammar
ex2 lexicon

Class 3: slides

  • Learning

Example grammar
Example lexicon

Class 4:

  • Parsing algorithms
    • CKY
    • Coarse parsing
    • Agenda-based parsing

k-best parsing

Class 5:

  • Advanced topics
    • Intermediate representations
    • Building a parser overnight
    • Deep learning

Additional References

Past tutorial on semantic parsing (focused on CCG and SPF)

High level overview of statistical semantic parsing