Enterprises commonly deploy heterogeneous database systems, each of which owns a distinct SQL dialect with different syntax rules, built-in functions, and execution constraints. However, most existing NL2SQL methods assume a single dialect (e.g., SQLite) and struggle to produce queries that are both semantically correct and executable on target engines. Prompt-based approaches tightly couple intent reasoning with dialect syntax, rule-based translators often degrade native operators into generic constructs, and multi-dialect fine-tuning suffers from cross-dialect interference. In this paper, we present Dial, a knowledge-grounded framework for dialect-specific NL2SQL. Dial introduces: (1) a Dialect-Aware Logical Query Planning module that converts natural language into a dialect-aware logical query plan via operator-level intent decomposition and divergence-aware specification; (2) HINT-KB, a hierarchical intent-aware knowledge base that organizes dialect knowledge into (i) a canonical syntax reference, (ii) a declarative function repository, and (iii) a procedural constraint repository; and (3) an execution-driven debugging and semantic verification loop that separates syntactic recovery from logic auditing to prevent semantic drift. We construct DS-NL2SQL, a benchmark covering six major database systems with 2,218 dialect-specific test cases. Experimental results show that Dial consistently improves translation accuracy by 10.25% and dialect feature coverage by 15.77% over state-of-the-art baselines. The code is at https://github.com/weAIDB/Dial.


翻译:企业通常部署异构数据库系统,每个系统都拥有独特的SQL方言,这些方言具有不同的语法规则、内置函数和执行约束。然而,大多数现有的自然语言转SQL方法都假设单一方言(例如SQLite),难以生成在目标引擎上既语义正确又可执行的查询。基于提示的方法将意图推理与方言语法紧密耦合,基于规则的翻译器通常将原生运算符降级为通用结构,而多方言微调则受到跨方言干扰的影响。本文提出Dial,一种用于方言特定自然语言转SQL的基于知识框架。Dial引入了:(1)方言感知逻辑查询规划模块,通过运算符级意图分解和差异感知规约,将自然语言转换为方言感知的逻辑查询计划;(2)HINT-KB,一个分层意图感知知识库,将方言知识组织为(i)规范语法参考,(ii)声明式函数库,以及(iii)过程式约束库;(3)执行驱动的调试与语义验证循环,将语法恢复与逻辑审计分离,以防止语义漂移。我们构建了DS-NL2SQL基准测试集,涵盖六个主要数据库系统,包含2,218个方言特定测试用例。实验结果表明,Dial相较于最先进的基线方法,翻译准确率持续提升10.25%,方言特性覆盖率提升15.77%。代码位于https://github.com/weAIDB/Dial。

0
下载
关闭预览

相关内容

SQL 全名是结构化查询语言,是用于数据库中的标准数据查询语言,IBM 公司最早使用在其开发的数据库系统中。
【博士论文】基于知识的自然语言理解与生成,230页pdf
专知会员服务
41+阅读 · 2024年4月1日
【LinkedIn报告】深度自然语言处理的搜索系统,211页pdf
专知会员服务
109+阅读 · 2019年6月21日
使用 Canal 实现数据异构
性能与架构
20+阅读 · 2019年3月4日
知识在检索式对话系统的应用
微信AI
32+阅读 · 2018年9月20日
自然语言处理(NLP)知识结构总结
AI100
51+阅读 · 2018年8月17日
从语言学到深度学习NLP,一文概述自然语言处理
人工智能学家
13+阅读 · 2018年1月28日
语料库构建——自然语言理解的基础
计算机研究与发展
11+阅读 · 2017年8月21日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关VIP内容
相关资讯
使用 Canal 实现数据异构
性能与架构
20+阅读 · 2019年3月4日
知识在检索式对话系统的应用
微信AI
32+阅读 · 2018年9月20日
自然语言处理(NLP)知识结构总结
AI100
51+阅读 · 2018年8月17日
从语言学到深度学习NLP,一文概述自然语言处理
人工智能学家
13+阅读 · 2018年1月28日
语料库构建——自然语言理解的基础
计算机研究与发展
11+阅读 · 2017年8月21日
相关基金
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员