计算机科学与探索 ›› 2025, Vol. 19 ›› Issue (6): 1580-1587.DOI: 10.3778/j.issn.1673-9418.2407094

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

基于提示标签协同的关系抽取方法

冉哲宇,陈艳平,王凯,黄瑞章,秦永彬   

  1. 1. 贵州大学  文本计算与认知智能教育部工程研究中心,贵阳  550025
    2. 贵州大学  公共大数据国家重点实验室,贵阳  550025
    3. 贵州大学  计算机科学与技术学院,贵阳  550025
  • 出版日期:2025-06-01 发布日期:2025-05-29

Prompt Labels Collaboration for Relation Extraction

RAN Zheyu, CHEN Yanping, WANG Kai, HUANG Ruizhang, QIN Yongbin   

  1. 1. Engineering Research Center of Text Computing & Cognitive Intelligence, Ministry of Education, Guizhou University, Guiyang 550025, China
    2. State Key Laboratory of Public Big Data, Guizhou University, Guiyang 550025, China
    3. College of Computer Science and Technology, Guizhou University, Guiyang 550025, China
  • Online:2025-06-01 Published:2025-05-29

摘要: 提示学习可以将下游任务转换为预训练任务形式的掩码预测任务。然而,将提示学习应用于关系抽取任务时,由于掩码的输出是标签类别的语义向量表示,容易导致生成空间过大而对掩码语义解析度不足。针对这一问题,提出了一种基于提示标签协同的关系抽取方法。为每个关系类构建两组同义词标签。其中一组用于学习掩码表示,另一组用于强化标签语义。在掩码语言模型中引入约束层以对掩码表示进行双向约束。使得两组同义词标签间隐含差异的语义和先验知识能够融入到关系表示中。由于同义词标签是基于知识初始化的,它们在潜在变量空间中可能不是最优的,应该与周围的上下文相关联。因此,在训练过程中,同义词标签表示会与掩码共同参与优化。提出的方法能够提高模型对标签语义的认知能力,同时优化掩码表示,从而提升模型对掩码的语义解析能力。实验结果表明,该方法在标准和小样本设置的三个公共数据集上均明显优于对比方法,证明了该方法的有效性。

关键词: 提示学习, 提示标签协同, 掩码语言模型

Abstract: Prompt learning can transform downstream tasks into pre-training-style masked prediction tasks. However, when applied to relation extraction tasks, the masking output being semantic vector representations of label categories tends to result in an excessively large generation space, leading to insufficient mask semantic resolution. To address this issue, this paper proposes a method for relation extraction based on collaborative prompt labels. Specifically, for each relation class, two sets of synonymous tags are constructed: one set is used to learn the mask representation, while the other serves to reinforce label semantics. Subsequently, a constraint layer is introduced within the masked language model to impose bidirectional constraints on the mask representation, thereby integrating the implicitly differing semantics and prior knowledge between the two sets of synonymous tags into the relational representation. Meanwhile, since synonym tags are initialized based on prior knowledge, their representations in the latent variable space may not be optimal and should be contextually correlated with surrounding elements. Therefore, during training, the representations of synonym tags are jointly optimized with the mask. This approach enhances the model’s understanding of label semantics while optimizing mask representations, thereby improving the model’s ability to semantically parse masks. Experimental results show that this method outperforms comparative approaches significantly on three public datasets under standard and few-shot settings, substantiating its effectiveness.

Key words: prompt learning, collaborative prompt labels, masked language model