CQR - SQL : Conversational Question Reformulation Enhanced Context-Dependent Text-to- SQL Parsers (2022)

Abstract: Context-dependent text-to-SQL is the task of translating multi-turn questions into database-related SQL queries. Existing methods typically focus on making full use of history context or previously predicted SQL for currently SQL parsing, while neglecting to explicitly comprehend the schema and conversational dependency, such as co-reference, ellipsis and user focus change. In this paper, we propose CQR-SQL, which uses auxiliary Conversational Question Reformulation (CQR) learning to explicitly exploit schema and decouple contextual dependency for multi-turn SQL parsing. Specifically, we first present a schema enhanced recursive CQR method to produce domain-relevant self-contained questions. Secondly, we train CQR-SQL models to map the semantics of multi-turn questions and auxiliary self-contained questions into the same latent space through schema grounding consistency task and tree-structured SQL parsing consistency task, which enhances the abilities of SQL parsing by adequately contextual understanding. At the time of writing, our CQR-SQL achieves new state-of-the-art results on two context-dependent text-to-SQL benchmarks SParC and CoSQL.

## introduction the text-to-sql task is one of the widely followed branches of semantic parsing, which aims to parse natural language questions with a given database into sql queries. previous works @xcite @xcite focus on context-independent text-to-sql task. however, in reality, as users tend to prefer multiple turns interactive queries @xcite , the text-to-sql task based on conversational context is attracting more and more scholarly attention. the generalization challenge of the context-dependent text-to-sql task lies in jointly representing the multi-turn their how many pc members do we have? figure 1 : an example of context-dependent text-to-sql task demonstrates the phenomenon of co-reference, ellipsis, and user focus changes. the cqr module converts contextual questions to self-contained questions, which can be understood without the context. for context-dependent text-to-sql, it is common to train a model in an end-to-end manner that simply encoding the concatenation of the multiturn questions and schema, as shown in figure 2 (a). to exploit context-dependence information, @xcite propose a dynamic relation decay mechanism to model the dynamic relationships between schema and question as conversation proceeds. @xcite and @xcite leverage previously predicted sql queries to enhance currently sql parsing. however, we argue that these end-to-end approaches are inadequate guidance for the contextual dependency phe- ## proposed method in this section, we first formally define the contextdependent text-to-sql task and introduce the backbone network of cqr-sql. afterwards, the technical details of cqr-sql are elaborated in two subsections: schema enhanced recursive cqr and latent cqr learning for text-to-sql in context. ## experiments in this section, we conduct several experiments to assess the performance of proposed methods in §2. ## conclusions we propose cqr-sql, a novel context-dependent text-to-sql approach that explicitly comprehends the schema and conversational dependency through latent cqr learning. the method introduces a schema enhanced recursive generation mechanism to generate domain-relative self-contained questions, then trains models to map the semantics of self-contained questions and multi-turn question context into the same latent space with schema grounding consistency task and sql parsing consistency task for adequately context understanding. experimental results show that cqr-sql achieves new state-of-the-art results on two classical context-dependent text-to-sql datasets sparc and cosql.