Text-to-SQL Error Correction with Language Models of Code

Ziru Chen, Shijie Chen, Michael White, Raymond Mooney, Ali Payani +3 more
5/22/2023
cs.CLcs.AIcs.DB

Official code: OSU-NLP-Group/Auto-SQL-Correction (32 stars, last commit 2024-08-22).

Abstract

Despite recent progress in text-to-SQL parsing, current semantic parsers are still not accurate enough for practical use. In this paper, we investigate how to build automatic text-to-SQL error correction models. Noticing that token-level edits are out of context and sometimes ambiguous, we propose building clause-level edit models instead. Besides, while most language models of code are not specifically pre-trained for SQL, they know common data structures and their operations in programming languages such as Python. Thus, we propose a novel representation for SQL queries and their edits that adheres more closely to the pre-training corpora of language models of code. Our error correction model improves the exact set match accuracy of different parsers by 2.4-6.5 and obtains up to 4.3 point absolute improvement over two strong baselines. Our code and data are available at https://github.com/OSU-NLP-Group/Auto-SQL-Correction.

View on arXivView PDF

Code Implementations(1)

Code, data, and model of paper "Text-to-SQL Error Correction with Language Models of Code" (ACL'23)

323PythonMay 3, 20232 years ago
code-editorcode-generationnatural-language-interfacetext-to-sql

Similar Papers

Cite this paper

@article{chen2023texttosql,
  title  = {Text-to-SQL Error Correction with Language Models of Code},
  author = {Ziru Chen and Shijie Chen and Michael White and Raymond Mooney and Ali Payani and Jayanth Srinivasa and Yu Su and Huan Sun},
  year   = {2023},
  eprint = {2305.13073},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.13073v2}
}

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

Discussion