Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning

By Victor Zhong, Caiming Xiong, Richard Socher. 2017

1,572 citations recorded by the source corpus.

Relational databases store a significant amount of the worlds data. However, accessing this data currently requires users to understand a query language such as SQL. We propose Seq2SQL, a deep neural network for translating natural language questions to corresponding SQL queries. Our model uses rewards from in the loop query execution over the database to learn a policy to generate the query, which contains unordered parts that are less suitable for optimization via cross entropy loss. Moreover, Seq2SQL leverages the structure of SQL to prune the space of generated queries and significantly simplify the generation problem. In addition to the model, we release WikiSQL, a dataset of 80654 hand-annotated examples of questions and SQL queries distributed across 24241 tables fromWikipedia that is an order of magnitude larger than comparable datasets. By applying policy based reinforcement learning with a query execution environment to WikiSQL, Seq2SQL outperforms a state-of-the-art semantic parser, improving execution accuracy from 35.9% to 59.4% and logical form accuracy from 23.4% to 48.3%.

Subfields: Artificial Intelligence, Information Systems, Natural Language Processing, Reinforcement Learning, Signal Processing

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Mohit Bansal
  2. Luke S. Zettlemoyer
  3. Jianfeng Gao
  4. Percy Liang
  5. Yejin Choi
  6. Graham Neubig
  7. Caiming Xiong
  8. Hannaneh Hajishirzi

In Information Systems

  1. Miltiadis Allamanis
  2. Uri Alon
  3. Charles Sutton
  4. Jonathan Berant
  5. Graham Neubig
  6. Luke S. Zettlemoyer
  7. Percy Liang
  8. Rishabh Singh

In Natural Language Processing

  1. Mohit Bansal
  2. Luke S. Zettlemoyer
  3. Yejin Choi
  4. Graham Neubig
  5. Jianfeng Gao
  6. Percy Liang
  7. Caiming Xiong
  8. Richard Socher

In Reinforcement Learning

  1. Sergey Levine
  2. Wenhu Chen
  3. Jonathan Berant
  4. Mohammad Norouzi
  5. Graham Neubig
  6. Percy Liang
  7. Mirella Lapata
  8. Chen Liang

In Signal Processing

  1. Li Deng
  2. Graham Neubig
  3. Dong Yu
  4. Quoc V. Le
  5. Mohammad Norouzi
  6. Charles Sutton
  7. Gabriel Synnaeve
  8. Mirella Lapata

Citations in the corpus