Learning Structured Natural Language Representations for Semantic Parsing

Jianpeng Cheng, Siva Reddy, Vijay A. Saraswat, Mirella Lapata

Abstract

We introduce SCANNER (SymboliC meANiNg rEpResentation), a neural semantic parser that converts natural language utterances into intermediate predicate-argument structures. These structures are induced via a transition system and subsequently grounded to target domains. By bridging the gap between interpretable symbolic systems and flexible neural models, SCANNER achieves competitive results on several benchmarks, including state-of-the-art performance on the SPADES and GRAPHQUESTIONS datasets.

Introduction

Semantic parsing—the conversion of natural language into machine-executable code—has traditionally been approached through either grammar-based systems or neural sequence-to-sequence (Seq2Seq) models. Grammar-based systems, such as those using Combinatory Categorial Grammar (CCG), offer interpretability and structural guarantees but often require extensive manual feature engineering. Conversely, neural Seq2Seq models are flexible and easy to train but function as "black boxes" that frequently struggle with structural constraints, potentially generating syntactically invalid queries.

SCANNER addresses these challenges by introducing a transition-based neural parser that ensures structural integrity while maintaining the flexibility of neural learning.

Methodology

The core of SCANNER is a two-stage process that first generates an ungrounded representation before mapping it to a specific database schema.

Transition-Based Parsing

The model employs a transition system involving a stack and a buffer to construct a tree structure. It utilizes three primary actions:

  • NT(X): Creates a non-terminal predicate.
  • TER(X): Identifies a terminal entity.
  • RED: Reduces or closes a branch in the tree.

This approach guarantees that the output is always a well-formed tree, avoiding the "unbalanced bracket" errors common in standard Seq2Seq models.

The transition system builds a structured representation using NT, TER, and RED actions.

Intermediate Representation and Grounding

SCANNER first parses sentences into an ungrounded representation using natural language words as predicates (e.g., border(texas)). This representation is domain-general and human-readable. Subsequently, a bi-linear neural mapping "grounds" these predicates into database-specific symbols (e.g., mapping "border" to location.adjoins). This process relies on an isomorphism assumption, where the structure of the natural language parse is assumed to match the shape of the database query.

Experimental Results

The model was evaluated on four diverse datasets: GEOQUERY, SPADES, WEBQUESTIONS, and GRAPHQUESTIONS.

Performance

SCANNER achieved state-of-the-art (SOTA) results on the large-scale SPADES dataset and the GRAPHQUESTIONS benchmark. It also performed competitively on GEOQUERY and WEBQUESTIONS, matching or exceeding previous neural baselines.

SCANNER achieves state-of-the-art F1 scores on the SPADES dataset compared to previous CCG and neural baselines.

Interpretability

A key advantage of SCANNER is its interpretability. Because the intermediate representation uses natural language words, developers can inspect the ungrounded parse to diagnose failures. In manual evaluations on GEOQUERY, the induced representations matched human-annotated gold standards with 79.3% exact match accuracy.

Discussion and Limitations

While SCANNER provides a robust framework for semantic parsing, it is limited by the isomorphism constraint. In some cases, a single natural language word may correspond to multiple database relations, a scenario the current model handles with difficulty. Future work may explore semi-Markov assumptions to accommodate these one-to-many mappings. Additionally, the current use of variable-free logic (FunQL) limits the model's ability to handle complex linguistic phenomena like co-reference.

Despite these limitations, SCANNER demonstrates that inducing structured intermediate representations is a powerful strategy for building accurate, interpretable, and structurally sound semantic parsers.

Summary updated

BibTeX
@inproceedings{cheng2017learning,
  author = {Jianpeng Cheng and Siva Reddy and Vijay A. Saraswat and Mirella Lapata},
  title = {{Learning Structured Natural Language Representations for Semantic Parsing}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2017},
  url = {https://openreview.net/forum?id=BJ-FSjx_ZH},
}
Figure