Context-dependent Text-to-SQL aims to translate multi-turn natural language questions into SQL queries. Despite various methods have exploited context-dependence information implicitly for contextual SQL parsing, there are few attempts to explicitly address the dependencies between current question and question context. This paper presents QURG, a novel Question Rewriting Guided approach to help the models achieve adequate contextual understanding. Specifically, we first train a question rewriting model to complete the current question based on question context, and convert them into a rewriting edit matrix. We further design a two-stream matrix encoder to jointly model the rewriting relations between question and context, and the schema linking relations between natural language and structured schema. Experimental results show that QURG significantly improves the performances on two large-scale context-dependent datasets SParC and CoSQL, especially for hard and long-turn questions.
翻译:摘要:上下文相关文本到SQL解析旨在将多轮自然语言问题转换为SQL查询语句。尽管已有多种方法隐式利用上下文依赖信息进行上下文SQL解析,但鲜有研究明确处理当前问题与问题上下文之间的依赖关系。本文提出QURG——一种新颖的问题改写引导方法,以帮助模型实现充分的上下文理解。具体而言,我们首先训练一个问题改写模型,基于问题上下文补全当前问题,并将其转换为改写编辑矩阵。我们进一步设计了一个双流矩阵编码器,联合建模问题与上下文之间的改写关系,以及自然语言与结构化模式之间的模式链接关系。实验结果表明,QURG在两个大规模上下文相关数据集SParC和CoSQL上显著提升了性能,尤其在处理困难及长轮次问题方面表现突出。