Information extraction is a fundamental task in natural language processing,which extracts structured knowledge from unstructured text and plays a crucial role in constructing knowledge graphs.As a key component of information extraction,relation extraction aims at extracting the relation between two entities in a text.With the development of the Internet and the continuous emergence of textual information,relation extraction is developing rapidly,and many different methods of relation extraction have emerged.To address problems such as the need for large amounts of labeled data and the closed-world assumption in the training process,researchers have gradually turned their attention to few-shot relation extraction.Few-shot relation extraction aims to train the model by using a small number of labeled support set instances,enabling the model to effectively identify instances in the query set.In existing few-shot relation extraction methods,prototype-based relation extraction methods classify instances by measuring the similarity between instances and prototypes.Some of these methods also introduce additional information,significantly improving the accuracy of classification.However,there are two problems in current few-shot relation extraction methods based on prototype networks,i.e.,the inability to effectively mine and utilize query set information and hierarchical relation information.First,when generating relation prototypes using support set instances,only few support set instances are used,and the unlabeled query set information is not fully utilized,resulting in bias between the generated relation prototypes and the expected relation prototypes.Second,there are hierarchical information and different similarities between different relations,but current few-shot relation extraction methods do not use this hierarchical information to guide relation extraction,resulting in poor performance in identifying similar relations.To address these problems,we designed a prototype network-based few-shot relation extraction method and proposed two strategies to improve the effectiveness of the prototype network.Based on prototype network,we used clustering information of query set instances.In detail,we obtained the relation vector of each instance in the support set and took the average of the relation vectors of the same relation as the initial relation prototype.Then,we modified the relation prototype by fusing the clustering centers of the query set instances into the initial relation prototype.Moreover,we introduced the relation hierarchy information into the few-shot relation extraction task to obtain the relation similarity information.Finally,we improved the cross-entropy loss with relation similarity,enabling the model to focus more on differentiating similar relations during training.The proposed method in this paper is validated on the Few Rel dataset and compared with various state-of-the-art algorithms,evaluating the performance of the proposed algorithm from multiple perspectives.The experimental results show that the proposed algorithm has certain advantages in addressing the problems of relation prototype bias and identifying similar relations,and performs better than other methods. |