Multi-granularity Semantic Representation and Rule-Based Labeling for Relation Classification
摘要
Relation classification aims to determine the relationship between a given entity pair. Many existing methods based on Pre-trained Language Models (PLMs) exhibit weaknesses in the generalization of text embedding. Meanwhile, to cope with imbalanced datasets, researchers have proposed to apply contrastive learning to improve the classification ability of the models, but most of them lack effective data enhancement methods, thus the advantage of contrastive learning in dealing with imbalanced data is underexploited. Focusing on these two problems, the MSRL (Multi-granularity Semantic Representation and Rule-Based Labeling) model is proposed. Firstly, by incorporating semantic representations from different levels of granularity within PLMs, the MSRL achieves entity embedding with better transfer learning and improved generalisation performance. Secondly, MSRL designed a data enhancement method based on the prompt template: reconstructing the labels according to logic rules aims to make them more similar to the input instances in terms of text structure and ensure that the embedding of both is closer in the embedding space, thus fully leveraging contrastive learning. Finally, experiments on public datasets show that the proposed MSRL outperforms existing mainstream baseline models.