Clause-Wise and Recursive Decoding for Complex and Cross-Domain Text-to-SQL Generation
8894Authors
nan
Abstract
AbstractMost deep learning approaches for text-to-SQL generation are limited to the WikiSQL dataset, which only supports very simple queries over a single table. We focus on the Spider dataset, a complex and cross-domain text-to-SQL task, which includes complex queries over multiple tables. In this paper, we propose a SQL clause-wise decoding neural architecture with a self-attention based database schema encoder to address the Spider task. Each of the clause-specific decoders consists of a set of sub-modules, which is defined by the syntax of each clause. Additionally, our model works recursively to support nested queries. When evaluated on the Spider dataset, our approach achieves 4.6% and 9.8% accuracy gain in the test and dev sets, respectively. In addition, we show that our model is significantly more effective at predicting complex and nested queries than previous work.
Keywords
Full Content
Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, pages 6045–6051, Hong Kong, China, November 3–7, 2019. c⃝2019 Association for Computational Linguistics 6045 Clause-Wise and Recursive Decoding for Complex and Cross-Domain Text-to-SQL Generation Dongjun Lee SAP Labs Korea dongjun.lee01@sap.com Abstract Most deep learning approaches for text-to- SQL generation are limited to the WikiSQL dataset, which only supports very simple queries over a single table. We focus on the Spider dataset, a complex and cross- domain text-to-SQL task, which includes com- plex queries over multiple tables. In this pa- per, we propose a SQL clause-wise decoding neural architecture with a self-attention based database schema encoder to address the Spi- der task. Each of the clause-specific decoders consists of a set of sub-modules, which is de- fined by the syntax of each clause. Addition- ally, our model works recursively to support nested queries. When evaluated on the Spider dataset, our approach achieves 4.6% and 9.8% accuracy gain in the test and dev sets, respec- tively. In addition, we show that our model is significantly more effective at predicting com- plex and nested queries than previous work. 1 Introduction Text-to-SQL generation is the task of translating a natural language question into the corresponding SQL. Recently, various deep learning approaches have been proposed based on the WikiSQL dataset (Zhong et al., 2017). However, because WikiSQL contains only very simple queries over just a sin- gle table, these approaches (Xu et al., 2017; Huang et al., 2018; Yu et al., 2018a; Dong and Lapata, 2018) cannot be applied directly to generate com- plex queries containing elements such as JOIN, GROUP BY, and nested queries. To overcome this limitation, Yu et al. (2018c) introduced Spider, a new complex and cross- domain text-to-SQL dataset. It contains a large number of complex queries over different databases with multiple tables. It also requires a model to generalize to unseen database schema as different databases are used for training and test- ing. Therefore, a model should understand not only the natural language question but also the schema of the corresponding database to predict the correct SQL query. In this paper, we propose a novel SQL-specific clause-wise decoding neural network model to ad- dress the Spider task. We first predict a sketch for each SQL clause (e.g., SELECT, WHERE) with text classification modules. Then, clause-specific decoders find the columns and corresponding op- erators based on the sketches. Our contributions are summarized as follows. • We decompose the clause-wise SQL decod- ing process. We also modularize each of the clause-specific decoders into sub-modules based on the syntax of each clause. Our ar- chitecture enables the model to learn clause- dependent context and also ensures the syn- tactic correctness of the predicted SQL. • Our model works recursively so that it can predict nested queries. • We also introduce a self-attention based database schema encoder that enables our model to generalize to unseen databases. In the experiment on the Spider …
Content truncated to 500 words
Labeled Text
AbstractMost deep learning approaches for text-to-SQL generation are limited to the WikiSQL dataset, which only supports very simple queries over a single table. We focus on the Spider dataset, a complex and cross-domain text-to-SQL task, which includes complex queries over multiple tables. In this paper, we propose a SQL clause-wise decoding neural architecture with a self-attention based database schema encoder to address the Spider task. Each of the clause-specific decoders consists of a set of sub-modules, which is defined by the syntax of each clause. Additionally, our model works recursively to support nested queries. When evaluated on the Spider dataset, our approach achieves 4.6% and 9.8% accuracy gain in the test and dev sets, respectively. In addition, we show that our model is significantly more effective at predicting complex and nested queries than previous work.
Publication Details
- Paper ID:
- 8894
- Year:
- 2019
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan