The invention relates to the field of
natural language processing (NLP), in particular to a
document level relation extraction technology. A traditional relation extraction method has the problems of insufficient local
semantics, insufficient global semantic modeling, difficulty in reasoning complex relations and the like when
processing long documents, cross-
sentence relations and long-distance dependence. In order to solve the technical problem, the invention provides a document-level relation extraction method based on multi-level feature collaborative modeling. The method comprises the following steps: acquiring context
semantic representation of a document by utilizing a pre-training
language model, and constructing entity representation through dynamic aggregation of multiple mentions of an entity; neighborhood fine-grained interaction features between entity pairs are captured in combination with a local interaction
convolution module, and key information contexts related to entity relation
inference are extracted through a global attention mechanism. Furthermore, a multi-level stacked
feature fusion structure is designed, and progressive collaborative modeling of local
semantics and global
semantics is realized, so that the expression ability of the model to a cross-
sentence relationship, long-distance reasoning and a complex relationship is enhanced. In addition, the invention provides a
hybrid adaptive
loss function to improve the robustness of the model to difficult-to-classify samples and low-frequency relationships; and a teacher-student type knowledge
distillation mechanism is introduced, and the student
model learning is guided by using pseudo labels and evidence distribution, so that the overall relationship
inference performance is improved. The method has high relation modeling ability, reasoning ability and generalization ability, and can be widely applied to tasks such as
knowledge graph construction and
information extraction.