Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning
arXiv:1709.00103
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%.
12 pages, 5 figures
References in corpus (2)
Cited by in corpus (41)
- SQLNet: Generating Structured Queries From Natural Language Without Reinforcement Learning
- Building a Conversational Agent Overnight with Dialogue Self-Play
- Hybrid Ranking Network for Text-to-SQL
- Grammar-based Neural Text-to-SQL Generation
- Introduction to Neural Network based Approaches for Question Answering over Knowledge Graphs
- Representing Schema Structure with Graph Neural Networks for Text-to-SQL Parsing
- TaBERT: Pretraining for Joint Understanding of Textual and Tabular Data
- Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representation
- CraftAssist: A Framework for Dialogue-enabled Interactive Agents
- Scalable Neural Methods for Reasoning With a Symbolic Knowledge Base
- TableQA: a Large-Scale Chinese Text-to-SQL Dataset for Table-Aware SQL Generation
- Neural Machine Translating from Natural Language to SPARQL
- One-Shot Learning for Text-to-SQL Generation
- Semantic Evaluation for Text-to-SQL with Distilled Test Suites
- Building a Neural Semantic Parser from a Domain Ontology
- SPoC: Search-based Pseudocode to Code
- Coupling Retrieval and Meta-Learning for Context-Dependent Semantic Parsing
- Encoding Database Schemas with Relation-Aware Self-Attention for Text-to-SQL Parsers
- Photon: A Robust Cross-Domain Text-to-SQL System
- CraftAssist Instruction Parsing: Semantic Parsing for a Minecraft Assistant
- JuICe: A Large Scale Distantly Supervised Dataset for Open Domain Context-based Code Generation
- Exploring Neural Models for Parsing Natural Language into First-Order Logic
- Lifelong Language Knowledge Distillation
- Jointly Learning Semantic Parser and Natural Language Generator via Dual Information Maximization
- A Hybrid Semantic Parsing Approach for Tabular Data Analysis
- Domain Adaptation for Semantic Parsing
- MLFriend: Interactive Prediction Task Recommendation for Event-Driven Time-Series Data
- Context-Dependent Semantic Parsing over Temporally Structured Data
- Question Answering via Web Extracted Tables and Pipelined Models
- Siamese Networks for Semantic Pattern Similarity
- Merging Weak and Active Supervision for Semantic Parsing
- A Pilot Study for Chinese SQL Semantic Parsing
- Model-based Interactive Semantic Parsing: A Unified Framework and A Text-to-SQL Case Study
- Look-up and Adapt: A One-shot Semantic Parser
- Insightful Assistant: AI-compatible Operation Graph Representations for Enhancing Industrial Conversational Agents
- FANDA: A Novel Approach to Perform Follow-up Query Analysis
- Differentiable Representations For Multihop Inference Rules
- Keeping Notes: Conditional Natural Language Generation with a Scratchpad Mechanism
- TAG : Type Auxiliary Guiding for Code Comment Generation
- Syntactic Question Abstraction and Retrieval for Data-Scarce Semantic Parsing
- LogicalFactChecker: Leveraging Logical Operations for Fact Checking with Graph Module Network