Skip to main content
QUICK REVIEW

[Paper Review] Semantic Parsing with Syntax- and Table-Aware SQL Generation

Yibo Sun, Duyu Tang|arXiv (Cornell University)|Apr 23, 2018
Natural Language Processing TechniquesComputer Science52 references14 citations
TL;DR

This paper proposes STAMP, a syntax- and table-aware neural semantic parser that generates executable SQL queries from natural language questions by leveraging column names, cell values, and SQL syntax through a three-channel pointer network. It achieves a new state-of-the-art execution accuracy of 74.4% on the WikiSQL dataset by improving column and cell prediction and modeling column-cell relationships.

ABSTRACT

We present a generative model to map natural language questions into SQL queries. Existing neural network based approaches typically generate a SQL query word-by-word, however, a large portion of the generated results are incorrect or not executable due to the mismatch between question words and table contents. Our approach addresses this problem by considering the structure of table and the syntax of SQL language. The quality of the generated SQL query is significantly improved through (1) learning to replicate content from column names, cells or SQL keywords; and (2) improving the generation of WHERE clause by leveraging the column-cell relation. Experiments are conducted on WikiSQL, a recently released dataset with the largest question-SQL pairs. Our approach significantly improves the state-of-the-art execution accuracy from 69.0% to 74.4%.

Motivation & Objective

  • To address the high error rate in neural semantic parsing due to mismatches between question words and table column names or cell values.
  • To improve SQL generation quality by incorporating structural information from tables and syntactic constraints of SQL.
  • To develop a sequence-to-SQL model that learns to generate correct and executable queries by selectively attending to question words, column names, and cell values.
  • To reduce ill-formed SQL outputs by modeling the relationship between columns and their cell values during generation.
  • To achieve state-of-the-art performance on the WikiSQL benchmark, which contains 87,726 question-SQL pairs across 26,375 tables.

Proposed method

  • The model uses a three-channel pointer network to generate SQL queries, with separate channels for question words, column names, and cell values.
  • It learns to dynamically select which channel to attend from at each decoding step, enabling selective copying of relevant content.
  • The model incorporates column-cell relations to improve WHERE clause generation, reducing syntactic errors and increasing correctness.
  • It leverages a sequence-to-sequence framework with attention mechanisms to encode the question and table structure into continuous representations.
  • The decoder uses a gating mechanism to decide whether to generate a token from the question, column, or cell, improving alignment with table semantics.
  • The approach is trained end-to-end using cross-entropy loss and can be fine-tuned with reinforcement learning or transfer learning.

Experimental results

Research questions

  • RQ1Can modeling column-cell relationships significantly improve the correctness of generated SQL queries in semantic parsing?
  • RQ2How does incorporating SQL syntax and table structure affect execution accuracy compared to standard pointer networks?
  • RQ3To what extent can a three-channel attention mechanism improve generation by selectively copying from question, column, or cell content?
  • RQ4Can the model generalize to out-of-distribution SQL patterns not seen during training, such as complex conditions or aggregations?
  • RQ5How effective is transfer learning from WikiSQL to other datasets like WikiTableQuestions, and what improvements can be made via pseudo-labeling?

Key findings

  • The proposed STAMP model achieves a new state-of-the-art execution accuracy of 74.4% on the WikiSQL dataset, up from the prior SOTA of 69.0%.
  • The model improves logical form accuracy to 60.7%, indicating better alignment with correct logical structures in the generated queries.
  • Transfer learning from WikiSQL to WikiTableQuestions yields 14.5% accuracy in a zero-shot setting, which improves to 21.0% with pseudo-labeling using generated SQL queries.
  • The model demonstrates superior performance in predicting column names and cell values, with cell prediction being more accurate due to higher lexical overlap with questions.
  • Extensive ablation shows that column-cell relation modeling significantly reduces ill-formed SQL outputs, especially in the WHERE clause.
  • The model is extensible to support complex SQL features like JOINs and nested queries by adding new channels and keywords, suggesting strong architectural scalability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.