Document-level relation extraction method and system based on knowledge enhancement and evidence guidance

By constructing a hierarchical heterogeneous graph, coreference resolution, and external knowledge fusion, combined with axial attention mechanism and confidence filtering, the problem of scattered reasoning ability and noise in existing document-level relation extraction methods is solved, and efficient long document relation extraction is achieved.

CN121998082APending Publication Date: 2026-05-08DALIAN MARITIME UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202512032974.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing document-level relation extraction methods suffer from poor performance in long document reasoning and implicit relation detection tasks due to their dispersed reasoning capabilities, high noise in knowledge integration, insufficient evidence guidance, and limited ability to capture long-range dependencies.

Method used

We adopt a unified framework based on knowledge enhancement and evidence guidance. By constructing hierarchical heterogeneous graphs, coreference resolution, external knowledge fusion and axial attention mechanisms, combined with confidence filtering mechanism and evidence supervision, we can achieve synergy and complementarity of multiple reasoning modes.

Benefits of technology

It improves the accuracy and robustness of relation extraction, effectively captures cross-sentence entity associations, reduces computational costs and noise interference, and enhances the stability of multi-hop inference in long document scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121998082A_ABST
    Figure CN121998082A_ABST
Patent Text Reader

Abstract

The invention discloses a document-level relation extraction method and system based on knowledge enhancement and evidence guidance, and belongs to the technical field of natural language processing and information extraction. According to the invention, three core modules are mainly used for cooperative work: a document graph enhancement module is used for constructing a hierarchical heterogeneous graph and fusing co-reference analysis to enhance semantic representation; the knowledge enhancement module introduces an external knowledge base and adopts a confidence coefficient filtering mechanism to reduce knowledge noise; the evidence guidance reasoning module realizes multi-hop reasoning through axial attention and evidence supervision, and solves the technical problems of decentralized modeling of reasoning capability, large knowledge integration noise, insufficient evidence guidance and limited long-range dependence capture capability in the existing method. Experiments show that the method can effectively capture inter-sentence dependence, suppress knowledge noise and improve multi-hop reasoning stability, and can be widely applied to scenes such as knowledge graph construction, intelligent question and answer and information retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of natural language processing and information extraction technology, and specifically relates to a document-level relation extraction method and system based on knowledge enhancement and evidence guidance. Background Technology

[0002] With the explosive growth of internet information, massive amounts of unstructured text data have been generated across various sectors of society, such as news reports, research papers, medical records, legal documents, corporate announcements, and social media content. These texts contain rich information about entities and their relationships, forming a crucial foundation for intelligent applications such as knowledge graphs, intelligent retrieval, question-answering systems, risk warnings, and decision support. To extract structured relational information from unstructured text, researchers have proposed Relation Extraction (RE) technology, whose core objective is to identify semantic relationships between entities within the text.

[0003] Traditional relation extraction methods are mostly based on sentence-level analysis, which assumes that two entities and their relations both appear in the same sentence. However, with the expansion of application requirements, this assumption is no longer sufficient to meet the complexity of real-world scenarios. Therefore, in recent years, the document-level relation extraction (DocRE) task has been proposed, which requires models to integrate the contextual information of the entire document to identify entity relations across sentences or even paragraphs.

[0004] Despite some progress in document-level relation extraction, most current methods still have significant limitations. For example, graph-based methods rely solely on internal document signals to construct entity / mention graphs, neglecting the supplementation of implicit relations by external common sense knowledge; while some knowledge augmentation methods introduce external knowledge bases, they often treat knowledge injection as a preprocessing or feature concatenation step, failing to dynamically select effective knowledge during training; evidence-guided methods often treat "support sentence extraction" as an auxiliary task, resulting in weak coupling with relation classification and an inability to effectively guide the model to focus on relation-related text; furthermore, traditional self-attention mechanisms suffer from high computational costs and insufficient entity-level interaction modeling when processing long documents, making it difficult to efficiently capture entity relationships across multiple sentences.

[0005] In summary, existing models have shortcomings in reasoning modeling, knowledge integration, evidence guidance, and long-range dependency capture, resulting in poor performance in long document reasoning and implicit relation detection tasks. Therefore, there is an urgent need in this field for a unified framework to coordinate multiple reasoning capabilities, thereby improving the accuracy and robustness of relation extraction. Summary of the Invention

[0006] In view of this, the present invention provides a document-level relation extraction method and system based on knowledge enhancement and evidence guidance to solve the technical problems of existing document-level relation extraction methods, such as dispersed modeling of reasoning ability, large noise in knowledge integration, insufficient evidence guidance, and limited ability to capture long-range dependencies.

[0007] The technical solution adopted in this invention is as follows: On the one hand, this invention provides a document-level relation extraction method based on knowledge enhancement and evidence guidance, comprising the following steps: Obtain the document to be processed, which contains a set of sentences and a set of entities, with each entity corresponding to at least one mention; The document to be processed is fed into the encoder for semantic encoding. A hierarchical heterogeneous graph is constructed based on the semantic encoding of the document, and the semantic representation of the entity is optimized by combining coreference resolution. Based on the entity nodes in the heterogeneous graph that have been optimized by coreference resolution, knowledge triples of entity pairs are retrieved from an external knowledge base. Valid knowledge triples are then selected based on a confidence filtering mechanism to update the entity representation. The evidence distribution of entity pairs is calculated based on the entity representation after document semantic encoding. Multi-hop reasoning is performed using the axial attention mechanism based on the evidence distribution to obtain the context-enhanced representation of entity pairs. The axial attention mechanism takes the entity representation of the heterogeneous graph and the semantic information after fusion of external knowledge as input, and realizes multi-hop reasoning across entity pairs through row and column bidirectional self-attention. The model is trained end-to-end based on the joint training objective, and the output is entity-relation triplet.

[0008] Furthermore, a hierarchical heterogeneous graph is constructed based on document semantic encoding, and the semantic representation of entities is optimized by combining coreference parsing, including: The document is encoded using a pre-trained language model to obtain token embeddings and cross-attention matrices; The node types include mention nodes, sentence nodes, and document nodes, and the edge types include document-sentence edges, sentence-sentence edges, mention-sentence edges, co-occurrence mention-mentioned edges, and coreference mention-mentioned edges, forming a hierarchical heterogeneous graph. The importance of edges is calculated using a graph attention network, and the node representation is updated after softmax normalization. A pre-trained coreference parsing model is used to identify coreference pronouns in documents, and an attention matrix is ​​used to enhance their semantic representation.

[0009] Furthermore, the coreference parsing employs a pre-trained language model, coref-spanbert-large, and updates the semantic representation of coreference pronouns through an attention matrix, which is a token-level attention weight matrix output by the pre-trained language model.

[0010] Furthermore, knowledge triples of entity pairs are retrieved from external knowledge bases, including: Obtain the standard identifier of the entity in the knowledge base through the interface of the external knowledge base; Query the triplet relationships between entities and add the retrieved valid relationships as new edges to the graph to form a knowledge-enhanced graph structure.

[0011] Furthermore, based on a confidence filtering mechanism, valid knowledge triples are selected to update entity representations, including: Calculate the confidence weight for each knowledge edge and normalize it using the sigmoid function, retaining only triples with confidence scores higher than the threshold for subsequent calculations. Optimize confidence levels by leveraging trust loss to reduce the impact of noise.

[0012] Furthermore, based on the entity representation after document semantic encoding, the evidence distribution of entity pairs is calculated. Multi-hop reasoning is then performed using an axial attention mechanism based on this evidence distribution to obtain a context-enhanced representation of the entity pairs, including: For each entity pair, token-level importance weights are calculated based on its attention vector and aggregated into a sentence-level evidence distribution; The predicted evidence distribution is constrained by using the KL divergence loss function and the labeled evidence distribution as a supervision signal. Enhanced entity pair representations are generated by fusing contextual information; By employing an axial attention mechanism, self-attention computation is performed along the row and column dimensions of the entity pair tensor to enable multi-hop reasoning, resulting in the final context-enhanced representation.

[0013] Furthermore, the objectives of the joint training include relation classification loss, knowledge confidence loss, and evidence supervision loss; the relation classification loss employs an adaptive threshold loss function, which is the threshold used by each entity pair to dynamically learn and distinguish between valid and invalid relations.

