Recently, prompt-based learning has become a very popular solution in many Natural Language Processing (NLP) tasks by inserting a template into model input, which converts the task into a cloze-style one to smoothing out differences between the Pre-trained Language Model (PLM) and the current task. But in the case of relation classification, it is difficult to map the masked output to the relation labels because of its abundant semantic information, e.g. org:founded_by''. Therefore, a pre-trained model still needs enough labelled data to fit the relations. To mitigate this challenge, in this paper, we present a novel prompt-based learning method, namely LabelPrompt, for the relation classification task. It is an extraordinary intuitive approach by a motivation: ``GIVE MODEL CHOICES!''. First, we define some additional tokens to represent the relation labels, which regards these tokens as the verbalizer with semantic initialisation and constructs them with a prompt template method. Then we revisit the inconsistency of the predicted relation and the given entities, an entity-aware module with the thought of contrastive learning is designed to mitigate the problem. At last, we apply an attention query strategy to self-attention layers to resolve two types of tokens, prompt tokens and sequence tokens. The proposed strategy effectively improves the adaptation capability of prompt-based learning in the relation classification task when only a small labelled data is available. Extensive experimental results obtained on several bench-marking datasets demonstrate the superiority of the proposed LabelPrompt method, particularly in the few-shot scenario.
翻译:近年来,基于提示的学习通过向模型输入插入模板,将任务转化为完形填空形式以平滑预训练语言模型与当前任务间的差异,已成为自然语言处理中广泛应用的解决方案。但在关系分类任务中,由于关系标签(如"org:founded_by")蕴含丰富的语义信息,难以将掩码输出映射至关系标签。因此,预训练模型仍需足够标注数据来拟合这些关系。为缓解此挑战,本文提出一种新颖的基于提示的学习方法——LabelPrompt,用于关系分类任务。该方法以直观动机"让模型做选择!"为核心:首先定义部分附加标记表示关系标签,将其作为具有语义初始化的语言化器,并通过提示模板方法构建;其次,针对预测关系与给定实体的不一致性,设计基于对比学习的实体感知模块以缓解该问题;最后,针对自注意力层中的提示标记与序列标记两种类型,引入注意力查询策略。所提策略有效提升了基于提示的学习在仅少量标注数据条件下的关系分类任务适应能力。在多个基准数据集上的广泛实验结果表明,LabelPrompt方法具有显著优越性,尤其在少样本场景下表现突出。