计算机工程与应用 ›› 2023, Vol. 59 ›› Issue (9): 123-129.DOI: 10.3778/j.issn.1002-8331.2112-0391

• 模式识别与人工智能 • 上一篇    下一篇

基于依存句法和图注意力网络的句子匹配

杨春霞,陈启岗,徐奔,马文文   

  1. 1.南京信息工程大学 自动化学院,南京 210044
    2.江苏省大数据分析技术重点实验室,南京 210044
    3.江苏省大气环境与装备技术协同创新中心,南京 210044
  • 出版日期:2023-05-01 发布日期:2023-05-01

Sentence Matching Based on Dependency Syntax and Graph Attention Network

YANG Chunxia, CHEN Qigang, XU Ben, MA Wenwen   

  1. 1.School of Automation, Nanjing University of Information Science & Technology, Nanjing 210044, China
    2.Jiangsu Key Laboratory of Big Data Analysis Technology, Nanjing 210044, China
    3.Jiangsu Collaborative Innovation Center of Atmospheric Environment and Equipment Technology, Nanjing 210044, China
  • Online:2023-05-01 Published:2023-05-01

摘要: 句子匹配是自然语言处理的一项基本任务,可应用于自然语言推理、释义识别等多个场景。目前,主流的模型大多采用注意力机制来实现两个句子之间单词或短语的对齐。然而,这些模型通常忽略了句子的内在结构,没有考虑文本单元之间的依存关系。针对此问题,提出了一种基于依存句法和图注意力网络的匹配模型。设计两种建模方式将句子对建模为语义图。使用图注意力网络对构建的图进行编码以进行句子匹配。实验结果表明,提出的模型可以较好地学习图结构,在自然语言推理数据集SNLI和释义识别数据集Quora上分别达到了88.7%和88.9%的准确率。

关键词: 句子匹配, 依存句法, 图注意力网络, 词共现语义图, 全连通语义图

Abstract: Sentence matching is a basic task in natural language processing, which can be applied to natural language inference, paraphrase recognition and other scenarios. At present, most of the mainstream models use attention mechanism to realize the alignment of words or phrases between two sentences. However, these models usually ignore the internal structure of sentences and do not consider the dependency between text units. To solve this problem, this paper proposes a matching model based on dependency syntax and graph attention network. Two methods are designed to model sentence pairs as semantic graph. Graph attention network is used to encode the constructed graph for sentence matching. Experimental results show that the proposed model can learn graph structure well, and the accuracy of the model on the natural language inference dataset SNLI and the paraphrase recognition dataset Quora is 88.7% and 88.9% respectively.

Key words: sentence matching, dependency syntax, graph attention network, co-occurrence semantic graph, full-connected semantic graph