arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1709.00103cs.CLcs.AI
收藏

Seq2SQL:使用强化学习从自然语言生成结构化的语义

Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning

Salesforce Research(Salesforce 研究院)

Victor Zhong, Caiming Xiong, Richard Socher

摘要:

世界上大量的知识存储在关系数据库中。然而,由于缺乏对诸如SQL的查询语言的理解,用户从数据库检索事实的能力是有限的。我们提出了Seq2SQL,这是一种深度神经网络,用于将自然语言问题转换为相应的SQL查询。我们的模型利用SQL查询的结构来显着减少生成的查询的输出空间。此外,我们使用的回报,从在数据库的循环查询执行学习的政策,以产生无序的部分查询,我们表明是不太适合通过交叉熵损失优化。此外,我们还将发布WikiSQL,这是一个包含80654个手工注释的问题和SQL查询示例的数据集,分布在维基百科的24241个表中。该数据集是训练我们的模型所必需的,并且比可比数据集大一个数量级。通过将基于策略的强化学习与查询执行环境应用于WikiSQL,我们的模型Seq2SQL优于注意序列到序列模型,将执行准确率从35.9%提高到59.4%,逻辑形式准确率从23.4%提高到48.3%。

英文摘要:

A significant amount of the world's knowledge is stored in relational databases. However, the ability for users to retrieve facts from a database is limited due to a lack of understanding of query languages such as SQL. We propose Seq2SQL, a deep neural network for translating natural language questions to corresponding SQL queries. Our model leverages the structure of SQL queries to significantly reduce the output space of generated queries. Moreover, we use rewards from in-the-loop query execution over the database to learn a policy to generate unordered parts of the query, which we show are less suitable for optimization via cross entropy loss. In addition, we will publish WikiSQL, a dataset of 80654 hand-annotated examples of questions and SQL queries distributed across 24241 tables from Wikipedia. This dataset is required to train our model and is an order of magnitude larger than comparable datasets. By applying policy-based reinforcement learning with a query execution environment to WikiSQL, our model Seq2SQL outperforms attentional sequence to sequence models, improving execution accuracy from 35.9% to 59.4% and logical form accuracy from 23.4% to 48.3%.

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

↑