Document-level Relation Extraction Method and System Based on Heuristic Evidence Sentence Extraction and Entity Representation Enhancement

By using heuristic evidence sentence extraction and entity representation enhancement methods at the document level, the problem of cross-sentence entity relationship extraction is solved, more accurate entity representation and relationship prediction is achieved, and the performance of document-level relationship extraction is improved.

CN115526162BActive Publication Date: 2025-06-24Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211212489.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2025-06-24
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

The prior art is difficult to effectively extract entity relationship facts across statements at the document level, and traditional methods are prone to introduce noise information when processing long text, affecting the relationship prediction performance of the model.

Method used

Using a method based on heuristic evidence sentence extraction, evidence sentences related to the target entity are extracted from the original document through predefined rules and constructed into pseudo-document. The pre-trained language model is used to learn context information, enhance entity representation, and thus relationship prediction is performed.

Benefits of technology

It effectively reduces the introduction of model noise, improves the accuracy of entity representation, improves the performance of document-level relationship extraction, and reduces the complexity of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115526162B_ABST
    Figure CN115526162B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of natural language processing, and particularly relates to a document-level relation extraction method and system based on heuristic evidence sentence extraction and entity representation enhancement. First, according to predefined heuristic rules, mentions in the original document that interact with the head and tail entities of the target entity pair are selected, the sentences where the entity mentions are located are used as the evidence sentences for the target entity pair, and the evidence sentences are constructed into a pseudo-document in the order of the original document; a pre-trained language model is used to learn the context information related to the target entity pair in the pseudo-document; the mentions of the head and tail entities interacting with the target entity pair and the relevant context are used to learn different entity representations of the same entity in different entity pairs; for different entity representations, an activation function is used to predict the relation type of the target entity pair. The present invention uses simple predefined rules to extract the evidence sentences for entity relation prediction and constructs them into a pseudo-document in the order of the original document, reducing the complexity of entity relation prediction and improving the performance of document-level relation extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of natural language processing, and particularly relates to a document-level relation extraction method and system based on heuristic evidence sentence extraction and entity representation enhancement. Background Art

[0002] As an important part of information extraction tasks, relation extraction is an important research direction in the field of natural language processing and has been widely applied to downstream natural language processing tasks such as information retrieval, question answering systems, and dialogue systems. Most of the previous relation extraction models focused on the sentence level, that is, mainly identifying the relation facts of two target entities involved in a single sentence, and unable to identify the relation facts of two target entities involved in long texts, especially cross-sentences. However, in actual application scenarios, a document often contains a large number of relation facts, and these relation facts are expressed through multiple sentences. Statistics show that at least 40% of the relation facts in Wikipedia data need to be obtained by combining multiple sentences, which obviously exceeds the scope that traditional sentence-level relation extraction methods can handle. Therefore, it is necessary to extend the relation extraction task from the sentence level to the document level.

[0003] Compared with sentence-level relation extraction, document-level relation extraction usually requires reasoning by combining the context semantic information of multiple sentences in a document. However, the text of a document is often longer and the context is more complex. Not all sentences are relevant to the relation prediction of the target entity pair. These irrelevant sentences may make the input sequence longer than the maximum length that the model can handle, resulting in the model being difficult to comprehensively and accurately learn the entity context information. At the same time, an entity may have multiple mentions in a document, but some mentions may also be irrelevant to the entity pair relation prediction. Therefore, when integrating various document information, irrelevant information may be introduced as noise, making it difficult for the model to accurately represent the entity, thus affecting the relation prediction performance of the model.

[0004] The existing solution strategies using the document-level relation extraction method of evidence sentences pay more attention to the context information relevant to the entity pair relation prediction. Briefly speaking, the existing research can be generally considered to start from two perspectives: one is to implicitly extract evidence sentences using a neural network model, but the above process of extracting evidence sentences is relatively complex and requires training the extraction model, which not only increases the training difficulty of the relation prediction model but also increases unnecessary GPU computing overhead; the other is to explicitly extract evidence sentences using heuristic rules. Although the above research can enable the model to pay more attention to the context information relevant to the entity relation prediction to a certain extent, it still needs to use the whole document to predict the entity relation type. Summary of the Invention

[0005] To this end, the present invention provides a document-level relation extraction method and system based on heuristic evidence sentence extraction and entity representation enhancement, which uses simple predefined rules to extract evidence sentences for entity relation prediction, constructs them into a pseudo-document in the original document order, reduces the complexity of entity relation prediction, and improves the performance of document-level relation extraction.

[0006] According to the design solution provided by the present invention, a document-level relation extraction method based on heuristic evidence sentence extraction and entity representation enhancement is provided, which includes the following contents:

[0007] Select mentions in the original document that interact with the head and tail entities of the target entity pair according to predefined heuristic rules, use the sentence where the entity mention is located as the evidence sentence for the target entity pair, and construct the evidence sentences into a pseudo-document in the original document order;

[0008] Use a pre-trained language model to learn the context information related to the target entity pair in the pseudo-document;

[0009] Use the mentions of the head and tail entities interacting with the target entity and the relevant context to learn different entity representations of the same entity in different entity pairs;

[0010] For different entity representations, use an activation function to predict the relation type of the target entity pair.

[0011] As the document-level relation extraction method based on heuristic evidence sentence extraction and entity representation enhancement in the present invention, further, set predefined heuristic rules according to the interaction between different mentions of the head and tail entities in the entity pair, use the predefined heuristic rules to extract the interaction between entities within and between sentences in the original document, and select the evidence sentences for the target entity pair according to the interaction.

[0012] As the document-level relation extraction method based on heuristic evidence sentence extraction and entity representation enhancement in the present invention, further, the predefined heuristic rules include but are not limited to: intra-sentence interaction, bridge entity interaction, adjacent interaction, combined interaction, and default interaction. Among them, intra-sentence interaction means that the head and tail entities of the target entity pair are mentioned in the same evidence sentence, bridge entity interaction means that the corresponding mentions of the head and tail entities in the target entity pair appear in different evidence sentences and are connected by a common bridge entity in the evidence sentence, adjacent interaction means the connection between the mentions of the head and tail entities of the target entity pair in the evidence sentence and the entity mentions in its previous and subsequent sentences, combined interaction means the combination of intra-sentence interaction, bridge entity interaction, and adjacent interaction or any two of the three, and default interaction means the combination of the sentence set where the head entity mention of the target entity pair is located and the sentence set where the tail entity mention is located as the entity connection of the evidence sentence.

[0013] As the document-level relation extraction method based on heuristic evidence sentence extraction and entity representation enhancement in the present invention, further, when constructing a pseudo-document based on evidence sentences, entity pairs of the same evidence sentence are combined and the pseudo-document is constructed in the original document order.

[0014] As the document-level relation extraction method based on heuristic evidence sentence extraction and entity representation enhancement in the present invention, further, in the pre-trained language model, the encoder encodes the input pseudo-document to obtain the context embedding representation of each word in the pseudo-document, and the attention mechanism is used to adjust the context related to the target entity pair in the model output.

[0015] As the document-level relation extraction method based on heuristic evidence sentence extraction and entity representation enhancement in the present invention, further, the structure of the pre-trained language model adopts the BERT model structure, and the BERT model structure is pre-trained using the manually annotated dataset DocRED.

[0016] Further, the present invention also provides a document-level relation extraction system based on heuristic evidence sentence extraction and entity representation enhancement, including: an evidence sentence extraction module, an encoding module, an entity enhancement module, and a relation prediction module, where,

[0017] The evidence sentence extraction module is used to select mentions in the original document that interact with the head and tail entities of the target entity pair according to predefined heuristic rules, take the sentence where the entity mention is located as the evidence sentence of the target entity pair, and construct a pseudo-document from the evidence sentences in the original document order;

[0018] The encoding module is used to learn the context information related to the target entity pair in the pseudo-document using the pre-trained language model;

[0019] The entity enhancement module is used to learn different entity representations of the same entity in different entity pairs using the mentions and relevant context of the interaction between the head and tail entities of the target entity pair;

[0020] The relation prediction module is used to predict the relation type of the target entity pair using an activation function for different entity representations.

[0021] Advantages of the present invention:

[0022] Considering the situations where the distance between entities in sentences in a document is far, information unrelated to the relation prediction of the target entity pair may be introduced, and the accuracy of model prediction is reduced, etc., the present invention uses the evidence sentences required for target entity prediction as the text input of the model, which can reduce the introduction of model noise and increase the interpretability of the model at the same time; by obtaining different representations of the same entity in different entity pairs according to the mentions and context information related to the relation prediction of the target entity pair, the entity representation can be further enhanced, the entity can be represented more accurately, the entity prediction complexity can be reduced, and the relation extraction performance can be improved. Description of the Drawings

[0023] Figure 1 It is a schematic diagram of the document-level relationship extraction process in the embodiment;

[0024] Figure 2 It is a schematic diagram of the principle framework of document-level relationship extraction in the embodiment;

[0025] Figure 3 It is a schematic diagram of the description of the interaction type between the head and tail entities of the target entity in the document in the embodiment. Detailed Implementation Manner

[0026] To make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the drawings and technical solutions.

[0027] Aiming at the problem that when using the entire document for relationship extraction in the field of natural language processing, the input text of traditional algorithms or deep learning models is too long and the training complexity is relatively high. In the embodiments of the present invention, referring to Figure 1 as shown, a document-level relationship extraction method based on heuristic evidence sentence extraction and entity representation enhancement is provided, including:

[0028] S101. Select the mentions in the original document that interact with the head and tail entities of the target entity according to predefined heuristic rules, use the sentence where the entity mention is located as the evidence sentence of the target entity pair, and construct a pseudo-document from the evidence sentences in the order of the original document;

[0029] S102. Use a pre-trained language model to learn the context information related to the target entity pair in the pseudo-document;

[0030] S103. Use the mentions of the interaction between the head and tail entities of the target entity and the relevant context to learn different entity representations of the same entity in different entity pairs;

[0031] S104. For different entity representations, use an activation function to predict the relationship type of the target entity pair.

[0032] In the embodiments of this case, it is not necessary to use the entire document. Only by extracting some sentences as evidence sentences through the interaction between entities, redundant sentences for entity relationship prediction in the document can be removed, the influence of the distance between entities on the entity pair relationship prediction can be reduced, and at the same time, the complexity of model training can be reduced, thereby improving the prediction performance of the entity pair relationship type.

[0033] As a preferred embodiment, further, predefined heuristic rules are set according to the interaction between different mentions of the head and tail entities in the entity pair, the predefined heuristic rules are used to extract the interaction between entities within and between sentences in the original document, and the evidence sentences of the target entity pair are selected according to the interaction.

[0034] See Figure 2 As shown, for the interaction features between entities in the document, heuristic rules are formulated based on the interactions between different mentions of the head and tail entities of the entity. Based on this, evidence sentences are extracted to remove noise sentences and enhance the interpretability of the model. Then, the evidence sentences are constructed into a pseudo-document in the order of the original document, and the entities are better represented according to the mentions and relevant contexts of the head and tail entities interacting with the target entity pair, so as to more accurately predict the relational facts of the target entity pair.

[0035] Furthermore, the predefined heuristic rules include but are not limited to: intra-sentence interaction, bridge entity interaction, adjacent interaction, combined interaction, and default interaction. Among them, intra-sentence interaction means that the mentions of the head and tail entities of the target entity pair are in the same evidence sentence; bridge entity interaction means that the corresponding mentions of the head and tail entities in the target entity pair appear in different evidence sentences and are connected through a common bridge entity in the evidence sentences; adjacent interaction means the connection between the mentions of the head and tail entities of the target entity pair in the evidence sentence and the entity mentions in its previous and next sentences; combined interaction means the combination of intra-sentence interaction, bridge entity interaction, and adjacent interaction, or any two of the three; default interaction means the combination of the sentence set where the mention of the head entity of the target entity pair is located and the sentence set where the mention of the tail entity is located as the entity connection of the evidence sentence.

[0036] See Figure 3 As shown, through the five interaction methods of predefined intra-sentence interaction, bridge entity interaction, adjacent interaction, combined interaction, and default interaction, the interactions between intra-sentence and inter-sentence entities in the text are extracted, and the sentence where the entity mention is located is used as the evidence sentence.

[0037] In intra-sentence interaction, there may be a certain connection between entity mentions that appear in the same sentence in the document. Therefore, we model their interaction through this method and use this sentence as its evidence sentence. Formally, for the head entity e h and the tail entity e t of the target entity pair, both are in the sentence s ht , and its evidence sentence is {s ht}.

[0038] In bridge entity interaction, different entity mentions that appear in different sentences can be connected through a common entity in their respective sentences, that is: the bridge entity models their interaction. Formally, for the head entity e h and the tail entity e t of the target entity pair and its bridge entity e b exist in s hb and s bt respectively. In our model, bridge entity interaction includes the case of one bridge entity. For entity pairs with multiple bridge entities, we will regard them as combined paths.

[0039] In adjacent interaction, some sentences in the document have no common entities with other sentences, and they cannot be connected using bridge entities. However, entities in the document cannot exist alone without other entities. Therefore, we attempt to connect the entity mentions in this sentence with those in the previous or subsequent sentences. Formally, the head entity e in the target entity pair h in sentence s h , and the tail entity e t in sentence s t . Its evidence sentences are represented as {s hb , s bt}. t=h+1 or h-1 . Note that the entities in s h and s t cannot interact through bridge entities.

[0040] In combined interaction, for entities that are far apart in the document, a single interaction method cannot be used to model them. Therefore, a combination of the above methods is used to model their interaction. Formally, the head and tail entities e h , e t in the target entity pair are in s h and s t respectively, and the intermediate interaction entities e b1 , e b2 , …, e bk exist in s hb , s b* , …, s hb respectively. Its evidence sentences are {s hb , s bb , …, s bt}. Note that e b* can be different mentions of adjacent entities, bridge entities, or other entities.

[0041] In default interaction, when none of the above situations apply, we use the sentences where the target head and tail entities and the corresponding mentions of bridge entities in the document are located as their evidence sentences. Formally, if the head entity e h appears in the set {s h1 , s h2 , …, s hk} respectively, and the tail entity e t is in the set {s t1 , s t2 , …, s tk}, then the combination of the sets is their evidence sentence.

[0042] As a preferred embodiment, further, when constructing a pseudo-document based on the evidence sentences, the entity pairs with the same evidence sentences are combined and the pseudo-document is constructed in the order of the original document.

[0043] Each entity pair has its corresponding evidence sentence, and there may be the same evidence sentences for different entity pairs in the document. To reduce the training time of the model, we combine the entity pairs with the same evidence sentence into a pseudo-document, and then feed it into the pre-trained language model to encode the pseudo-document to obtain the context embedding representation of each word.

[0044] Furthermore, in the pre-trained language model, the encoder is used to encode the input pseudo-document to obtain the context embedding representation of each word in the pseudo-document, and the attention mechanism is used to adjust the context related to the target entity pair in the model output.

[0045] Use the internal attention probability of the preprocessing language model to obtain the context information related to the head and tail entities in the evidence sentence, and add it as the global context of the entity pair in the pseudo-document to the entity representation to further enhance the entity representation and improve the accuracy of model prediction. Select an appropriate activation function to predict the relationship type of the target entity pair according to the entity representation.

[0046] As a preferred embodiment, further, the structure of the pre-trained language model adopts the BERT model structure, and the BERT model structure is pre-trained using the manually annotated dataset DocRED.

[0047] In model selection, the existing classic preprocessing language model BERT is used, and the classic manually annotated dataset DocRED is used as the dataset. The dataset used contains 5053 Wikipedia documents, 96 relationship types, 132375 entities and 56554 entity relationship facts, which is the largest existing manually annotated document-level relation extraction dataset. In addition to the manually annotated data, the dataset also contains 101873 document remote supervision data, and at the same time, the dataset also provides data such as entity mentions, entity types, relationship facts and corresponding supporting evidence.

[0048] Use the mentions and related contexts of the head and tail entities of the target entity pair to learn different entity representations of the same entity in different entity pairs to represent entity information more accurately.

[0049] The document-level relation extraction algorithm can be designed as follows:

[0050]

[0051]

[0052] Based on Figure 2 the principle framework shown, in the implementation of a specific system or example, it can be constructed and designed through a modular method, mainly including the evidence sentence extraction module and processing flow shown in Figure 3 which includes five interaction methods: intra-sentence interaction, bridge entity interaction, adjacent interaction, combination interaction and default interaction.

[0053] In the practical application of natural language data analysis and processing, by analyzing the text data length, interactions between entities, vector representations, and relationship prediction tasks, a deep learning network model for text data analysis is selected; and the above-mentioned document-level relationship extraction method based on heuristic evidence sentence extraction and entity representation enhancement is adopted to judge the entity relationship type based on heuristic rules and extraction of entity evidence sentences in the complex context of the document. By analyzing and obtaining features such as text entity interaction methods, representation modes, dimensions, and predefined relationship types, on this basis, a suitable model is selected. For example, for natural language processing data such as text, information such as the length of the text, the subject area, whether there is already a vector representation, and the analysis tasks to be completed needs to be analyzed, and accordingly, a recurrent network, a Transformer architecture, or a deep learning model such as Bert suitable for text data analysis is selected for analysis. On the basis of the labeled dataset Doucment in the complex context train Based on this, target entity pair evidence sentences are selected according to predefined rules, and based on this, their relationship types are predicted. According to the characteristics of the data to be analyzed, the parameters and hyperparameters of the selected model during pre-training and fine-tuning learning are reasonably designed and configured. For example, structural parameters such as the number of network layers, the number of nodes, and the parameter initialization method, as well as the configuration of hyperparameters such as the learning rate, the optimization algorithm, the loss function, and the number of training epochs. Some of the main parameters and descriptions are shown in Table 1; when the labeled document sample set is very small and the model parameters are numerous, in order to prevent premature overfitting, the network structure of the model can be compressed, pruned, etc.; on this basis, the pre-trained language model is fine-tuned.

[0054] Table 1. Some hyperparameters that need to be configured in model training and learning

[0055]

[0056]

[0057] Furthermore, based on the above method, the embodiment of the present invention also provides a document-level relationship extraction system based on heuristic evidence sentence extraction and entity representation enhancement, including: an evidence sentence extraction module, an encoding module, an entity enhancement module, and a relationship prediction module, where,

[0058] The evidence sentence extraction module is used to select the mentions in the original document that interact with the head and tail entities of the target entity pair according to predefined heuristic rules, use the sentences where the entity mentions are located as the evidence sentences of the target entity pair, and construct a pseudo-document with the evidence sentences in the order of the original document;

[0059] The encoding module is used to use the pre-trained language model to learn the context information related to the target entity pair in the pseudo-document;

[0060] An entity enhancement module is used for the mention of the head and tail entity interaction of the target entity and the relevant context, and learns different entity representations of the same entity in different entity pairs;

[0061] A relationship prediction module is used to predict the relationship type of the target entity pair by using an activation function for different entity representations.

[0062] Unless otherwise specifically stated, the relative steps, numerical expressions, and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present invention.

[0063] Based on the above system, an embodiment of the present invention further provides a server, including: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the above system.

[0064] Based on the above system, an embodiment of the present invention further provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, the above system is implemented.

[0065] The device provided by the embodiment of the present invention has the same implementation principle and the same technical effects as those of the foregoing system embodiment. For the sake of brief description, for the parts not mentioned in the device embodiment, reference may be made to the corresponding content in the foregoing system embodiment.

[0066] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described system and device can refer to the corresponding processes in the foregoing system embodiment, and will not be described herein again.

[0067] In all the examples shown and described here, any specific value should be construed as merely exemplary, rather than as a limitation. Therefore, other examples of the exemplary embodiments may have different values.

[0068] It should be noted that: like reference numerals and letters denote like items in the following figures, and thus, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0069] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of code, or a part thereof, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or by a combination of dedicated hardware and computer instructions.

[0070] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the couplings, direct couplings, or communication connections shown or discussed among each other may be through some communication interfaces. The indirect couplings or communication connections of the devices or units may be in electrical, mechanical, or other forms.

[0071] In addition, each functional unit in various embodiments of the present invention may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0072] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the systems described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0073] Finally, it should be noted that the above-described embodiments are only specific implementation manners of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that any person skilled in the technical field of the present invention can still modify the technical solutions described in the foregoing embodiments, or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A document-level relation extraction method based on heuristic evidence sentence extraction and entity representation enhancement, characterized in that It includes the following content: Select the mentions in the original document that interact with the head and tail entities of the target entity pair according to predefined heuristic rules, use the sentence where the entity mention is located as the evidence sentence of the target entity pair, and construct a pseudo-document with the evidence sentences in the order of the original document; the predefined heuristic rules include but are not limited to: intra-sentence interaction, bridge entity interaction, adjacent interaction, combined interaction, and default interaction. Among them, intra-sentence interaction means that the head and tail entities of the target entity pair are mentioned in the same evidence sentence, bridge entity interaction means that the corresponding mentions of the head and tail entities in the target entity pair appear in different evidence sentences and are connected through the common bridge entity in the evidence sentences, adjacent interaction means the connection between the mentions of the head and tail entities of the target entity pair in the evidence sentence and the entity mentions in its previous and next sentences, combined interaction means the combination of intra-sentence interaction, bridge entity interaction, and adjacent interaction or any two of the three, and default interaction means the combination of the sentence set where the head entity mention of the target entity pair is located and the sentence set where the tail entity mention is located as the entity connection of the evidence sentence; Use a pre-trained language model to learn the context information related to the target entity pair in the pseudo-document; the structure of the pre-trained language model adopts the BERT model structure, and the BERT model structure is pre-trained using the manually annotated dataset DocRED; Use the mentions of the interaction between the head and tail entities of the target entity and the relevant context to learn different entity representations of the same entity in different entity pairs; For different entity representations, use an activation function to predict the relationship type of the target entity pair.

2. The method for document-level relation extraction based on heuristic evidence sentence extraction and entity representation enhancement according to claim 1, wherein Set predefined heuristic rules according to the interaction between different mentions of the head and tail entities in the entity pair, use the predefined heuristic rules to extract the interaction between intra-sentence and inter-sentence entities in the original document, and select the evidence sentences of the target entity pair according to the interaction.

3. The method for document-level relation extraction based on heuristic evidence sentence extraction and entity representation enhancement according to claim 1, wherein When constructing the pseudo-document based on the evidence sentences, combine the entity pairs of the same evidence sentence and construct the pseudo-document in the order of the original document.

4. The method for document-level relation extraction based on heuristic evidence sentence extraction and entity representation enhancement according to claim 1, characterized in that In the pre-trained language model, encode the input pseudo-document through an encoder to obtain the context embedding representation of each word in the pseudo-document, and use the attention mechanism to adjust the context related to the target entity pair in the model output.

5. A document-level relation extraction system based on heuristic evidence sentence extraction and entity representation enhancement, characterized in that, It includes: an evidence sentence extraction module, an encoding module, an entity enhancement module, and a relationship prediction module, where An evidence sentence extraction module, configured to select mentions in the original document that interact with the head and tail entities of the target entity pair according to predefined heuristic rules, use the sentences where the entity mentions are located as the evidence sentences of the target entity pair, and construct a pseudo-document from the evidence sentences in the order of the original document; the predefined heuristic rules include but are not limited to: intra-sentence interaction, bridge entity interaction, adjacency interaction, combined interaction, and default interaction. Among them, intra-sentence interaction means that the head and tail entities of the target entity pair are mentioned in the same evidence sentence; bridge entity interaction means that the corresponding mentions of the head and tail entities in the target entity pair appear in different evidence sentences and are connected by a common bridge entity in the evidence sentences; adjacency interaction means the connection between the mentions of the head and tail entities of the target entity pair in the evidence sentence and the entity mentions in its previous and next sentences; combined interaction means the combination of intra-sentence interaction, bridge entity interaction, and adjacency interaction, or any two of the three; default interaction means the combination of the set of sentences where the head entity mention of the target entity pair is located and the set of sentences where the tail entity mention is located as the entity connection of the evidence sentence. An encoding module, configured to use a pre-trained language model to learn the context information related to the target entity pair in the pseudo-document; the structure of the pre-trained language model adopts the BERT model structure, and the BERT model structure is pre-trained using the manually annotated dataset DocRED. An entity enhancement module, configured to learn different entity representations of the same entity in different entity pairs by using the mentions and related contexts of the interaction between the head and tail entities of the target entity. A relationship prediction module, configured to use an activation function to predict the relationship type of the target entity pair for different entity representations.

6. An electronic device, comprising a memory and a processor, wherein, The memory stores executable code, and when the processor executes the executable code, the method described in any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium having a computer program stored thereon, wherein, When the computer program is executed on a computer, the computer is made to execute the method described in any one of claims 1 to 4.