Know What I don't Know: Handling Ambiguous and Unanswerable Questions for Text-to-SQL

Bing Wang, Yan Gao, Zhoujun Li, Jian-Guang Lou
12/17/2022
cs.CL

Official code: wbbeyourself/DTE (10 stars, Python, last commit 2023-12-06).

Abstract

The task of text-to-SQL aims to convert a natural language question into its corresponding SQL query within the context of relational tables. Existing text-to-SQL parsers generate a "plausible" SQL query for an arbitrary user question, thereby failing to correctly handle problematic user questions.

Show full abstract

To formalize this problem, we conduct a preliminary study on the observed ambiguous and unanswerable cases in text-to-SQL and summarize them into 6 feature categories. Correspondingly, we identify the causes behind each category and propose requirements for handling ambiguous and unanswerable questions. Following this study, we propose a simple yet effective counterfactual example generation approach that automatically produces ambiguous and unanswerable text-to-SQL examples. Furthermore, we propose a weakly supervised DTE (Detecting-Then-Explaining) model for error detection, localization, and explanation. Experimental results show that our model achieves the best result on both real-world examples and generated examples compared with various baselines. We release our data and code at: \href{https://github.com/wbbeyourself/DTE}{https://github.com/wbbeyourself/DTE}.

View on arXivView PDF

Code Implementations(1)

wbbeyourself/DTEOfficial100%

Detect-Then-Explain Framework for Text-to-SQL task

100Python, ShellDec 16, 20222 years ago

Similar Papers

Cite this paper

@article{wang2022know,
  title  = {Know What I don't Know: Handling Ambiguous and Unanswerable Questions for Text-to-SQL},
  author = {Bing Wang and Yan Gao and Zhoujun Li and Jian-Guang Lou},
  year   = {2022},
  eprint = {2212.08902},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2212.08902}
}

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/2212.08902.svg)](https://codeofpaper.com/paper/2212.08902)

Discussion