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

面向Text-to-SQL解析的问题与SQL语义分解

Semantic Decomposition of Question and SQL for Text-to-SQL Parsing

Ben Gurion University(本·古里安大学)

Ben Eyal, Amir Bachar, Ophir Haroche, Moran Mahabi, Michael Elhadad

AI总结:

针对Text-to-SQL跨域复杂查询泛化难题,提出模块化查询计划语言QPL系统分解SQL,扩充Spider数据集,实验证明其优于直接解析,并支持构建对数据库模式敏感的问题分解器且提升可解释性。

摘要:

Text-to-SQL语义解析在泛化到跨领域和复杂查询时面临挑战。近期研究采用问题分解策略来增强复杂SQL查询的解析。然而,该策略遇到两大主要障碍:(1)现有数据集缺乏问题分解;(2)由于SQL的语法复杂性,大多数复杂查询无法解耦为易于重新组合的子查询。为应对这些挑战,我们提出一种新的模块化查询计划语言(Query Plan Language, QPL),将SQL查询系统地分解为简单且规则的子查询。我们通过利用对SQL服务器查询优化计划的分析,开发了从SQL到QPL的翻译器,并用QPL程序扩充了Spider数据集。实验结果表明,QPL的模块化特性使现有语义解析架构受益,并且对于语义等价的查询,训练text-to-QPL解析器比text-to-SQL解析更有效。QPL方法还提供两个额外优势:(1)QPL程序可改写为简单问题,这使我们能够创建一个(复杂问题,分解问题)数据集。在此数据集上训练,我们获得了一个对数据库模式敏感的Question Decomposer用于数据检索。(2)对于复杂查询,QPL对非专家更具可访问性,从而使语义解析器的输出更具可解释性。

英文摘要:

Text-to-SQL semantic parsing faces challenges in generalizing to cross-domain and complex queries. Recent research has employed a question decomposition strategy to enhance the parsing of complex SQL queries. However, this strategy encounters two major obstacles: (1) existing datasets lack question decomposition; (2) due to the syntactic complexity of SQL, most complex queries cannot be disentangled into sub-queries that can be readily recomposed. To address these challenges, we propose a new modular Query Plan Language (QPL) that systematically decomposes SQL queries into simple and regular sub-queries. We develop a translator from SQL to QPL by leveraging analysis of SQL server query optimization plans, and we augment the Spider dataset with QPL programs. Experimental results demonstrate that the modular nature of QPL benefits existing semantic-parsing architectures, and training text-to-QPL parsers is more effective than text-to-SQL parsing for semantically equivalent queries. The QPL approach offers two additional advantages: (1) QPL programs can be paraphrased as simple questions, which allows us to create a dataset of (complex question, decomposed questions). Training on this dataset, we obtain a Question Decomposer for data retrieval that is sensitive to database schemas. (2) QPL is more accessible to non-experts for complex queries, leading to more interpretable output from the semantic parser.

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

↑