arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2412.17068cs.DB
收藏

一个用于自然语言到SQL的即插即用自然语言重写器

A Plug-and-Play Natural Language Rewriter for Natural Language to SQL

Peixian Ma, Boyan Li, Runzhi Jiang, Ju Fan, Nan Tang, Yuyu Luo

AI总结:

针对用户因对数据库模式理解有限或记忆偏差导致NL2SQL翻译错误的问题,提出即插即用模块REWRITER,通过Checker、Reflector和Rewriter三个组件自动重写有缺陷的NL查询,在Spider和BIRD基准上分别提升1.6%和2.0%的执行准确率。

摘要:

现有的自然语言到SQL(NL2SQL)解决方案已取得显著进展,但在解释和翻译NL查询方面仍存在挑战,主要原因是用户对数据库模式的理解有限或对特定表或列值的记忆偏差。这些挑战通常导致错误的NL2SQL翻译。为解决这些问题,我们提出了REWRITER,一个即插即用模块,旨在通过自动重写模糊或有缺陷的NL查询来增强NL2SQL系统。通过整合数据库知识和内容(例如,列值和外键),REWRITER减少了由有缺陷的NL输入引起的错误,并提高了SQL生成的准确性。我们的REWRITER将NL2SQL模型视为黑盒,确保与各种NL2SQL方法的兼容性,包括基于代理和基于规则的NL2SQL解决方案。REWRITER包含三个关键组件:Checker、Reflector和Rewriter。Checker通过评估生成的SQL的正确性来识别有缺陷的NL查询,从而最小化不必要的重写和潜在的幻觉。Reflector分析并积累经验以识别NL查询中的问题,而Rewriter根据Reflector的反馈修订查询。在Spider和BIRD基准上的大量实验表明,REWRITER持续增强下游模型,分别在执行准确性上实现了平均1.6%和2.0%的提升。

英文摘要:

Existing Natural Language to SQL (NL2SQL) solutions have made significant advancements, yet challenges persist in interpreting and translating NL queries, primarily due to users' limited understanding of database schemas or memory biases toward specific table or column values. These challenges often result in incorrect NL2SQL translations. To address these issues, we propose REWRITER, a plug-and-play module designed to enhance NL2SQL systems by automatically rewriting ambiguous or flawed NL queries. By incorporating database knowledge and content (e.g., column values and foreign keys), REWRITER reduces errors caused by flawed NL inputs and improves SQL generation accuracy. Our REWRITER treats NL2SQL models as black boxes, ensuring compatibility with various NL2SQL methods, including agent-based and rule-based NL2SQL solutions. REWRITER comprises three key components: Checker, Reflector, and Rewriter. The Checker identifies flawed NL queries by assessing the correctness of the generated SQL, minimizing unnecessary rewriting and potential hallucinations. The Reflector analyzes and accumulates experience to identify issues in NL queries, while the Rewriter revises the queries based on Reflector's feedback. Extensive experiments on the Spider and BIRD benchmarks demonstrate that REWRITER consistently enhances downstream models, achieving average improvements of 1.6% and 2.0% in execution accuracy, respectively.

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

↑