Semantic Decomposition of Question and SQL for Text-to-SQL Parsing

Ben Eyal, Amir Bachar, Ophir Haroche, Moran Mahabi, Michael Elhadad
10/20/2023
cs.CL

No official code found. Best implementation: bgunlp/qpl (6 stars, last commit 2026-03-16).

Abstract

Text-to-SQL semantic parsing faces challenges in generalizing to cross-domain and complex queries. Recent research has employed a question decomposition strategy to enhance the parsing of complex SQL queries. However, this strategy encounters two major obstacles: (1) existing datasets lack question decomposition; (2) due to the syntactic complexity of SQL, most complex queries cannot be disentangled into sub-queries that can be readily recomposed. To address these challenges, we propose a new modular Query Plan Language (QPL) that systematically decomposes SQL queries into simple and regular sub-queries. We develop a translator from SQL to QPL by leveraging analysis of SQL server query optimization plans, and we augment the Spider dataset with QPL programs. Experimental results demonstrate that the modular nature of QPL benefits existing semantic-parsing architectures, and training text-to-QPL parsers is more effective than text-to-SQL parsing for semantically equivalent queries. The QPL approach offers two additional advantages: (1) QPL programs can be paraphrased as simple questions, which allows us to create a dataset of (complex question, decomposed questions). Training on this dataset, we obtain a Question Decomposer for data retrieval that is sensitive to database schemas. (2) QPL is more accessible to non-experts for complex queries, leading to more interpretable output from the semantic parser.

View on arXivView PDF

Code Implementations(1)

bgunlp/qplCommunity100%

Code and dataset for the paper "Semantic Decomposition of Question and SQL for Text-to-SQL Parsing" EMNLP Findings 2023 - Ben Eyal et al BGU CS NLP Group

61HTML, TSQLJun 25, 20237 months ago
llmnlpnlp-machine-learningsemantic-parsingtext-to-sql

Similar Papers

Cite this paper

@article{eyal2023semantic,
  title  = {Semantic Decomposition of Question and SQL for Text-to-SQL Parsing},
  author = {Ben Eyal and Amir Bachar and Ophir Haroche and Moran Mahabi and Michael Elhadad},
  year   = {2023},
  eprint = {2310.13575},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.13575v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.13575.svg)](https://codeofpaper.com/paper/2310.13575)

Discussion