Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning

Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning

9 Nov 2017 | Victor Zhong, Caiming Xiong, Richard Socher
Seq2SQL is a deep neural network designed to translate natural language questions into corresponding SQL queries. The model leverages the structure of SQL to prune the output space of generated queries and uses policy-based reinforcement learning to optimize the generation of unordered query conditions. The authors introduce WikiSQL, a dataset of 80,654 hand-annotated examples of questions and SQL queries from Wikipedia tables, which is an order of magnitude larger than comparable datasets. By applying policy-based reinforcement learning with a query execution environment on 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%. The model consists of three components: aggregation operation, SELECT column, and WHERE clause, each trained using a combination of cross entropy loss and reinforcement learning rewards. The aggregation operation is classified using a multi-layer perceptron, the SELECT column is predicted using a pointer network, and the WHERE clause is optimized using policy gradient to address the unordered nature of query conditions. The model's performance is evaluated using execution accuracy and logical form accuracy, showing significant improvements over previous methods.Seq2SQL is a deep neural network designed to translate natural language questions into corresponding SQL queries. The model leverages the structure of SQL to prune the output space of generated queries and uses policy-based reinforcement learning to optimize the generation of unordered query conditions. The authors introduce WikiSQL, a dataset of 80,654 hand-annotated examples of questions and SQL queries from Wikipedia tables, which is an order of magnitude larger than comparable datasets. By applying policy-based reinforcement learning with a query execution environment on 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%. The model consists of three components: aggregation operation, SELECT column, and WHERE clause, each trained using a combination of cross entropy loss and reinforcement learning rewards. The aggregation operation is classified using a multi-layer perceptron, the SELECT column is predicted using a pointer network, and the WHERE clause is optimized using policy gradient to address the unordered nature of query conditions. The model's performance is evaluated using execution accuracy and logical form accuracy, showing significant improvements over previous methods.
Reach us at info@study.space