RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers
Preprint
Abstract
When 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
All Related Versions
This publication has 9 references indexed in Scilit:
- RYANSQL: Recursively Applying Sketch-based Slot Fillings for Complex Text-to-SQL in Cross-Domain DatabasesComputational Linguistics, 2021
- Global Reasoning over Database Structures for Text-to-SQL Parsing2019
- Representing Schema Structure with Graph Neural Networks for Text-to-SQL Parsing2019
- Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representation2019
- Coarse-to-Fine Decoding for Neural Semantic Parsing2018
- Self-Attention with Relative Position Representations2018
- A Syntactic Neural Model for General-Purpose Code Generation2017
- Constructing an interactive natural language interface for relational databasesProceedings of the VLDB Endowment, 2014
- Towards a theory of natural language interfaces to databases2003