Representing Schema Structure with Graph Neural Networks for Text-to-SQL Parsing
39534Authors
nan
Abstract
AbstractResearch on parsing language to SQL has largely ignored the structure of the database (DB) schema, either because the DB was very simple, or because it was observed at both training and test time. In spider, a recently-released text-to-SQL dataset, new and complex DBs are given at test time, and so the structure of the DB schema can inform the predicted SQL query. In this paper, we present an encoder-decoder semantic parser, where the structure of the DB schema is encoded with a graph neural network, and this representation is later used at both encoding and decoding time. Evaluation shows that encoding the schema structure improves our parser accuracy from 33.8% to 39.4%, dramatically above the current state of the art, which is at 19.7%.
Keywords
Full Content
Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4560–4565 Florence, Italy, July 28 - August 2, 2019. c⃝2019 Association for Computational Linguistics 4560 Representing Schema Structure with Graph Neural Networks for Text-to-SQL Parsing Ben Bogin1 Matt Gardner2 Jonathan Berant1,2 1School of Computer Science, Tel-Aviv University 2Allen Institute for Artificial Intelligence ben.bogin@cs.tau.ac.il,mattg@allenai.org,joberant@cs.tau.ac.il Abstract Research on parsing language to SQL has largely ignored the structure of the database (DB) schema, either because the DB was very simple, or because it was observed at both training and test time. In SPIDER, a recently- released text-to-SQL dataset, new and com- plex DBs are given at test time, and so the structure of the DB schema can inform the pre- dicted SQL query. In this paper, we present an encoder-decoder semantic parser, where the structure of the DB schema is encoded with a graph neural network, and this representa- tion is later used at both encoding and decod- ing time. Evaluation shows that encoding the schema structure improves our parser accuracy from 33.8% to 39.4%, dramatically above the current state of the art, which is at 19.7%. 1 Introduction Semantic parsing (Zelle and Mooney, 1996; Zettlemoyer and Collins, 2005) has recently taken increased interest in parsing questions into SQL queries, due to the popularity of SQL as a query language for relational databases (DBs). Work on parsing to SQL (Zhong et al., 2017; Iyer et al., 2017; Finegan-Dollak et al., 2018; Yu et al., 2018a) has either involved simple DBs that contain just one table, or had a single DB that is observed at both training and test time. Conse- quently, modeling the schema structure received little attention. Recently, Yu et al. (2018b) pre- sented SPIDER, a text-to-SQL dataset, where at test time questions are executed against unseen and complex DBs. In this zero-shot setup, an in- formative representation of the schema structure is important. Consider the questions in Figure 1: while their language structure is similar, in the first query a ‘join’ operation is necessary because the information is distributed across three tables, while in the other query no ‘join’ is needed. x : Find the age of students who do not have a cat pet. y : SELECT age FROM student WHERE student NOT IN (SELECT ... FROM student JOIN has pet ... JOIN pets ... WHERE ...) x : What are the names of teams that do not have match season record? y : SELECT name FROM team WHERE team id NOT IN (SELECT team FROM match season) Figure 1: Examples from SPIDER showing how similar questions can have different SQL queries, conditioned on the schema. Table names are underlined. In this work, we propose a semantic parser that strongly uses the schema structure. We represent the structure of the schema as a graph, and use graph neural networks (GNNs) to provide a global representation for each node (Li et al., 2016; De Cao et al., 2019; Sorokin and Gurevych, 2018). We incorporate our schema representation into …
Content truncated to 500 words
Labeled Text
AbstractResearch on parsing language to SQL has largely ignored the structure of the database (DB) schema, either because the DB was very simple, or because it was observed at both training and test time. In spider, a recently-released text-to-SQL dataset, new and complex DBs are given at test time, and so the structure of the DB schema can inform the predicted SQL query. In this paper, we present an encoder-decoder semantic parser, where the structure of the DB schema is encoded with a graph neural network, and this representation is later used at both encoding and decoding time. Evaluation shows that encoding the schema structure improves our parser accuracy from 33.8% to 39.4%, dramatically above the current state of the art, which is at 19.7%.
Publication Details
- Paper ID:
- 39534
- Year:
- 2019
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan