Document-level entity relationship extraction method and device based on hypergraph convolutional neural network

By using the hypergraph convolutional neural network (HG-GCNN) model in document-level entity relationship extraction, the hypergraph structure is constructed and learned, and the problem of difficulty in obtaining global information in the existing technology is solved, and more accurate entity relationship extraction is achieved.

CN114118088BActive Publication Date: 2025-04-15CAPITAL NORMAL UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111241687.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-25
Publication Date
2025-04-15
Estimated Expiration
2041-10-25

AI Technical Summary

Technical Problem

The prior art is difficult to obtain global information in document-level entity relationship extraction, resulting in inaccurate extraction.

Method used

Using a method based on hypergraph convolutional neural network (HG-GCNN), the hypergraph structure is constructed and learned through the node information construction layer, the hypergraph structure layer, the GCNN encoding layer and the inference judgment layer, so as to obtain the vector representation of each word in the document in the entity pair, and realize the accurate classification of entity relationships.

Benefits of technology

By constructing hypergraph structures with different granularity, the HG-GCNN model can learn entity relationships in documents more accurately, improving the accuracy of document-level entity relationship extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114118088B_ABST
    Figure CN114118088B_ABST
Patent Text Reader

Abstract

The present invention relates to a document-level entity relationship extraction method and device based on a hypergraph convolutional neural network. The method comprises: for a triple, using an HG-GCNN model to obtain a hypergraph structure corresponding to the triple; for the hypergraph structure, obtaining the vector of the word under each entity in an entity pair of a relationship to be predicted for each word in a document t; based on the vector of the word under each entity in the entity pair of a relationship to be predicted for each word in the document, obtaining the entity relationship between a first entity e1 and a second entity e2; the HG-GCNN model is a pre-established and trained model including a node information construction layer, a hypergraph construction layer, a GCNN encoding layer, and an inference judgment layer; the node information construction layer and the hypergraph construction layer execute a process of obtaining the hypergraph structure, the GCNN encoding layer executes a process of obtaining the vector of the word under each entity for each word in the document, and the inference judgment layer executes a process of obtaining a prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of artificial intelligence natural language processing, and in particular to a document-level entity relationship extraction method and device based on a hypergraph convolutional neural network. Background Art

[0002] With the popularization of artificial intelligence in the field of natural language processing, machine translation, paragraph understanding, knowledge graphs, etc. have become hot research topics. Research in these fields relies on an important research object: entity relationship extraction, that is, mining the relationship information of entity pairs from documents. The significance of entity relationship extraction is mainly reflected in: the results of entity relationship extraction can be used to automatically expand and build knowledge graphs, providing users with a knowledge base for retrieving information. The results of entity relationship extraction can be used as a data source for building automatic question-answering systems, and can also provide theoretical support for machine translation and paragraph understanding. The complexity of document-level entity relationship extraction is much greater than that of sentence-level entity relationship extraction. The main research difficulties currently faced are mainly reflected in the following aspects: the diversity of language expression brings great difficulty to the identification of entities in document-level entity relationship extraction; in the process of entity relationship extraction at the paragraph level, the number of citations is often greater. How to associate the connection between these citations and avoid the noise influence between different citations of the same entity is one of the pain points of the research. The complexity of the chapter structure makes it very difficult to understand the chapter in document-level entity relationship extraction. Due to the complex writing techniques and expressions of the article, the connections between entities are often throughout the context of the article. How to effectively use the model to express the chapter structure of the document is another pain point in the research.

[0003] There are two main types of traditional relation extraction models. One is the sequence-based relation extraction model: modeling relations based on the sequence relationship of words; the other is the dependency-based relation extraction model: modeling entity relations based on relation dependencies.

[0004] The sequence-based relation extraction method extracts features of different levels through networks of different levels, and finally classifies the relationships between entity pairs by associating features of different levels. That is, different models are used for intra-sentence and inter-sentence relationships, and entity relationships are predicted by combining local and global feature information. An existing method uses CNN to encode intra-sentence information, and uses maximum entropy to encode and integrate information between sentences, using a divide-and-conquer approach to handle features of different levels. However, this method breaks up the document structure, and how to use a unified model to solve the intra-sentence and inter-sentence relationships in document extraction has become a major difficulty in research.

[0005] In the prior art, LSTM is used to encode the relationship between long texts and unify the structure of the model. The original text is regarded as a sequence, and its structure is encoded through the long short-term memory network, and the important information of the sentence is extracted through the attention mechanism. Although this approach takes into account the intra-sentence and inter-sentence connections, it does not embed the dependencies between texts, has certain limitations, and has too many parameters. The gradient disappearance problem often occurs during training, and the model effect is relatively poor. Summary of the invention

[0006] 1. Technical issues to be resolved

[0007] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a document-level entity relationship extraction method and device based on a hypergraph convolutional neural network, which solves the technical problem that the prior art only considers a single document graph structure and may not be able to obtain complete global information, resulting in inaccurate document-level entity relationship extraction.

[0008] (II) Technical solution

[0009] In order to achieve the above object, the main technical solutions adopted by the present invention include:

[0010] In a first aspect, an embodiment of the present invention provides a document-level entity relationship extraction method based on a hypergraph convolutional neural network, comprising:

[0011] S1. For a triple, use the HG-GCNN model to obtain a hypergraph structure corresponding to the triple;

[0012] The triplet includes: document t;

[0013] A first entity e1 and a second entity e2 in the document t whose relationship is to be predicted;

[0014] Where document t contains n words;

[0015] There are at least 2 entities in the n words;

[0016] S2. For the hypergraph structure, obtain the vector of each word in the document t for each entity in the entity pair of the relationship to be predicted;

[0017] S3, based on the vectors of the words under each entity in the entity pair of the relationship to be predicted for each word in the document, obtaining the entity relationship between the first entity e1 and the second entity e2;

[0018] The HG-GCNN model is a pre-established and trained model including a node information construction layer, a hypergraph construction layer, a GCNN encoding layer, and an inference judgment layer;

[0019] The node information construction layer and the hypergraph construction layer execute the process of obtaining the hypergraph structure, the GCNN encoding layer executes the process of obtaining the vector of each word under each entity in the document, and the reasoning and judgment layer executes the process of obtaining the prediction result.

[0020] Preferably, S1 specifically includes:

[0021] The node information construction layer of the HG-GCNN model obtains the node information of the graph structure according to the distances of the words in each paragraph in the document t in the triple from the first entity e1 and the second entity e2 respectively;

[0022] The hypergraph construction layer of the HG-GCNN model constructs a hypergraph structure for document t using a pre-set composition strategy.

[0023] Preferably,

[0024] The node information construction layer of the HG-GCNN model obtains the node information of the graph structure according to the distances of the words in each paragraph in the document t in the triple from the first entity e1 and the second entity e2, specifically including:

[0025] For any paragraph in the document t in the triple, determine whether the paragraph has a reference to the first entity e1. If not, determine that the importance of each word in the paragraph to the first entity e1 is 0; if yes, construct a set of hyperedges between any word in the paragraph and all the references to the first entity e1 in the paragraph, and the importance of any word in the paragraph to the first entity e1 is the sum of the reciprocals of the distances between any word in the paragraph and all the references to the first entity e1 in the paragraph;

[0026] For any paragraph in the document t in the triple, determine whether the paragraph has a reference to the second entity e2. If not, determine that the importance of each word in the paragraph to the second entity e2 is 0; if yes, construct a set of hyperedges between any word in the paragraph and all the references to the second entity e2 in the paragraph, and the importance of any word in the paragraph to the second entity e2 is the sum of the reciprocals of the distances between any word in the paragraph and all the references to the second entity e2 in the paragraph;

[0027] The importance of any word in any paragraph in the document t in the triple to the first entity e1 and the second entity e2 is used as the information of the node corresponding to the any word.

[0028] Preferably, the hypergraph construction layer of the HG-GCNN model adopts a pre-set composition strategy to construct a hypergraph structure, specifically including:

[0029] The hypergraph structure includes: grammatical edges, reference edges, adjacent word edges, neighbor edges, and reflexive edges;

[0030] The grammatical edge is: a hyperedge connecting any word in each sentence in document t and a word with a grammatical association relationship;

[0031] The reference edge is: a set of hyperedges constructed by entities in document t and their corresponding references;

[0032] The neighboring word edge is: for each sentence in the document t, the hyperedge constructed by the words in the sentence;

[0033] The adjacent sentence edge is: for each paragraph in the document t, a set of hyperedges constructed by all entities in the paragraph;

[0034] The reflexive edge is: each word in document t is associated with its own hyperedge;

[0035] Wherein, in the hypergraph structure, the relationship value between any hyperedge and a word associated with the hyperedge is set to 1, and the relationship value between any hyperedge and a word not associated with the hyperedge is set to 0.

[0036] Preferably, S2 specifically includes:

[0037] The GCNN encoding layer of the HG-GCNN model learns the hypergraph structure and obtains the vector representation of the word corresponding to each node in the hypergraph structure under the first entity e1 and the vector representation under the second entity e2

[0038] Preferably, the GCNN encoding layer of the HG-GCNN model learns the hypergraph structure to obtain the vector representation of the word corresponding to each node in the hypergraph structure under the first entity e1. and the vector representation under the second entity e2 Specifically include:

[0039] The GCNN encoding layer of the HG-GCNN model generates bias parameters and hyperedge weights for the hypergraph structure;

[0040] Each layer of the GCNN encoding layer of the HG-GCNN model learns the hypergraph structure. Based on the hypergraph structure and the node information, the information of the neighboring nodes of each node in the hypergraph structure is interacted with the information of the node using formula (1), and the bias parameters and hyperedge weights of the words corresponding to each node are iteratively updated to generate new bias parameters and hyperedge weights. Finally, the vector representation of the words corresponding to each node after the k layers of the GCNN encoding layer under the first entity e1 is obtained. and the vector table under the second entity e2 is not

[0041] Formula (1) is:

[0042]

[0043] in, is the i-th word w in the hypergraph structure obtained from the k-th layer of the GCNN encoding layer i The vector representation of the word w i The vector representation under the first entity e1 is and the vector representation under the second entity e2

[0044] v(i) is the i-th word w in the hypergraph structure i The neighbor nodes of the word are all the nodes of the hyperedges connected in series with the word;

[0045] and are the weight and bias parameters of the hyperedge of the k-1th layer with hyperedge type l between node i and node u in the hypergraph structure;

[0046] l is any type of hyperedge among grammatical edge, reference edge, adjacent word edge, neighbor edge, and reflexive edge.

[0047] Preferably,

[0048] The GCNN encoding layer of the HG-GCNN model is based on the hypergraph structure, and further obtains the hyperedge value of each hyperedge in the hypergraph structure;

[0049] The hyperedge value is a product of a preset bias parameter plus a weight of the hyperedge and the sum of node information corresponding to each word associated with the hyperedge.

[0050] Preferably, S3 specifically includes:

[0051] S31, the reasoning judgment layer of the HG-GCNN model obtains the confidence score matrix S between the first entity e1 and the second entity e2 through the fully connected layer 12 ;

[0052] The confidence score matrix S 12 Each position in corresponds to a preset entity relationship type;

[0053] in,

[0054] S 12 =(Embedding 1 R)Embedding2 ;

[0055] Wherein, R is the parameter matrix of the fully connected layer after pre-training using the classification method of multiple instance learning;

[0056] Embedding 1 is a matrix composed of vector representations of all words in the hypergraph structure under the first entity e1 obtained by the kth layer of the GCNN encoding layer;

[0057] Embedding 2 is a matrix composed of vector representations of all words in the hypergraph structure under the second entity e2 obtained by the kth layer of the GCNN encoding layer;

[0058] S32, according to the confidence score matrix S 12 and the confidence score matrix S 12 Each position in the is corresponding to a preset entity relationship type to determine the entity relationship between the first entity e1 and the second entity e2.

[0059] Preferably, the S32 specifically includes:

[0060] The confidence score matrix S 12 The preset entity relationship type corresponding to the position with the maximum value among all the positions in is used as the entity relationship between the first entity e1 and the second entity e2.

[0061] On the other hand, this embodiment also provides a document-level entity relationship extraction device based on a hypergraph convolutional neural network, the device comprising:

[0062] at least one processor; and

[0063] At least one memory communicatively connected to the processor, wherein the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute any of the above-mentioned document-level entity relationship extraction methods based on hypergraph convolutional neural networks.

[0064] (III) Beneficial effects

[0065] The beneficial effects of the present invention are as follows: a document-level entity relationship extraction method and device based on a hypergraph convolutional neural network of the present invention, due to the adoption of an HG-GCNN model, can construct a hypergraph structure according to a preset composition strategy to obtain document-level hypergraphs of different levels on hyperedges of different granularities, and the GCNN encoding layer in the HG-GCNN model can learn more information in the hypergraph structure and classify entity relationships more accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 A flow chart of a document-level entity relationship extraction method based on a hypergraph convolutional neural network of the present invention;

[0067] Figure 2 Schematic diagram of an overview of the HG-GCNN model of the present invention;

[0068] Figure 3 It is a node information construction diagram in the HG-GCNN model of the present invention;

[0069] Figure 4 Schematic diagram of the document hypergraph structure in the HG-GCNN model of the present invention;

[0070] Figure 5 Schematic diagram of the GCNN coding layer in the HG-GCNN model of the present invention;

[0071] Figure 6 This is a schematic diagram of the changes of various evaluation indicators on the training set with the number of training times during the experimental verification in the embodiment of the present invention;

[0072] Figure 7 The figure is a schematic diagram of the changes of various evaluation indicators on the test set with the number of training times during the experimental verification in the embodiment of the present invention. DETAILED DESCRIPTION

[0073] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.

[0074] In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0075] See also Figure 1 , this embodiment provides a document-level entity relationship extraction method based on a hypergraph convolutional neural network, comprising:

[0076] S1. For triples, use the HG-GCNN model to obtain the hypergraph structure corresponding to the triples.

[0077] The triplet includes: document t.

[0078] The first entity e1 and the second entity e2 of the relationship to be predicted in the document t.

[0079] The document t contains n words.

[0080] There are at least 2 entities among the n words.

[0081] In the practical application of this embodiment, the input of the HG-GCNN model is a triple (e1, e2, t), where t is a document, e1 and e2 are entity pairs whose relationships need to be predicted in document t, The words in document t are output as entity relations.

[0082] S2. For the hypergraph structure, obtain the vector of each word in the document t under each entity in the entity pair of the relationship to be predicted.

[0083] S3. Based on the vectors of the words under each entity in the entity pair of the relationship to be predicted for each word in the document, obtain the entity relationship between the first entity e1 and the second entity e2.

[0084] See also Figure 2 , wherein the HG-GCNN model is a pre-established and trained model including a node information construction layer, a hypergraph construction layer, a GCNN encoding layer, and an inference judgment layer.

[0085] The node information construction layer and the hypergraph construction layer execute the process of obtaining the hypergraph structure, the GCNN encoding layer executes the process of obtaining the vector of each word under each entity in the document, and the reasoning and judgment layer executes the process of obtaining the prediction result.

[0086] In the practical application of this embodiment, S1 specifically includes:

[0087] See also Figure 3 The node information construction layer of the HG-GCNN model obtains the node information of the graph structure according to the distances of the words in each paragraph in the document t in the triple from the first entity e1 and the second entity e2.

[0088] See also Figure 4 ,The hypergraph construction layer of the HG-GCNN model constructs a hypergraph structure for the document t using a pre-set composition strategy.

[0089] In the practical application of this implementation, the node information construction layer of the HG-GCNN model obtains the node information of the graph structure according to the distance between the words in each paragraph of the document t in the triple and the first entity e1 and the second entity e2, specifically including:

[0090] For any paragraph in the document t in the triple, determine whether the paragraph contains a reference to the first entity e1. If not, determine that the importance of each word in the paragraph to the first entity e1 is 0; if so, construct a set of hyperedges between any word in the paragraph and all references to the first entity e1 in the paragraph, and the importance of any word in the paragraph to the first entity e1 is the sum of the reciprocals of the distances between any word in the paragraph and all references to the first entity e1 in the paragraph.

[0091] For any paragraph in the document t in the triple, determine whether the paragraph contains a reference to the second entity e2. If not, determine that the importance of each word in the paragraph to the second entity e2 is 0; if yes, construct a set of hyperedges by respectively connecting any word in the paragraph with all the references to the second entity e2 in the paragraph. The importance of any word in the paragraph to the second entity e2 is the sum of the reciprocals of the distances between any word in the paragraph and all the references to the second entity e2 in the paragraph.

[0092] The importance of any word in any paragraph in the document t in the triple to the first entity e1 and the second entity e2 is used as the information of the node corresponding to the any word.

[0093] In a specific application, an entity has multiple text representations, which is called a reference. Here, this embodiment uses a hypergraph G=<V,E,W> To describe the word [w1, w2, ..., w n ] and the correlation between citations, this paper proposes the following algorithm to construct word importance, each construction is based on a paragraph in a mini-batch, where Refers to the word w i For the importance of entity j, the algorithm is described as follows:

[0094] Input: triple (e1, e2, t), where t is a document, e1 and e2 are entity pairs in document t whose relations need to be predicted. The words in document t.

[0095] step:

[0096] If the reference to entity e1 does not exist then

[0097] else if the reference to entity e2 does not exist then

[0098] else

[0099] w iA set of hyperedges is constructed with the references of e1 and a set of hyperedges is constructed with the references of e2. i as the central vertex.

[0100] Calculate the reciprocal sum of the distances between all vertices and the central vertex on each set of hyperedges as the weight of the hyperedge, w i Among the associated hyperedges, the weight of the hyperedge where e1 is referenced is The weight of the hyperedge where e2 is referenced is

[0101] Output: Each word node w i Representation of

[0102] In the practical application of this embodiment, see Figure 4 The hypergraph construction layer of the HG-GCNN model uses a pre-set composition strategy to construct a hypergraph structure, specifically including:

[0103] The hypergraph structure includes: grammatical edges, reference edges, adjacent word edges, neighbor edges, and reflexive edges.

[0104] The grammatical edge is a hyperedge connecting any word in each sentence in document t and any word with a grammatical association relationship.

[0105] In specific applications, grammatical edges: The grammatical relations in sentences are an important way to understand the structure of an article. Therefore, for each sentence in the article, this paper constructs hyperedges based on the grammatical relations of the sentences. For the current sentence, this paper will w i Construct a set of hyperedges with words that have grammatical associations with it.

[0106] The reference edge is a set of hyperedges constructed by entities in document t and their corresponding references.

[0107] In specific applications, citation edges: The multiple occurrences of a certain entity in a text may be an important indicator of the connection between the context of the text. In grammar, there are often writing techniques such as foreword correspondence and general-specific combination. These writing techniques will disperse the relationship between entities into different paragraphs. For this reason, this paper constructs the words referring to the same entity into a set of hyperedges to connect the context of the text. That is, for the current text, this paper will represent the same reference entity e i and its corresponding references are constructed as a set of hyperedges.

[0108] The neighboring word edge is: for each sentence in the document t, the hyperedge constructed by the words in the sentence.

[0109] In specific applications, neighboring word edges: In a sentence, words and adjacent words have more or less connections and influences, either subject-predicate or verb-object relationships. Although it is impossible to perform explicit analysis, this paper constructs the adjacent words of each sentence into a set of hyperedges. They share the same hyperedge weight and mine the implicit information. Select the current sentence. This paper converts the word w in the current sentence into a hyperedge. i The construction is to construct a set of hyperedges.

[0110] The adjacent sentence edge is: for each paragraph in the document t, a group of hyperedges constructed by all entities in the paragraph.

[0111] In specific applications, adjacent sentence edges: In a paragraph, the semantic expression is not only reflected by the semantics of each sentence, but also expressed by the arrangement and association between sentences. Because the adjacent word hyperedges in the sentence have been constructed to express the sentence meaning, the arrangement and association of sentences between paragraphs can be simplified to the arrangement and association between each sentence entity. That is, for the current paragraph, this paper will represent the entity e of the adjacent sentences in the paragraph. i is constructed as a set of hyperedges.

[0112] The reflexive edge is a hyperedge that associates each word in document t with itself.

[0113] In specific applications, reflexive edges: In order to highlight the semantic expression of words in the modeling process, all nodes must construct a hyperedge containing themselves in the process of graph composition, that is, in all nodes w i The self-node type edge is formed on.

[0114] Wherein, in the hypergraph structure, the relationship value between any hyperedge and a word associated with the hyperedge is set to 1, and the relationship value between any hyperedge and a word not associated with the hyperedge is set to 0.

[0115] Comparison of hyperedges at different granularities

[0116] Syntax Edge Co-reference Edge Adjacent word edges Adjacent sentence edge Reflexive edge Super edge granularity sentence document sentence paragraph word Node Object word entity word entity word

[0117] Vertex-hyperedge relationship matrix

[0118] <![CDATA[e1]]> <![CDATA[e2]]> <![CDATA[e3]]> <![CDATA[e4]]> <![CDATA[w1]]> 1 1 0 0 <![CDATA[w2]]> 0 0 1 1 <![CDATA[w3]]> 0 1 0 1 <![CDATA[w4]]> 1 1 1 1

[0119] A document-level entity relationship extraction method and device based on a hypergraph convolutional neural network in this embodiment adopts the HG-GCNN model. Compared with the prior art, it can construct a hypergraph structure according to a preset composition strategy to obtain document-level hypergraphs of different levels on hyperedges of different granularities. The GCNN encoding layer in the HG-GCNN model can learn more information in the hypergraph structure and classify entity relationships more accurately.

[0120] See also Figure 5 In the practical application of this embodiment, S2 specifically includes:

[0121] The GCNN encoding layer of the HG-GCNN model learns the hypergraph structure and obtains the vector representation of the word corresponding to each node in the hypergraph structure under the first entity e1 and the vector representation under the second entity e2

[0122] In the practical application of this embodiment, the GCNN encoding layer of the HG-GCNN model learns the hypergraph structure and obtains the vector representation of the word corresponding to each node in the hypergraph structure under the first entity e1. and the vector representation under the second entity e2 Specifically include:

[0123] The GCNN encoding layer of the HG-GCNN model generates bias parameters and hyperedge weights for the hypergraph structure.

[0124] Each layer of the GCNN encoding layer of the HG-GCNN model learns the hypergraph structure. Based on the hypergraph structure and the node information, the information of the neighboring nodes of each node in the hypergraph structure is interacted with the information of the node using formula (1), and the bias parameters and hyperedge weights of the words corresponding to each node are iteratively updated to generate new bias parameters and hyperedge weights. Finally, the vector representation of the words corresponding to each node after the k layers of the GCNN encoding layer under the first entity e1 is obtained. and the vector representation under the second entity e2

[0125] Formula (1) is:

[0126]

[0127] in, is the i-th word w in the hypergraph structure obtained from the k-th layer of the GCNN encoding layer i The vector representation of the word w i The vector representation under the first entity e1 is and the vector representation under the second entity e2

[0128] v(i) is the i-th word w in the hypergraph structure i neighbor nodes of the word; wherein the neighbor nodes of the word are all nodes of the hyperedges connected in series with the word.

[0129] and are the weight and bias parameters of the hyperedge of the k-1th layer with hyperedge type l between node i and node u in the hypergraph structure.

[0130] l is any type of hyperedge among grammatical edge, reference edge, adjacent word edge, neighbor edge, and reflexive edge.

[0131] In the practical application of this embodiment, the GCNN encoding layer of the HG-GCNN model is based on the hypergraph structure and also obtains the hyperedge value of each hyperedge in the hypergraph structure.

[0132] The hyperedge value is a product of a preset bias parameter plus a weight of the hyperedge and the sum of node information corresponding to each word associated with the hyperedge.

[0133] In the practical application of this embodiment, S3 specifically includes:

[0134] S31, the reasoning judgment layer of the HG-GCNN model obtains the confidence score matrix S between the first entity e1 and the second entity e2 through the fully connected layer 12 .

[0135] The confidence score matrix S 12 Each position in corresponds to a preset entity relationship type.

[0136] in,

[0137] S 12 =(Embedding 1 R)Embedding 2 .

[0138] Among them, R is the parameter matrix of the fully connected layer after pre-training using the classification method of multiple instance learning.

[0139] Embedding 1 It is a matrix composed of the vector representations of all words in the hypergraph structure under the first entity e1 obtained by the kth layer of the GCNN encoding layer.

[0140] Embedding 2 It is a matrix composed of the vector representations of all words in the hypergraph structure under the second entity e2 obtained by the kth layer of the GCNN encoding layer.

[0141] In specific applications, after using the hypergraph convolutional neural network to obtain the vector representation of the word node, the inference judgment layer is required to judge the entity relationship, that is, to calculate the confidence of each relationship. In order to calculate the confidence of each relationship, a score matrix R is learned through a feedforward neural network (fully connected layer) to obtain a confidence score matrix indexed by the relationship between any two entities.

[0142] In specific applications, an entity in a document can have multiple references, and the data set is generally marked at the entity level rather than the reference level, such as in the text "Mr. Yang Zhenning met and got to know Weng Fan because of their teacher-student relationship, and eventually they got married and married Ms. Weng Fan." The two triples <Yang Zhenning, teacher-student, Weng Fan> and <Yang Zhenning, husband and wife, Weng Fan> are both relationships that can be extracted from the text, but if you want to extract the teacher-student relationship, then the husband and wife is a noise data. This noise caused by different references to entities is widely present in long texts. As we all know, the intricate relationships in the text lead to the complexity of text relationship extraction. This embodiment introduces a classification scheme based on multi-instance learning (MIL). In multi-instance learning, the associated reference pairs are not treated in isolation, but the model is trained for all reference pairs in an instance package, and the instance with the highest confidence is used to perform a single update of the model.

[0143] The specific description of this paper's multi-instance algorithm is as follows:

[0144] Input: training set T.

[0145] step:

[0146] Initialize the parameters in the network and divide the document into several instance packages. Each instance package contains several sentences, and these sentences contain several reference pairs.

[0147] According to the selected mini-batch size, the instance packages are fed into the network for learning in batches, and the model is trained using the set of all reference pairs of the instance packages.

[0148] The scoring function is used to select the reference pair with the highest confidence in each instance package to represent the current package, and the neural network is updated based on this instance with the highest confidence.

[0149] Repeat the above process until the model converges or reaches the maximum epoch.

[0150] Output: The trained model.

[0151] In the specific application, after calculating the node information in the node information construction layer, after the hypergraph construction layer constructs hyperedges of different granularities and encodes the hypergraph GCNN based on the neighborhood, two embedding representations of terms for different entities are obtained; in the reasoning layer, a relationship discriminator is trained, and the score matrix is ​​trained for the vector representation of the term to obtain the relationship confidence score of the entity pair. In the training process, this paper adopts a multi-instance learning solution to solve the noise problem between entity reference pairs.

[0152] S32, according to the confidence score matrix S12 and the confidence score matrix S 12 Each position in the is corresponding to a preset entity relationship type to determine the entity relationship between the first entity e1 and the second entity e2.

[0153] In the practical application of this embodiment, the S32 specifically includes:

[0154] The confidence score matrix S 12 The preset entity relationship type corresponding to the position with the maximum value among all the positions in is used as the entity relationship between the first entity e1 and the second entity e2.

[0155] The document-level entity relationship extraction method and device based on a hypergraph convolutional neural network of the present invention adopts an HG-GCNN model. Compared with the prior art, it can construct a hypergraph structure according to a preset composition strategy to obtain document-level hypergraphs of different levels on hyperedges of different granularities. The GCNN encoding layer in the HG-GCNN model can learn more information in the hypergraph structure and classify entity relationships more accurately.

[0156] A document-level entity relationship extraction device based on a hypergraph convolutional neural network, characterized in that the device comprises:

[0157] At least one processor; and at least one memory communicatively connected to the processor, wherein the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute any of the above-mentioned document-level entity relationship extraction methods based on hypergraph convolutional neural networks.

[0158] Experimental verification

[0159] In this embodiment, the above-mentioned document-level entity relationship extraction method based on hypergraph convolutional neural network is experimented, and the experiment is as follows:

[0160] The experiment uses PyTorch as the experimental environment, uses Adam as the optimizer of the model, and the learning rate is set to 0.002. The data set and specific division of this article are as follows:

[0161] CDR (Chemical-Disease Reactions dataset): contains 1500 chemical-disease-related data sets. The data sets manually annotate the binary relationships between chemistry and disease at the document level. In the experiment, the data sets of 1500 chemical-disease-related data sets were divided into three equal parts for training, validation, and testing.

[0162] GDA (Gene-Disease Associations dataset): A dataset containing 30,192 gene-disease association corpora. Through remote supervision, the dataset annotates the binary associations between genes and diseases at the document level. In the experiment, the dataset of 30,192 gene-disease association corpora was divided into 29,192 articles for training (training set and validation set divided into 4:1) and 1,000 articles for testing.

[0163] Experimental results and analysis

[0164] The process of relation extraction is actually a multi-classification problem of relations. For each category, the current category is the positive sample, and the other categories are negative samples. Based on this premise, we record the number of correct positive example predictions as TP, the number of wrong negative example predictions as FP, the number of correct negative example predictions as TN, and the number of wrong positive example predictions as FN. This article uses the following four evaluation indicators.

[0165] Accuracy: It is used to evaluate the percentage of correct predictions in all predictions. The higher the accuracy, the better the model effect. The calculation method is shown in formula (2).

[0166]

[0167] Precision: Also known as the precision rate, it is used to evaluate the percentage of true positive examples to predicted positive examples, avoiding the limitations of the accuracy index when the positive and negative samples are unbalanced. The higher the precision, the better the model effect. The calculation method is shown in formula (3).

[0168]

[0169] Recall: Also known as recall rate, it is used to evaluate how many positive examples in a sample are successfully predicted. The higher the recall rate, the better the model effect. The calculation method is shown in formula (4).

[0170]

[0171] F1 value: Under the default situation where accuracy and recall are equally important, the F1 value is an indicator for evaluating the quality of the model. Only when both accuracy and recall are high, the F1 value will be high. The calculation method is shown in formula (5).

[0172]

[0173] This example performs 10 epochs of training on the dataset and obtains the following results:

[0174]

[0175]

[0176] It can be seen that the HG-GCNN model in this embodiment can achieve good results on both datasets.

[0177] This embodiment tests the changes in various evaluation indicators of the HG-GCNN model on the CDR data training set and test set under 20 epochs. We measure the convergence speed of the model by the changes in various evaluation indicators on the training set, and measure the generalization effect of the model by the changes in various evaluation indicators on the test set.

[0178] See also Figure 6 The HG-GCNN model converges very quickly during the training process, and all training indicators are basically stable after 10 epochs. After 5 epochs, it has achieved quite good results. The adaptability to the training set data is getting better and better. The loss is in a monotonically decreasing state during the training process until it tends to be stable, and the precision and recall rates are also in a monotonically increasing state.

[0179] See also Figure 7 The HG-GCNN model also has excellent generalization on the test set, and there is no overfitting. The model can basically converge to a very stable state in about 10 epochs, and tends to be synchronized with the state of the training set. In the early stage of training, there is a significant difference between the precision and recall rate of the model. The precision and accuracy are close, but the recall rate is low, which means that the model can quickly achieve the effect of accurately identifying entity relationships during the training process, but the entity relationship recall rate needs further training to be improved.

[0180] Comparative experiment

[0181] In order to show the superiority of the HG-GCNN model in this embodiment, a comparative experiment was conducted on the CDR dataset against the classic methods. The compared algorithms include the traditional algorithm SVM model, the algorithm LSTM model based on the recurrent neural network, the algorithm CNN model based on the convolutional neural network, and the Transformer model.

[0182] Precision (P), recall (R) and F1 value are used as evaluation indicators of the model. The experimental results are shown below.

[0183]

[0184] The HG-GCNN model in this embodiment achieved the best results compared to the CNN model based on the attention mechanism and the LSTM model that models the document graph through a bidirectional tree structure. For the CNN model, there is a considerable improvement in the recall rate (R), about 12%, and a certain degree of improvement in the precision; for the RNN model, there is a considerable improvement in the precision, about 6%, and a certain degree of improvement in the recall rate, which shows that the introduction of hypergraphs of different granularities significantly improves the performance of the network.

[0185] Ablation experiment

[0186] In the ablation experiment, this paper constructed a Normal Graph Layer and conducted an ablation experiment on the hypergraph layer. The results are shown in the table below. It can be clearly seen that the hypergraph layer greatly improves the accuracy and recall of the model, including an increase of about 9% in precision (P) and about 6% in recall (R).

[0187]

[0188] In this embodiment, on the one hand, in the test of different data sets, the HG-GCNN model of this paper can achieve relatively good results on the CDR and GDA data sets; on the other hand, in the comparative experiment with other models, the HG-GCNN model of this paper has obvious improvements in both precision and recall rate. In the ablation experiment based on the hypergraph construction layer, the hypergraph construction layer has brought obvious improvements to the model. It has been proved that the model of this paper can extract effective information from the hypergraph structure based on the sentence, paragraph, and document level. At the same time, the HG-GCNN model of this paper converges quickly, and converges quickly in about 10 epochs. It has been proved that the introduction of the hypergraph can greatly simplify the document graph structure and improve the efficiency of model training.

[0189] Since the system described in the above embodiment of the present invention is a system used to implement the method of the above embodiment of the present invention, a person skilled in the art can understand the specific structure and deformation of the system based on the method described in the above embodiment of the present invention, and thus will not be described in detail here. All systems used in the method of the above embodiment of the present invention belong to the scope of protection of the present invention.

[0190] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0191] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions.

[0192] It should be noted that in the claims, any reference numerals placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In the claims enumerating several means, several of these means may be embodied by the same hardware. The use of the words first, second, third, etc., is for convenience of expression only and does not indicate any order. These words may be understood as part of the component name.

[0193] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0194] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments after knowing the basic creative concept. Therefore, the claims should be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.

[0195] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention should also include these modifications and variations.

Claims

1. A document-level entity relationship extraction method based on a hypergraph convolutional neural network, characterized in that: include: S1. For a triple, use the HG-GCNN model to obtain a hypergraph structure corresponding to the triple; The triplet includes: document t; A first entity e1 and a second entity e2 in the document t whose relationship is to be predicted; Where document t contains n words; There are at least 2 entities in the n words; S2. For the hypergraph structure, obtain the vector of each word in the document t for each entity in the entity pair of the relationship to be predicted; S3, based on the vectors of the words under each entity in the entity pair of the relationship to be predicted for each word in the document, obtaining the entity relationship between the first entity e1 and the second entity e2; The HG-GCNN model is a pre-established and trained model including a node information construction layer, a hypergraph construction layer, a GCNN encoding layer, and an inference judgment layer; The node information construction layer and the hypergraph construction layer execute the process of obtaining the hypergraph structure, the GCNN encoding layer executes the process of obtaining the vector of each word under each entity in the document, and the reasoning judgment layer executes the process of obtaining the prediction result; S1 specifically includes: The node information construction layer of the HG-GCNN model obtains the node information of the graph structure according to the distances of the words in each paragraph in the document t in the triple from the first entity e1 and the second entity e2 respectively; The hypergraph construction layer of the HG-GCNN model constructs a hypergraph structure for document t using a pre-set composition strategy; The hypergraph construction layer of the HG-GCNN model uses a pre-set composition strategy to construct a hypergraph structure, specifically including: The hypergraph structure includes: grammatical edges, reference edges, adjacent word edges, adjacent sentence edges, and reflexive edges; The grammatical edge is: a hyperedge connecting any word in each sentence in document t and a word with a grammatical association relationship; The reference edge is: a set of hyperedges constructed by entities in document t and their corresponding references; The neighboring word edge is: for each sentence in the document t, the hyperedge constructed by the words in the sentence; The adjacent sentence edge is: for each paragraph in the document t, a set of hyperedges constructed by all entities in the paragraph; The reflexive edge is: each word in document t is associated with its own hyperedge; Wherein, in the hypergraph structure, the relationship value between any hyperedge and a word associated with the hyperedge is set to 1, and the relationship value between any hyperedge and a word not associated with the hyperedge is set to 0.

2. The method according to claim 1, characterized in that The node information construction layer of the HG-GCNN model obtains the node information of the graph structure according to the distances of the words in each paragraph in the document t in the triple from the first entity e1 and the second entity e2, specifically including: For any paragraph in the document t in the triple, determine whether the paragraph has a reference to the first entity e1. If not, determine that the importance of each word in the paragraph to the first entity e1 is 0; if yes, construct a set of hyperedges between any word in the paragraph and all the references to the first entity e1 in the paragraph, and the importance of any word in the paragraph to the first entity e1 is the sum of the reciprocals of the distances between any word in the paragraph and all the references to the first entity e1 in the paragraph; For any paragraph in the document t in the triple, determine whether the paragraph has a reference to the second entity e2. If not, determine that the importance of each word in the paragraph to the second entity e2 is 0; if yes, construct a set of hyperedges between any word in the paragraph and all the references to the second entity e2 in the paragraph, and the importance of any word in the paragraph to the second entity e2 is the sum of the reciprocals of the distances between any word in the paragraph and all the references to the second entity e2 in the paragraph; The importance of any word in any paragraph in the document t in the triple to the first entity e1 and the second entity e2 is used as the information of the node corresponding to the any word.

3. The method according to claim 2, characterized in that S2 specifically includes: The GCNN encoding layer of the HG-GCNN model learns the hypergraph structure and obtains the vector representation of the word corresponding to each node in the hypergraph structure under the first entity e1 and the vector representation under the second entity e2 4. The method according to claim 3, characterized in that The GCNN encoding layer of the HG-GCNN model learns the hypergraph structure and obtains the vector representation of the word corresponding to each node in the hypergraph structure under the first entity e1 and the vector representation under the second entity e2 Specifically include: The GCNN encoding layer of the HG-GCNN model generates bias parameters and hyperedge weights for the hypergraph structure; Each layer of the GCNN encoding layer of the HG-GCNN model learns the hypergraph structure. Based on the hypergraph structure and the node information, the information of the neighboring nodes of each node in the hypergraph structure is interacted with the information of the node using formula (1), and the bias parameters and hyperedge weights of the words corresponding to each node are iteratively updated to generate new bias parameters and hyperedge weights. Finally, the vector representation of the words corresponding to each node after the k layers of the GCNN encoding layer under the first entity e1 is obtained. and the vector representation under the second entity e2 Formula (1) is: in, is the i-th word w in the hypergraph structure obtained from the k-th layer of the GCNN encoding layer i The vector representation of the word w i The vector representation under the first entity e1 is and the vector representation under the second entity e2 v(i) is the i-th word w in the hypergraph structure i The neighbor nodes of the word are all the nodes of the hyperedges connected in series with the word; and are the weight and bias parameters of the hyperedge of the k-1th layer with hyperedge type l between node i and node u in the hypergraph structure; l is any type of hyperedge among grammatical edge, reference edge, adjacent word edge, neighbor edge, and reflexive edge.

5. The method according to claim 4, characterized in that The GCNN encoding layer of the HG-GCNN model is based on the hypergraph structure, and further obtains the hyperedge value of each hyperedge in the hypergraph structure; The hyperedge value is a product of a preset bias parameter plus a weight of the hyperedge and the sum of node information corresponding to each word associated with the hyperedge.

6. The method according to claim 5, characterized in that S3 specifically includes: S31, the reasoning judgment layer of the HG-GCNN model obtains the confidence score matrix S between the first entity e1 and the second entity e2 through the fully connected layer 12 ; The confidence score matrix S 12 Each position in corresponds to a preset entity relationship type; in, S 12 =(Embedding 1 R)Embedding 2 ; Wherein, R is the parameter matrix of the fully connected layer after pre-training using the classification method of multiple instance learning; Embedding 1 is a matrix composed of vector representations of all words in the hypergraph structure under the first entity e1 obtained by the kth layer of the GCNN encoding layer; Embedding 2 is a matrix composed of vector representations of all words in the hypergraph structure under the second entity e2 obtained by the kth layer of the GCNN encoding layer; S32, according to the confidence score matrix S 12 and the confidence score matrix S 12 Each position in the is corresponding to a preset entity relationship type to determine the entity relationship between the first entity e1 and the second entity e2.

7. The method according to claim 6, characterized in that The S32 specifically includes: The confidence score matrix S 12 The preset entity relationship type corresponding to the position with the maximum value among all the positions in is used as the entity relationship between the first entity e1 and the second entity e2.

8. A document-level entity relationship extraction device based on a hypergraph convolutional neural network, characterized in that: The device comprises: at least one processor; and At least one memory communicatively connected to the processor, wherein the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the document-level entity relationship extraction method based on a hypergraph convolutional neural network as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Biomedical text representation method for modeling global and local context interaction

    CN111710428A

  • Document-level relation extraction method based on associated sentence selection and relational graph reasoning

    CN113468325A