arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.13073cs.CLcs.AIcs.DBcs.LG
收藏

利用代码语言模型进行文本到SQL的错误纠正

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

The Ohio State University(俄亥俄州立大学);The University of Texas at Austin(德克萨斯大学奥斯汀分校);Cisco Research(思科研究院)

Ziru Chen, Shijie Chen, Michael White, Raymond Mooney, Ali Payani, Jayanth Srinivasa, Yu Su, Huan Sun

AI总结:

本文提出基于子句级编辑和贴近代码语言模型预训练语料的SQL表示方法,构建文本到SQL错误纠正模型,显著提升多种解析器的准确率。

摘要:

尽管文本到SQL解析最近取得进展,当前的语义解析器在实际应用中仍不够准确。本文研究如何构建自动的文本到SQL错误纠正模型。注意到词元级编辑缺乏上下文且有时存在歧义,我们提出构建子句级编辑模型。此外,虽然大多数代码语言模型并未专门针对SQL进行预训练,但它们了解编程语言(如Python)中常见的数据结构及其操作。因此,我们提出一种新的SQL查询及其编辑的表示方法,使其更贴合代码语言模型的预训练语料。我们的错误纠正模型将不同解析器的精确集合匹配准确率提高了2.4至6.5个百分点,并相较于两个强基线获得最高4.3个百分点的绝对提升。代码和数据可在https://github.com/OSU-NLP-Group/Auto-SQL-Correction获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