HyperAIHyperAI

Command Palette

Search for a command to run...

4 months ago

Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning

Victor Zhong; Caiming Xiong; Richard Socher

Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning

Abstract

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%.

Code Repositories

CX000/sqlnet_inference_py36
pytorch
Mentioned in GitHub
wronnyhuang/SQLNet_inference
pytorch
Mentioned in GitHub
ist-daslab/rosa
pytorch
Mentioned in GitHub
openbotai/nl2sql
Mentioned in GitHub
Baidi96/text2sql
pytorch
Mentioned in GitHub
kasnerz/tabgenie
Mentioned in GitHub
abhishekchugh17/sql12
pytorch
Mentioned in GitHub
tiwarikajal/Seq2SQL-
pytorch
Mentioned in GitHub
xiaojunxu/SQLNet
pytorch
Mentioned in GitHub
salesforce/WikiSQL
Official
Mentioned in GitHub
llSourcell/SQL_Database_Optimization
pytorch
Mentioned in GitHub
racheljose21/chatbot
pytorch
Mentioned in GitHub
PriyankaDatar/NLP_SQL_Project
pytorch
Mentioned in GitHub
PriyankaDatar/NLP_Project_Modfications
pytorch
Mentioned in GitHub
kh-mo/QA_wikisql
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
code-generation-on-wikisqlSeq2SQL (Zhong et al., 2017)
Exact Match Accuracy: 48.3
Execution Accuracy: 59.4
code-generation-on-wikisqlSeq2Seq (Zhong et al., 2017)
Exact Match Accuracy: 23.4
Execution Accuracy: 35.9

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning | Papers | HyperAI