[0014] On the other hand, the present invention also provides a document-level relation extraction system based on knowledge enhancement and evidence guidance, comprising: The document acquisition module is used to acquire the document to be processed. The document contains a set of sentences and a set of entities, and each entity corresponds to at least one mention. The document graph enhancement module is used to construct hierarchical heterogeneous graphs based on document semantic encoding and to optimize the semantic representation of entities by combining coreference parsing; The knowledge enhancement module is used to retrieve knowledge triples of entity pairs from an external knowledge base based on the entity nodes in the heterogeneous graph that have been optimized by coreference resolution, filter effective knowledge triples based on a confidence filtering mechanism, and update the entity representation. The evidence-guided reasoning module is used to calculate the evidence distribution of entity pairs based on the entity representation after document semantic encoding, and to perform multi-hop reasoning using an axial attention mechanism based on the evidence distribution to obtain the context-enhanced representation of entity pairs. The axial attention mechanism takes the entity representation of the heterogeneous graph and the semantic information after fusion with external knowledge as input, and realizes multi-hop reasoning across entity pairs through row and column bidirectional self-attention. The training module is used to perform end-to-end training of the model based on the joint training objective and output entity-relation triples.

[0015] Compared with the prior art, the beneficial effects of the present invention are: (1) This invention integrates graph structure modeling, external knowledge fusion, coreference resolution, evidence supervision and axial attention mechanism into a unified framework for the first time, realizing the synergy and complementarity of multiple reasoning modes, and effectively overcoming the limitations of existing methods in terms of dispersed reasoning ability and difficulty in capturing complex semantic dependencies.

[0016] (2) This invention introduces an external knowledge enhancement mechanism based on confidence filtering. By dynamically calculating the confidence weight of knowledge triples and filtering highly relevant knowledge, the accuracy and robustness of knowledge fusion are improved.

[0017] (3) This invention employs an axial attention mechanism to model long-range dependencies between entity pairs with approximately linear computational complexity, overcoming the computational bottleneck of traditional Transformers in long document scenarios; combined with dynamic knowledge query and confidence filtering mechanisms, it further enhances the stability and interpretability of multi-hop reasoning. It effectively reduces noise interference. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating a document-level relation extraction method based on knowledge enhancement and evidence guidance in an embodiment of the present invention.

[0020] Figure 2 This is an overall architecture diagram of a document-level relation extraction system based on knowledge enhancement and evidence guidance, as described in an embodiment of the present invention. Detailed Implementation

[0021] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0023] like Figure 1 As shown in the figure, a document-level relation extraction method based on knowledge enhancement and evidence guidance in an embodiment of the present invention specifically includes the following steps: S1, Obtain the document to be processed, which contains a set of sentences and a set of entities, with each entity corresponding to at least one mention.

[0024] Specifically, the input document D is first encoded using a pre-trained language model (such as BERT or RoBERTa). To clearly identify the boundaries of entity mentions, a special marker "*" is inserted at the beginning and end of each entity mention. Token embeddings are then obtained through the pre-trained language model. and cross-attention matrix The formula is as follows: (1) Where T is the number of document tokens and d is the embedding dimension.

[0025] S2, construct a hierarchical heterogeneous graph and combine coreference parsing to optimize entity semantic representation.

[0026] Specifically, a hierarchical heterogeneous graph structure is constructed based on the encoding results. Nodes include mention nodes, sentence nodes, and document nodes, and edges are divided into five categories: Document-Sentence Edge: Connects a document node to all sentence nodes; Sentence-sentence edge: Connecting adjacent sentences to maintain local continuity; Mentions - Sentence Edges: Associates a mention with the sentence it appears in; Co-occurrence mentions - mention edges: connect mentions within the same sentence; Common reference - reference edge: links references to the same entity.

[0027] The node is initialized as follows: Document node representation Take the embedding as a [CLS] tag; Node reference Take the embedding marked by the asterisk (*) that marks the beginning of the reference; Sentence node representation Logarithmic summation and exponential aggregation using token embedding within the sentence are calculated as follows: (2) in, Let be the aggregate semantic representation of the i-th sentence node. Let be the number of tokens in the i-th sentence. The embedding of the j-th token within the sentence; The importance of edges is calculated using a Graph Attention Network (GAT) as follows: (3) in, This represents a splicing operation. , These are trainable parameters.

[0028] The node representation is then updated after softmax normalization.

[0029] Simultaneously, a pre-trained coreference parsing model (such as coref-spanbert-large) is used to identify coreference pronouns in documents, and attention matrices are used to enhance their semantic representation. The results of coreference parsing complete the semantic connections of the hierarchical heterogeneous graph structure in the form of "coreference mentions-mention edges," concatenating mentions of the same entity scattered across different sentences, avoiding fragmentation of entity representations, and enabling the node representations of the graph structure to integrate entity semantic information across sentences. This achieves a bidirectional enhancement of both the structural integrity of the graph structure and the semantic accuracy of coreference parsing.

[0030] S3: Retrieve knowledge triples of entity pairs from an external knowledge base, filter valid knowledge triples based on a confidence filtering mechanism, and update the entity representation.

[0031] The retrieval of external knowledge base is based on entity nodes in the graph structure after coreference parsing optimization. Knowledge triples are obtained by matching entity names, ensuring the uniqueness of the knowledge retrieval target. The effective knowledge triples selected by the confidence filtering mechanism are then integrated into the hierarchical heterogeneous graph in the form of "knowledge edges", becoming a new semantic connection of the graph structure. This makes the entity representation not only include the context information within the document, but also superimposed the semantic prior of external knowledge.

[0032] Specifically, taking the Wikidata knowledge base as an example, perform the following operations on each entity pair in the graph: The standard identifier of the entity in the knowledge base can be obtained through the getQid(EntityName) interface; use Query the relationship triples between entities; The retrieved valid relationships are added to the graph as new edges to form a knowledge-enhanced graph structure.

[0033] The edge set corresponding to the external knowledge triple satisfies: (4) in, To mention the node, The Qid identifier corresponding to the entity. Relationships within an external knowledge base.

[0035] To reduce noise interference, a confidence filtering mechanism is introduced: For each knowledge edge Calculate the confidence weights The formula is as follows: (5) in, For entities Embedded, For relationship A specific vector, For entities The embedding is defined as follows: i is the embedding dimension index, and d is the embedding dimension.

[0036] The confidence weights are normalized using the sigmoid function and then used to update the entity representation, as shown in the following formula: (6) in, It is the sigmoid activation function. Represents a set of relations. Represents element-wise multiplication. This represents the number of adjacent nodes.

[0037] Only triples with a confidence level above a threshold are retained for subsequent calculations, and finally, the confidence loss is used. To optimize confidence levels and reduce the impact of noise, the formula is as follows: (7) in, Represents the binary cross-entropy function. The total number of candidate relationships. For labeling, The sigmoid activation function is used. The confidence weights for candidate relationships. S4. Calculate the evidence distribution of entity pairs, use the axial attention mechanism for multi-hop reasoning, and obtain the context-enhanced representation of entity pairs.

[0038] The execution of evidence supervision is based on calculating the evidence distribution of entity pairs using the entity representation after document semantic encoding, identifying key sentences supporting relationships. This evidence distribution defines the focus of the axial attention mechanism, enabling it to prioritize entity interactions associated with sentences of high evidence weight when processing high-dimensional entity pair tensors, thus avoiding scattered reasoning. The axial attention mechanism, on the other hand, takes the entity representation of the graph structure and the semantic information fused with external knowledge as input, and achieves multi-hop reasoning across entity pairs through bidirectional row and column self-attention.

[0039] Specifically, for each entity pair The evidence distribution is obtained by aggregating token-level importance. The formula for calculating token-level importance is as follows: (8) in, and Entities and Attention vector, , For element-wise product, It is the dot product of vectors.

[0040] Aggregation yields sentence weight distribution The formula is as follows: (9) Where m represents the starting position of the token and n represents the ending position of the token.

[0041] Evidence supervision is performed using the KL divergence loss function, as shown in the following formula: (10) in, To mark the distribution of evidence, To predict the distribution of evidence. At the same time, the context representation of the generated entity pairs The formula is as follows: (11) Entity pairs The representation of The calculation is as follows:

[0042]

[0043] (12) in, These are trainable parameters.

[0044] Multi-hop reasoning is performed using an axial attention mechanism to obtain context-enhanced representations of entity pairs. This axial attention mechanism performs self-attention computation along both the row and column dimensions of the entity pair tensor, adding residual connections after computation along each dimension. The entity pair tensor has the following dimensions: ( (where d is the maximum number of entities in the dataset and d is the embedding dimension). The row dimension self-attention is calculated as follows: (13) The column-dimensional self-attention calculation method is as follows: (14) Ultimately, enhanced attention is represented as: (15) in, For entity pairs semantic embedding, They are respectively The query vector, key vector, and value vector are obtained through linear projection of a learnable matrix.

[0045] S5 performs end-to-end training on the model based on joint training objectives, which include relation classification loss, knowledge confidence loss, and evidence supervision loss, and outputs entity-relation triples.

[0046] The model adopts an end-to-end joint training approach, incorporating relation classification loss, knowledge confidence loss, and evidence distribution loss into a unified optimization objective, so that parameter optimization of each technical link is no longer carried out independently.

[0047] Specifically, end-to-end training is performed using a weighted joint loss function, and the formula for the joint training objective is as follows: (16) Where λ ranges from 0.02 to 0.1, and β ranges from 0.04 to 0.07. An adaptive threshold loss for relation classification. For knowledge confidence loss, For evidence supervision of losses.

[0048] The relationship classification loss The calculation method is as follows: (17) (18) in, Entity pairs A set of positive and negative relation types. An adaptive threshold for distinguishing between valid and invalid relationships. For relationship The score.

[0049] Experiments show that the methods in the above embodiments outperform existing state-of-the-art methods on both the DocRED and Re-DocRED datasets. The F1 score on the Re-DocRED test set reaches 79.56, which can effectively capture inter-sentence dependencies, suppress knowledge noise, and improve the stability of multi-hop reasoning. It can be widely applied to scenarios such as knowledge graph construction, intelligent question answering, and information retrieval.

[0050] like Figure 2 As shown, corresponding to the document-level relation extraction method based on knowledge enhancement and evidence guidance in the above embodiments, this embodiment of the invention also provides a document-level relation extraction system based on knowledge enhancement and evidence guidance, including: The document acquisition module is used to acquire the document to be processed. The document contains a set of sentences and a set of entities, and each entity corresponds to at least one mention. The document graph enhancement module is used to construct hierarchical heterogeneous graphs based on document semantic encoding and to optimize the semantic representation of entities by combining coreference parsing; The knowledge enhancement module is used to retrieve knowledge triples of entity pairs from an external knowledge base based on the entity nodes in the heterogeneous graph that have been optimized by coreference resolution, filter effective knowledge triples based on a confidence filtering mechanism, and update the entity representation. The evidence-guided reasoning module is used to calculate the evidence distribution of entity pairs based on the entity representation after document semantic encoding, and to perform multi-hop reasoning using an axial attention mechanism based on the evidence distribution to obtain the context-enhanced representation of entity pairs. The axial attention mechanism takes the entity representation of the heterogeneous graph and the semantic information after fusion with external knowledge as input, and realizes multi-hop reasoning across entity pairs through row and column bidirectional self-attention. The training module is used to perform end-to-end training of the model based on joint training objectives, including relation classification loss, knowledge confidence loss, and evidence supervision loss, and outputs entity-relation triples.

[0051] The document-level relation extraction system based on knowledge enhancement and evidence guidance in this embodiment of the invention is described simply because it corresponds to the document-level relation extraction method based on knowledge enhancement and evidence guidance in the above embodiment. For related similarities, please refer to the description of the document-level relation extraction method based on knowledge enhancement and evidence guidance in the above embodiment, which will not be described in detail here.

[0052] The document-level relation extraction method and system based on knowledge enhancement and evidence guidance described in the above embodiments work collaboratively through three core modules: the document graph enhancement module constructs a hierarchical heterogeneous graph that integrates mentions, sentences, and document nodes, and integrates coreference resolution technology to enhance entity semantic representation and cross-sentence association modeling; the knowledge enhancement module retrieves external knowledge bases and introduces a confidence-based dynamic filtering mechanism, effectively suppressing noise interference while introducing external knowledge; and the evidence-guided reasoning module achieves efficient modeling of long contexts and multi-hop logical reasoning through the dual drive of axial attention mechanism and evidence supervision. This effectively solves the technical problems of existing technologies, such as dispersed modeling of reasoning capabilities, high noise in knowledge integration, insufficient evidence guidance, and limited long-range dependency capture.

[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A document-level relation extraction method based on knowledge enhancement and evidence guidance, characterized in that, Includes the following steps: Obtain the document to be processed, which contains a set of sentences and a set of entities, with each entity corresponding to at least one mention; The document to be processed is fed into the encoder for semantic encoding. A hierarchical heterogeneous graph is constructed based on the semantic encoding of the document, and the semantic representation of the entity is optimized by combining coreference resolution. Based on the entity nodes in the heterogeneous graph that have been optimized by coreference resolution, knowledge triples of entity pairs are retrieved from an external knowledge base. Valid knowledge triples are then selected based on a confidence filtering mechanism to update the entity representation. The evidence distribution of entity pairs is calculated based on the entity representation after document semantic encoding. Multi-hop reasoning is performed using the axial attention mechanism based on the evidence distribution to obtain the context-enhanced representation of entity pairs. The axial attention mechanism takes the entity representation of the heterogeneous graph and the semantic information after fusion of external knowledge as input, and realizes multi-hop reasoning across entity pairs through row and column bidirectional self-attention. The model is trained end-to-end based on the joint training objective, and the output is entity-relation triplet.

2. The method according to claim 1, characterized in that, Based on document semantic encoding, a hierarchical heterogeneous graph is constructed, and coreference parsing is combined to optimize the semantic representation of entities, including: The document is encoded using a pre-trained language model to obtain token embeddings and cross-attention matrices; The node types include mention nodes, sentence nodes, and document nodes, and the edge types include document-sentence edges, sentence-sentence edges, mention-sentence edges, co-occurrence mention-mentioned edges, and coreference mention-mentioned edges, forming a hierarchical heterogeneous graph. The importance of edges is calculated using a graph attention network, and the node representation is updated after softmax normalization. A pre-trained coreference parsing model is used to identify coreference pronouns in documents, and an attention matrix is ​​used to enhance their semantic representation.

3. The method according to claim 1 or 2, characterized in that, The coreference parsing uses a pre-trained language model, coref-spanbert-large, and updates the semantic representation of coreference pronouns through an attention matrix, which is a token-level attention weight matrix output by the pre-trained language model.

4. The method according to claim 1, characterized in that, Retrieve knowledge triples of entity pairs from external knowledge bases, including: Obtain the standard identifier of the entity in the knowledge base through the interface of the external knowledge base; Query the triplet relationships between entities and add the retrieved valid relationships as new edges to the graph to form a knowledge-enhanced graph structure.

5. The method according to claim 1, characterized in that, Valid knowledge triples are selected based on a confidence-based filtering mechanism to update entity representations, including: Calculate the confidence weight for each knowledge edge and normalize it using the sigmoid function, retaining only triples with confidence scores higher than the threshold for subsequent calculations. Optimize confidence levels by leveraging trust loss to reduce the impact of noise.

6. The method according to claim 1, characterized in that, The evidence distribution of entity pairs is calculated based on the entity representation after document semantic encoding. Multi-hop reasoning is then performed using an axial attention mechanism based on this evidence distribution to obtain a context-enhanced representation of the entity pairs, including: For each entity pair, token-level importance weights are calculated based on its attention vector and aggregated into a sentence-level evidence distribution; The predicted evidence distribution is constrained by using the KL divergence loss function and the labeled evidence distribution as a supervision signal. Enhanced entity pair representations are generated by fusing contextual information; By employing an axial attention mechanism, self-attention computation is performed along the row and column dimensions of the entity pair tensor to enable multi-hop reasoning, resulting in the final context-enhanced representation.

7. The method according to claim 1, characterized in that, The objectives of the joint training include relation classification loss, knowledge confidence loss, and evidence supervision loss; the relation classification loss adopts an adaptive threshold loss function, which is the threshold for each entity pair to dynamically learn and distinguish between valid and invalid relations.

8. A document-level relation extraction system based on knowledge enhancement and evidence guidance, characterized in that, include: The document acquisition module is used to acquire the document to be processed. The document contains a set of sentences and a set of entities, and each entity corresponds to at least one mention. The document graph enhancement module is used to construct hierarchical heterogeneous graphs based on document semantic encoding and to optimize the semantic representation of entities by combining coreference parsing; The knowledge enhancement module is used to retrieve knowledge triples of entity pairs from an external knowledge base based on the entity nodes in the heterogeneous graph that have been optimized by coreference resolution, filter effective knowledge triples based on a confidence filtering mechanism, and update the entity representation. The evidence-guided reasoning module is used to calculate the evidence distribution of entity pairs based on the entity representation after document semantic encoding, and to perform multi-hop reasoning using an axial attention mechanism based on the evidence distribution to obtain the context-enhanced representation of entity pairs. The axial attention mechanism takes the entity representation of the heterogeneous graph and the semantic information after fusion with external knowledge as input, and realizes multi-hop reasoning across entity pairs through row and column bidirectional self-attention. The training module is used to perform end-to-end training of the model based on the joint training objective and output entity-relation triples.