arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1702.01168cs.DBcs.PL
收藏

类型和内容驱动的自然语言SQL语义合成

Type- and Content-Driven Synthesis of SQL Queries from Natural Language

Navid Yaghmazadeh, Yuepeng Wang, Isil Dillig, Thomas Dillig

摘要:

本文提出了一种从自然语言自动合成SQL查询的新技术。我们的技术是完全自动化的,适用于任何数据库,而不需要额外的定制,也不需要用户知道底层的数据库模式。我们的方法通过结合自然语言处理、程序合成和自动程序修复来实现这些目标。给定用户的英文描述,我们的技术首先使用语义解析来生成查询草图,随后使用类型导向的程序合成完成查询草图,并使用数据库内容分配置信度分数。然而,由于用户的描述可能无法准确地反映实际的数据库模式,我们的方法也执行故障定位和修复草图的错误部分。重复该合成-修复循环,直到算法推断出具有足够高的置信度分数的查询。我们已经实现了所提出的技术在一个工具称为Sqlizer和评估它在三个不同的数据库。我们的实验表明,在接近90%的情况下,所需的查询是排名前5名的候选人。

英文摘要:

This paper presents a new technique for automatically synthesizing SQL queries from natural language. Our technique is fully automated, works for any database without requiring additional customization, and does not require users to know the underlying database schema. Our method achieves these goals by combining natural language processing, program synthesis, and automated program repair. Given the user's English description, our technique first uses semantic parsing to generate a query sketch, which is subsequently completed using type-directed program synthesis and assigned a confidence score using database contents. However, since the user's description may not accurately reflect the actual database schema, our approach also performs fault localization and repairs the erroneous part of the sketch. This synthesize-repair loop is repeated until the algorithm infers a query with a sufficiently high confidence score. We have implemented the proposed technique in a tool called Sqlizer and evaluate it on three different databases. Our experiments show that the desired query is ranked within the top 5 candidates in close to 90% of the cases.

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

↑