RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers
37294Authors
nan
Abstract
AbstractWhen translating natural language questions into SQL queries to answer questions from a database, contemporary semantic parsing models struggle to generalize to unseen database schemas. The generalization challenge lies in (a) encoding the database relations in an accessible way for the semantic parser, and (b) modeling alignment between database columns and their mentions in a given query. We present a unified framework, based on the relation-aware self-attention mechanism, to address schema encoding, schema linking, and feature representation within a text-to-SQL encoder. On the challenging Spider dataset this framework boosts the exact match accuracy to 57.2%, surpassing its best counterparts by 8.7% absolute improvement. Further augmented with BERT, it achieves the new state-of-the-art performance of 65.6% on the Spider leaderboard. In addition, we observe qualitative improvements in the model’s understanding of schema linking and alignment. Our implementation will be open-sourced at https://github.com/Microsoft/rat-sql.
Keywords
Full Content
Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7567–7578 July 5 - 10, 2020. c⃝2020 Association for Computational Linguistics 7567 RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers Bailin Wang∗† University of Edinburgh bailin.wang@ed.ac.uk Richard Shin∗‡ UC Berkeley ricshin@cs.berkeley.edu Xiaodong Liu Oleksandr Polozov Matthew Richardson Microsoft Research, Redmond {xiaodl,polozov,mattri}@microsoft.com Abstract When translating natural language questions into SQL queries to answer questions from a database, contemporary semantic parsing mod- els struggle to generalize to unseen database schemas. The generalization challenge lies in (a) encoding the database relations in an accessible way for the semantic parser, and (b) modeling alignment between database columns and their mentions in a given query. We present a unified framework, based on the relation-aware self-attention mechanism, to address schema encoding, schema linking, and feature representation within a text-to-SQL encoder. On the challenging Spider dataset this framework boosts the exact match accu- racy to 57.2%, surpassing its best counterparts by 8.7% absolute improvement. Further augmented with BERT, it achieves the new state-of-the-art performance of 65.6% on the Spider leaderboard. In addition, we observe qualitative improvements in the model’s un- derstanding of schema linking and alignment. Our implementation will be open-sourced at https://github.com/Microsoft/rat-sql. 1 Introduction The ability to effectively query databases with nat- ural language (NL) unlocks the power of large datasets to the vast majority of users who are not proficient in query languages. As such, a large body of research has focused on the task of trans- lating NL questions into SQL queries that existing database software can execute. The development of large annotated datasets of questions and the corresponding SQL queries has catalyzed progress in the field. In contrast to prior semantic parsing datasets (Finegan-Dollak et al., ∗Equal contribution. Order decided by a coin toss. †Work done during an internship at Microsoft Research. ‡ Work done while partly affiliated with Microsoft Re- search. Now at Microsoft: ricshin@microsoft.com. 2018), new tasks such as WikiSQL (Zhong et al., 2017) and Spider (Yu et al., 2018b) pose the real- life challenge of generalization to unseen database schemas. Every query is conditioned on a multi- table database schema, and the databases do not overlap between the train and test sets. Schema generalization is challenging for three interconnected reasons. First, any text-to-SQL pars- ing model must encode the schema into representa- tions suitable for decoding a SQL query that might involve the given columns or tables. Second, these representations should encode all the information about the schema such as its column types, foreign key relations, and primary keys used for database joins. Finally, the model must recognize NL used to refer to columns and tables, which might differ from the referential language seen in training. The latter challenge is known as schema linking – align- ing entity references in the question to the intended schema columns or tables. While the question of schema encoding has been studied in recent literature (Bogin et al., 2019a), schema linking has been relatively less explored. Consider the example in …
Content truncated to 500 words
Labeled Text
AbstractWhen translating natural language questions into SQL queries to answer questions from a database, contemporary semantic parsing models struggle to generalize to unseen database schemas. The generalization challenge lies in (a) encoding the database relations in an accessible way for the semantic parser, and (b) modeling alignment between database columns and their mentions in a given query. We present a unified framework, based on the relation-aware self-attention mechanism, to address schema encoding, schema linking, and feature representation within a text-to-SQL encoder. On the challenging Spider dataset this framework boosts the exact match accuracy to 57.2%, surpassing its best counterparts by 8.7% absolute improvement. Further augmented with BERT, it achieves the new state-of-the-art performance of 65.6% on the Spider leaderboard. In addition, we observe qualitative improvements in the model’s understanding of schema linking and alignment. Our implementation will be open-sourced at
Publication Details
- Paper ID:
- 37294
- Year:
- 2020
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan