Editing-Based SQL Query Generation for Cross-Domain Context-Dependent Questions
8978Authors
nan
Abstract
AbstractWe focus on the cross-domain context-dependent text-to-SQL generation task. Based on the observation that adjacent natural language questions are often linguistically dependent and their corresponding SQL queries tend to overlap, we utilize the interaction history by editing the previous predicted query to improve the generation quality. Our editing mechanism views SQL as sequences and reuses generation results at the token level in a simple manner. It is flexible to change individual tokens and robust to error propagation. Furthermore, to deal with complex table structures in different domains, we employ an utterance-table encoder and a table-aware decoder to incorporate the context of the user utterance and the table schema. We evaluate our approach on the SParC dataset and demonstrate the benefit of editing compared with the state-of-the-art baselines which generate SQL from scratch. Our code is available at https://github.com/ryanzhumich/sparc_atis_pytorch.
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 5338–5349, Hong Kong, China, November 3–7, 2019. c⃝2019 Association for Computational Linguistics 5338 Editing-Based SQL Query Generation for Cross-Domain Context-Dependent Questions Rui Zhang† Tao Yu† He Yang Er† Sungrok Shim† Eric Xue† Xi Victoria Lin¶ Tianze Shi§ Caiming Xiong¶ Richard Socher¶ Dragomir Radev† † Yale University ¶ Salesforce Research § Cornell University {r.zhang, tao.yu, dragomir.radev}@yale.edu {xilin, cxiong, rsocher}@salesforce.com Abstract We focus on the cross-domain context- dependent text-to-SQL generation task. Based on the observation that adjacent natural lan- guage questions are often linguistically de- pendent and their corresponding SQL queries tend to overlap, we utilize the interaction his- tory by editing the previous predicted query to improve the generation quality. Our edit- ing mechanism views SQL as sequences and reuses generation results at the token level in a simple manner. It is flexible to change individual tokens and robust to error prop- agation. Furthermore, to deal with com- plex table structures in different domains, we employ an utterance-table encoder and a table-aware decoder to incorporate the context of the user utterance and the table schema. We evaluate our approach on the SParC dataset and demonstrate the benefit of editing compared with the state-of-the-art baselines which generate SQL from scratch. Our code is available at https://github.com/ ryanzhumich/sparc_atis_pytorch. 1 Introduction Generating SQL queries from user utterances is an important task to help end users acquire informa- tion from databases. In a real-world application, users often access information in a multi-turn in- teraction with the system by asking a sequence of related questions. As the interaction proceeds, the user often makes reference to the relevant men- tions in the history or omits previously conveyed information assuming it is known to the system. Therefore, in the context-dependent scenario, the contextual history is crucial to understand the follow-up questions from users, and the system often needs to reproduce partial sequences gener- ated in previous turns. Recently, Suhr et al. (2018) proposes a context-dependent text-to-SQL model including an interaction-level encoder and an at- tention mechanism over previous utterances. To reuse what has been generated, they propose to copy complete segments from the previous query. While their model is successful to reason about ex- plicit and implicit references, it does not need to explicitly address different database schemas be- cause the ATIS contains only the flight-booking domain. Furthermore, the model is confined to copy whole segments which are extracted by a rule-based procedure, limiting its capacity to uti- lize the previous query when only one or a few tokens are changed in the segment. To exploit the correlation between sequentially generated queries and generalize the system to different domains, in this paper, we study an editing-based approach for cross-domain context- dependent text-to-SQL generation task. We pro- pose query generation by editing the query in the previous turn. To this end, we first encode the previous query as a sequence of tokens, and the decoder computes …
Content truncated to 500 words
Labeled Text
AbstractWe focus on the cross-domain context-dependent text-to-SQL generation task. Based on the observation that adjacent natural language questions are often linguistically dependent and their corresponding SQL queries tend to overlap, we utilize the interaction history by editing the previous predicted query to improve the generation quality. Our editing mechanism views SQL as sequences and reuses generation results at the token level in a simple manner. It is flexible to change individual tokens and robust to error propagation. Furthermore, to deal with complex table structures in different domains, we employ an utterance-table encoder and a table-aware decoder to incorporate the context of the user utterance and the table schema. We evaluate our approach on the SParC dataset and demonstrate the benefit of editing compared with the state-of-the-art baselines which generate SQL from scratch. Our code is available at
Publication Details
- Paper ID:
- 8978
- Year:
- 2019
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan