Journal of Computer Applications ›› 2026, Vol. 46 ›› Issue (3): 732-740.DOI: 10.11772/j.issn.1001-9081.2025030371

• Artificial intelligence • Previous Articles     Next Articles

Few-shot relation extraction model with graph-based multi-view contrastive learning

Yuhang XIAO1, Guanfeng LI1,2(), Yuyin CHEN1, Jing QIN1   

  1. 1.School of Information Engineering,Ningxia University,Yinchuan Ningxia 750021,China
    2.Ningxia Key Laboratory of Artificial Intelligence and Information Security for Channeling Computing Resources from the East to the West (Ningxia University),Yinchuan Ningxia 750021,China
  • Received:2025-04-10 Revised:2025-05-23 Accepted:2025-05-28 Online:2025-06-12 Published:2026-03-10
  • Contact: Guanfeng LI
  • About author:XIAO Yuhang, born in 1999, M. S. candidate. His research interests include relation extraction.
    CHEN Yuyin, born in 1999, M. S. candidate. His research interests include knowledge graph reasoning, complex logic query.
    QIN Jing, born in 2000, M. S. candidate. Her research interests include knowledge graph embedding and reasoning.
  • Supported by:
    National Natural Science Foundation of China(62066038);Full-time Introduction of High-level Talent Research Start-up Project of Ningxia(2023BSB03066);Ningxia Natural Science Foundation(2024AAC03098)

基于图的多视角对比学习小样本关系抽取模型

肖毓航1, 李贯峰1,2(), 陈昱胤1, 秦晶1   

  1. 1.宁夏大学 信息工程学院,银川 750021
    2.宁夏“东数西算”人工智能与信息安全重点实验室(宁夏大学),银川 750021
  • 通讯作者: 李贯峰
  • 作者简介:肖毓航(1999—),男,福建莆田人,硕士研究生,CCF会员,主要研究方向:关系抽取
    陈昱胤(1999—),男,宁夏中卫人,硕士研究生,CCF会员,主要研究方向:知识图谱推理、复杂逻辑查询
    秦晶(2000—),女,陕西榆林人,硕士研究生,CCF会员,主要研究方向:知识图谱嵌入与推理。
  • 基金资助:
    国家自然科学基金资助项目(62066038);宁夏全职引进高层次人才科研启动项目(2023BSB03066);宁夏自然科学基金资助项目(2024AAC03098)

Abstract:

Few-Shot Relation Extraction (FSRE) tasks aim to recognize the semantic relationship between entities in text from limited number of labelled examples. To overcome the problems such as feature alignment deficiency and poor task adaptation caused by single-view contrastive learning and static graph structures adopted in the existing methods, an FSRE model fusing multi-view contrastive learning and dynamic graph generation mechanism, namely SAGM (Synergistic Anchored Graph-based Model), was proposed. In the model, in the pre-training stage, sentence-anchored and label-anchored strategies were introduced through multi-view contrastive learning, so as to enhance the alignment effect between instance and relation label features. In the task generation stage, a graph generation module was used to construct task-specific graph structure, and a multi-head attention guidance layer was applied to adjust feature importance dynamically, thereby improving the model’s adaptability in few-shot and cross-domain tasks. Experimental results on the FewRel 1.0, FewRel 2.0, and NYT-25 datasets show that the proposed model achieves high accuracy in multiple N-way K-shot settings, demonstrating strong generalization ability and task adaptability, and confirming its effectiveness in few-shot and cross-domain scenarios.

Key words: relation extraction, few-shot learning, pre-trained model, contrastive learning, multi-head attention

摘要:

小样本关系抽取(FSRE)任务旨在从有限的标注数据中识别文本中实体间的语义关系。针对现有方法因采用单一视角的对比学习和静态图结构而导致的特征对齐不足与任务适配性差等问题,提出一种融合多视角对比学习与动态图生成机制的FSRE模型SAGM(Synergistic Anchored Graph-based Model)。该模型在预训练阶段,通过多视角对比学习引入句子锚定和标签锚定策略,从而优化实例与关系标签特征的对齐效果;在任务生成阶段,利用图生成模块构建任务特定的图结构,并结合多头注意力引导层动态调整特征重要性,从而提升模型在小样本和跨领域任务中的适应性。在FewRel 1.0、FewRel 2.0以及NYT-25数据集上的实验结果表明,所提模型在多个N-way K-shot设置下取得了较高的准确率,表现出良好的泛化能力和任务适应性,验证了它在小样本和跨领域场景中的有效性。

关键词: 关系抽取, 小样本学习, 预训练模型, 对比学习, 多头注意力

CLC Number: