《计算机应用》唯一官方网站

• •    下一篇

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

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

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

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

XIAO Yuhang1, LI Guanfeng1,2, CHEN Yuyin1, QIN Jing1   

  1. 1. School of Information Engineering, Ningxia University 2. Ningxia Key Laboratory of Artificial Intelligence and Information Security for Channeling Computing Resources from the East to the West (Ningxia University)

  • Received:2025-04-08 Revised:2025-05-23 Online:2025-06-12 Published:2025-06-12
  • About author:XIAO Yuhang, born in 1999, M. S. candidate. His research interests include relation extraction. LI Guanfeng, born in 1979, Ph. D., associate professor. His research interests include knowledge engineering, intelligent computing. 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:
     Natural Science Foundation of China (62066038); Full-time Introduction of High-level Talent Research Start-up Project Foundation of Ningxia(2023BSB03066); Natural Science Foundation of Ningxia Province (2024AAC03098).

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

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

Abstract: Few-shot relation extraction aims to identify the semantic relationship between entities in text when a limited number of labelled examples were available. To overcome the feature-alignment deficiency and task-adaptation weakness caused by single-view contrastive learning and static graph structures, a few-shot relation extraction model fusing multi-view contrastive learning and dynamic graph generation was proposed. During the pre-training stage, sentence-anchored and label-anchored strategies were introduced through multi-view contrastive learning to enhance the alignment between instance features and relation-label features. In task the-generation stage, a graph-generation module was used to construct task-specific graphs, and a multi-head attention guidance layer was applied to dynamically reallocate feature importance thereby, improving the model's adaptability to few-shot and cross-domain tasks. Experiments on the FewRel 1.0, FewRel 2.0, and NYT-25 datasets were carried out. The results showed that the proposed method achieved high accuracy in multiple N-way K-shot settings, demonstrated strong general andization task adaptability, and confirmed its effectiveness in few-shot and cross-domain scenarios.

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

中图分类号: