Structure-Grounded Pretraining for Text-to-SQL
21768Authors
nan
Abstract
AbstractLearning to capture text-table alignment is essential for tasks like text-to-SQL. A model needs to correctly recognize natural language references to columns and values and to ground them in the given database schema. In this paper, we present a novel weakly supervised Structure-Grounded pretraining framework (STRUG) for text-to-SQL that can effectively learn to capture text-table alignment based on a parallel text-table corpus. We identify a set of novel pretraining tasks: column grounding, value grounding and column-value mapping, and leverage them to pretrain a text-table encoder. Additionally, to evaluate different methods under more realistic text-table alignment settings, we create a new evaluation set Spider-Realistic based on Spider dev set with explicit mentions of column names removed, and adopt eight existing text-to-SQL datasets for cross-database evaluation. STRUG brings significant improvement over BERTLARGE in all settings. Compared with existing pretraining methods such as GRAPPA, STRUG achieves similar performance on Spider, and outperforms all baselines on more realistic sets. All the code and data used in this work will be open-sourced to facilitate future research.
Keywords
Full Content
Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1337–1350 June 6–11, 2021. ©2021 Association for Computational Linguistics 1337 Structure-Grounded Pretraining for Text-to-SQL Xiang Deng ∗1, Ahmed Hassan Awadallah2, Christopher Meek2, Oleksandr Polozov2, Huan Sun1, and Matthew Richardson2 1The Ohio State University {deng.595,sun.397}@osu.edu 2Microsoft Research, Redmond {hassanam,meek,polozov,mattri}@microsoft.com Abstract Learning to capture text-table alignment is es- sential for tasks like text-to-SQL. A model needs to correctly recognize natural language references to columns and values and to ground them in the given database schema. In this paper, we present a novel weakly super- vised Structure-Grounded pretraining frame- work (STRUG) for text-to-SQL that can ef- fectively learn to capture text-table alignment based on a parallel text-table corpus. We identify a set of novel pretraining tasks: col- umn grounding, value grounding and column- value mapping, and leverage them to pretrain a text-table encoder. Additionally, to eval- uate different methods under more realistic text-table alignment settings, we create a new evaluation set Spider-Realistic based on Spi- der dev set with explicit mentions of column names removed, and adopt eight existing text- to-SQL datasets for cross-database evaluation. STRUG brings significant improvement over BERTLARGE in all settings. Compared with ex- isting pretraining methods such as GRAPPA, STRUG achieves similar performance on Spi- der, and outperforms all baselines on more re- alistic sets. All the code and data used in this work is public available at https://aka.ms/ strug. 1 Introduction Semantic parsing is the task of mapping a nat- ural language (NL) utterance to a machine- understandable representation such as lambda cal- culus, abstract meaning representation, or a struc- tured query language (e.g., SQL). In this paper, we focus on the task of translating NL questions to exe- cutable SQL queries (text-to-SQL). This is a funda- mental task for building natural language interfaces for databases, which can enable non-expert users to effortlessly query databases (Androutsopoulos et al., 1995; Li and Jagadish, 2014a). ∗Work done during an internship at Microsoft Research. Figure 1: Illustration of text-to-SQL text-table align- ment (top half) and parallel text-table corpus (bottom half). In both examples, the associations between to- kens in the NL utterance and columns in the table are in- dicated. In this paper, we aim to leverage the text-table alignment knowledge in the parallel text-table corpus to help text-to-SQL. One of the key challenges in text-to-SQL is text-table alignment, that is, to correctly recog- nize natural language references to columns and values and to ground them in the given database schema. Consider the example in the top half of Fig. 1. A model needs to first identify the column mentions total credits, department, and value mention History, and then ground them to the given schema. This is challenging for three reasons. First, the model needs to jointly understand the NL utterance and the database schema, as the user may refer to a column using various expressions which usually differ from the original column name. Sec- ond, the model needs to be …
Content truncated to 500 words
Labeled Text
AbstractLearning to capture text-table alignment is essential for tasks like text-to-SQL. A model needs to correctly recognize natural language references to columns and values and to ground them in the given database schema. In this paper, we present a novel weakly supervised Structure-Grounded pretraining framework (STRUG) for text-to-SQL that can effectively learn to capture text-table alignment based on a parallel text-table corpus. We identify a set of novel pretraining tasks: column grounding, value grounding and column-value mapping, and leverage them to pretrain a text-table encoder. Additionally, to evaluate different methods under more realistic text-table alignment settings, we create a new evaluation set Spider-Realistic based on Spider dev set with explicit mentions of column names removed, and adopt eight existing text-to-SQL datasets for cross-database evaluation. STRUG brings significant improvement over BERTLARGE in all settings. Compared with existing pretraining methods such as GRAPPA, STRUG achieves similar performance on Spider, and outperforms all baselines on more realistic sets. All the code and data used in this work will be open-sourced to facilitate future research.
Publication Details
- Paper ID:
- 21768
- Year:
- 2021
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan