Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning

08/31/2017
by   Victor Zhong, et al.
0

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 and logical form accuracy from 23.4

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/13/2021

SPARQLing Database Queries from Intermediate Question Decompositions

To translate natural language questions into executable database queries...
research
07/28/2019

A Translate-Edit Model for Natural Language Question to SQL Query Generation on Multi-relational Healthcare Data

Electronic health record (EHR) data contains most of the important patie...
research
09/10/2018

Learning to Generate Structured Queries from Natural Language with Indirect Supervision

Generating structured query language (SQL) from natural language is an e...
research
05/10/2022

Cognitive Visual-learning Environment for PostgreSQL

PostgreSQL is an object-relational database (ORDBMS) that was introduced...
research
05/15/2020

Recent Advances in SQL Query Generation: A Survey

Natural language is hypothetically the best user interface for many doma...
research
11/13/2017

SQLNet: Generating Structured Queries From Natural Language Without Reinforcement Learning

Synthesizing SQL queries from natural language is a long-standing open p...
research
08/29/2023

Natural language to SQL in low-code platforms

One of the developers' biggest challenges in low-code platforms is retri...

Please sign up or login with your details

Forgot password? Click here to reset