Recently, prompt-based learning has gained popularity across many natural language processing (NLP) tasks by reformulating them into a cloze-style format to better align pre-trained language models (PLMs) with downstream tasks. However, applying this approach to relation classification poses unique challenges. Specifically, associating natural language words that fill the masked token with semantic relation labels (\textit{e.g.} \textit{``org:founded\_by}'') is difficult. To address this challenge, this paper presents a novel prompt-based learning method, namely LabelPrompt, for the relation classification task. Motivated by the intuition to ``GIVE MODEL CHOICES!'', we first define additional tokens to represent relation labels, which regard these tokens as the verbaliser with semantic initialisation and explicitly construct them with a prompt template method. Then, to mitigate inconsistency between predicted relations and given entities, we implement an entity-aware module with contrastive learning. Last, we conduct an attention query strategy within the self-attention layer to differentiates prompt tokens and sequence tokens. Together, these strategies enhance the adaptability of prompt-based learning, especially when only small labelled datasets is available. Comprehensive experiments on benchmark datasets demonstrate the superiority of our method, particularly in the few-shot scenario.
翻译:摘要:近年来,基于提示的学习方法通过将自然语言处理任务重新构建为完形填空格式,以更好地对齐预训练语言模型与下游任务,已在众多任务中广受欢迎。然而,将该方法应用于关系分类面临独特挑战,尤其是将填充掩码标记的自然语言词汇与语义关系标签(例如"org:founded_by")相关联十分困难。为解决这一问题,本文提出了一种新颖的基于提示的学习方法——LabelPrompt,专门针对关系分类任务。受"为模型提供选择!"这一直觉的启发,我们首先定义额外标记来表示关系标签,将此类标记视为具有语义初始化的语言表达器,并通过提示模板方法显式构建它们。接着,为缓解预测关系与给定实体之间的不一致性,我们实现了一个基于对比学习的实体感知模块。最后,我们在自注意力层内部采用注意力查询策略,以区分提示标记和序列标记。这些策略联合增强了基于提示学习的适应性,尤其是在仅拥有少量标注数据集的情况下。在基准数据集上的综合实验证明了我们方法的优越性,尤其在少样本场景中表现突出。