X-SQL: reinforce schema representation with context
Pengcheng He, Yi Mao, Kaushik Chakrabarti, Weizhu Chen Microsoft Dynamics 365 AI
Abstract
In this work, we present X-SQL, a new network architecture for the problem of parsing natural language to SQL query. X-SQL proposes to enhance the structural schema representation with the contextual output from BERT-style pre-training model, and together with type information to learn a new schema representation for down-stream tasks. We evaluated X-SQL on the WikiSQL dataset and show its new state-of-the-art performance.
中文速览
把自然语言问题自动转化为可执行的SQL查询(Text-to-SQL)一直面临如何同时理解非结构化问题和结构化数据库表格的挑战,X-SQL通过引入基于MT-DNN预训练模型的"上下文增强模式编码器(Context Enhanced Schema Encoder)"来解决这一问题——它把BERT风格的[CLS]全局上下文表示注入到每一列的结构化表征中,让模型同时理解问题语义和表格结构,并额外融入列类型嵌入(type embedding)以利用数值列/类别列等类型约束,同时将WHERE子句中的列预测从多个独立二分类器改造为基于KL散度的列表式全局排序,使各列的得分具有可比性。在WikiSQL基准数据集上,X-SQL在逻辑形式准确率和执行准确率两项指标上全面超越此前最佳模型SQLova,不借助执行引导(Execution Guidance)时测试集逻辑形式准确率提升2.6%,加上执行引导后首次突破90%,并成为首个在不使用执行引导条件下超越人类表现的模型。这项工作的意义在于为预训练语言模型与结构化数据的融合提供了一种简洁有效的新范式,其上下文增强方案和类型感知设计可直接迁移到其他涉及结构化数据理解的NLP任务中。
原文 arXiv:1908.08113;中英对照 + 大白话阅读 https://aha.fim.ai/paper/1908.08113v1