Skip to main content
QUICK REVIEW

[论文解读] Representing Schema Structure with Graph Neural Networks for Text-to-SQL Parsing

Ben Bogin, Matt Gardner|arXiv (Cornell University)|May 15, 2019
Natural Language Processing Techniques参考文献 19被引用 40
一句话总结

本文提出一个基于图神经网络(GNN)的模式表示,并将其整合到编码器-解码器文本转SQL解析器中,通过在编码和解码时对模式结构进行条件化,在 Spider 基准测试上实现了显著的准确性提高。

ABSTRACT

Research on parsing language to SQL has largely ignored the structure of the database (DB) schema, either because the DB was very simple, or because it was observed at both training and test time. In Spider, a recently-released text-to-SQL dataset, new and complex DBs are given at test time, and so the structure of the DB schema can inform the predicted SQL query. In this paper, we present an encoder-decoder semantic parser, where the structure of the DB schema is encoded with a graph neural network, and this representation is later used at both encoding and decoding time. Evaluation shows that encoding the schema structure improves our parser accuracy from 33.8% to 39.4%, dramatically above the current state of the art, which is at 19.7%.

研究动机与目标

  • 在零样本文本到 SQL 解析中,强调复杂且未见模式(Spider)下数据库模式结构的重要性。
  • 提出基于 GNN 的模式表示,以为编码器和解码器提供全局、模式感知的信号。
  • 证明将模式结构纳入考虑能显著提升 SQL 查询的准确性,特别是对于多表查询。

提出的方法

  • 将每个数据库模式转换为多类型图,表和列作为节点,外键关系作为边。
  • 为模式项计算基于问题的相关性分数,以对每个问题软性地减小模式影响。
  • 使用门控图神经网络来计算节点表示,结合全局模式结构和问题相关性。
  • 用图信息驱动的模式表示来增强编码器输入,并修改解码器以关注并利用图感知的模式信号。
  • 在解码时,对先前解码的模式项包含自注意力机制,以偏向未来的模式项选择。

实验结果

研究问题

  • RQ1使用图神经网络对模式结构进行编码,是否能在未见模式(Spider)上的文本到 SQL 解析中提升性能?
  • RQ2模式感知表示对编码时和解码时决策的影响如何,尤其是涉及多表查询时?

主要发现

模型准确率单表多表
SQLNet10.9%13.6%3.3%
SyntaxSQLNet18.9%23.1%7.0%
No GNN34.9%52.3%14.6%
GNN40.7%52.2%26.8%
- No Self Attend38.7%54.5%20.3%
- Only self attend35.9%47.1%23.0%
- No Rel.37.0%50.4%21.5%
GNN Oracle Rel.54.3%63.5%43.7%
  • 完整的基于 GNN 的模型在 Spider 测试集上达到 39.4% 的准确度,显著高于先前的最先进水平(19.7%)。
  • 移除 GNN 将准确率降至 33.8%,显示出模式结构的重要性。
  • 模式感知建模尤其将多表查询的准确率从 14.6% 提升到 26.8%。
  • 消融实验表明自注意力和相关性信号都对性能有贡献;类 Oracle 的相关性进一步将潜在提升提高到 54.3%。
  • 与 No GNN 相比,该模型减少了“错误”连接(如连接不相关的表)的发生率(15.6% vs 83.4%)。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。