Natural SQL:使SQL更易于从自然语言规范中进行推断
Natural SQL: Making SQL Easier to Infer from Natural Language Specifications
摘要:
解决自然语言描述和相应的SQL查询之间的不匹配是文本到SQL转换的关键挑战。为了弥补这一差距,我们提出了一种称为Natural SQL(NatSQL)的SQL中间表示(IR)。具体地说,NatSQL保留了SQL的核心功能,同时简化了查询:(1)省去了操作符和关键字,如GROUP BY,HAVING,FROM,JOIN ON,这些操作符和关键字通常很难在文本描述中找到对应项;(2)消除了对嵌套子查询和集合操作符的需求;(3)通过减少所需的模式项数量使模式链接更容易。在Spider上,一个具有挑战性的文本到SQL基准测试,包含复杂和嵌套的SQL查询,我们证明了NatSQL优于其他IR,并显着提高了几个以前的SOTA模型的性能。此外,对于不支持可执行SQL生成的现有模型,NatSQL可以轻松地使它们生成可执行SQL查询,并实现新的最先进的执行精度。
英文摘要:
Addressing the mismatch between natural language descriptions and the corresponding SQL queries is a key challenge for text-to-SQL translation. To bridge this gap, we propose an SQL intermediate representation (IR) called Natural SQL (NatSQL). Specifically, NatSQL preserves the core functionalities of SQL, while it simplifies the queries as follows: (1) dispensing with operators and keywords such as GROUP BY, HAVING, FROM, JOIN ON, which are usually hard to find counterparts for in the text descriptions; (2) removing the need for nested subqueries and set operators; and (3) making schema linking easier by reducing the required number of schema items. On Spider, a challenging text-to-SQL benchmark that contains complex and nested SQL queries, we demonstrate that NatSQL outperforms other IRs, and significantly improves the performance of several previous SOTA models. Furthermore, for existing models that do not support executable SQL generation, NatSQL easily enables them to generate executable SQL queries, and achieves the new state-of-the-art execution accuracy.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。