A text relation extraction method based on graph aggregation and reasoning
By using graph aggregation and reasoning-based methods, document-level and entity-level graphs are generated. By utilizing relational graph convolutional neural networks and feedforward neural networks, the problem of insufficient utilization of semantic information in document-level relation extraction is solved, and more accurate relation extraction is achieved.
Patent Information
- Application Number
- CN202211067006.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-01
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-09-01
AI Technical Summary
Existing document-level relation extraction methods fail to fully utilize the semantic information of documents and the relationships between entity pairs across sentences, leading to the introduction of noise.
We employ a graph aggregation and reasoning-based approach. We obtain the initial entity representation of a document through an encoder, construct a document-level graph, and use a relation graph convolutional neural network to generate a global entity representation. We then combine the entity-level graph and a feedforward neural network to predict relationships.
It effectively integrates rich semantic information from documents, discovers long-distance relationships between sentence entity pairs, reduces noise information, and improves the accuracy of relationship extraction.
Smart Images

Figure CN115392257B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of natural language processing, and particularly relates to a text relation extraction method based on graph aggregation and reasoning. BACKGROUND
[0002] Relation extraction is to identify the semantic relation between a pair of named entities in a text. Relation extraction plays an important role in building a knowledge graph by given unknown relation facts of a text. Previous work focuses on sentence-level relation extraction, which extracts the relation between entities in a single sentence. In real-world applications, a large number of relations, such as relation facts from Wikipedia articles and biomedical literature, span multiple sentences in an article. According to the analysis of the Wikipedia corpus, at least 40.7% of the relations depend on the information of multiple sentences in the document to be extracted. Therefore, it is necessary to extract relations at the document level.
[0003] Previous studies use relation extraction to shorten the text span. For example, the newly proposed DocRED dataset, which contains many documents with large-scale human annotations, promotes the development of sentence-level relation extraction to document-level relation extraction. In order to fully utilize the complex semantic information of the document, recent work designs a document-level graph and commits to propose a graph neural network-based model. For example, someone splits the document-level graph into two directed acyclic graphs (DAGs) and uses graph LSTM for each DAG to obtain the context representation of each word. Someone else proposes an edge-oriented model that constructs a document-level graph with different types of nodes and edges to obtain a representation of global relation classification. At the same time, the document graph is defined as a latent variable and is induced based on structured attention to improve the performance of document-level relations, and the model is extracted by optimizing the structure of the document graph. However, these inventions only average the mention embeddings to obtain entity embeddings and input them into a classifier to obtain relation labels. In addition, each entity has the same representation in different entity pairs, which may introduce noise from irrelevant context. SUMMARY
[0004] In view of the above problems in the prior art, the text relation extraction method based on graph aggregation and reasoning provided by the application solves the problem that the semantic information of the document and the relation between the cross-sentence entity pairs cannot be fully utilized in the existing document relation extraction process.
[0005] In order to achieve the above-mentioned application purposes, the technical scheme adopted by the application is as follows: a text relation extraction method based on graph aggregation and reasoning, comprising the following steps:
[0006] S1, obtaining the initial representation of entities of a document through an encoder, and then constructing a document-level graph;
[0007] S2, convolve the document-level graph through an l-layer stacked relational graph convolutional neural network according to the types of edges in the document-level graph, to generate entity global representations;
[0008] S3, generate an entity-level graph according to the entity global representations in the document-level graph, and further generate entity final representations; obtain target relationship representations and context relationship representations according to the entity final representations;
[0009] S4, perform prediction through a feedforward neural network according to the target relationship representations and the context relationship representations, to obtain a relationship prediction result, and complete text relationship extraction.
[0010] Further, the step S1 comprises the following sub-steps:
[0011] S11, obtain an embedding of a document by taking BERT as an encoder, and obtain an initial representation of an entity of the document through a logsumexp pooling layer;
[0012] The expression of the embedding H of the document is specifically as follows:
[0013] H=[h1,h2,…,h k2 ]=BERT([w1,w2,…,w k1 ])
[0014] In the formula, w k1 is the k1th word of the document D, and h k2 is a hidden state sequence obtained by the k2th layer BERT output;
[0015] The expression of the initial representation of the entity of the document is specifically as follows:
[0016]
[0017] In the formula, is a hidden state sequence containing a mention, is the total number of mentions;
[0018] S12, construct a document-level graph according to the initial representation of the entity of the document;
[0019] The document-level graph comprises sentence nodes and mention nodes.
[0020] The expression of the sentence node is as follows: The expression of the mention node is as follows:
[0021] Further, the step S2 comprises the following sub-steps:
[0022] S21, define the type of edge in the document-level graph based on the sentence node and the mention node in the document-level graph, and generate the edge of the document-level graph;
[0023] S22, convolve the document-level graph through the l-layer stacked relational graph convolutional neural network to obtain the relationship of the edge in the document-level graph, and generate a heterogeneous graph;
[0024] S23, input the heterogeneous graph into the logsumexp pooling layer to obtain the global representation of the entity.
[0025] Further, in the step S21, the types of edges in the document-level graph include mention-mention edges, mention-sentence edges, and sentence-sentence edges.
[0026] The step S21 is specifically:
[0027] When the initial representations of two different entities are in the same sentence, the mention nodes connecting the initial representations of the two different entities are generated to form mention-mention edges; when the mention node is in the sentence, the mention node and the sentence node in the current sentence are connected to generate mention-sentence edges; all sentence nodes are connected to generate sentence-sentence edges.
[0028] Further, in the step S22, the expression of the forward propagation update of the l-layer stacked relational graph convolutional neural network is specifically:
[0029]
[0030] In the formula, is the node in the document-level graph output by the l-layer stacked relational graph convolutional neural network, and are nodes in the document-level graph output by the l-1-layer stacked relational graph convolutional neural network, and σ(·) is an activation function, is a neighbor set of node i connected with edge x, is a set of edge types, is a trainable parameter matrix, d n is the dimension of the node representation.
[0031] Further, in the step S23, the expression for calculating the global representation of the entity is specifically:
[0032]
[0033] In the formula, and are trainable parameter matrices, is an entity representation related function output by the logsumexp pooling layer, Let ν be the initial representation of the entity and the correlation function, and let ν be the standardized feature vector.
[0034] Further: Step S3 includes the following sub-steps:
[0035] S31. Generate an entity-level graph based on the global entity representation in the document-level graph. Convolve the entity-level graph using a stacked relational graph convolutional neural network of l layers to generate an entity inference representation. Obtain the final entity representation based on the entity inference representation and the global entity representation.
[0036] S32. Based on the final entity representation and the relative distance representation, obtain the specific entity representation of the entity pair. Connect the specific entity representations of the entity pair to obtain the target relation representation. Obtain the context relation representation based on the target relation representation.
[0037] Further: In step S31, the final representation of the entity is obtained. The specific expression is:
[0038]
[0039] In the formula, and All of these are trainable parameter matrices. For entity reasoning representation, This is the initial representation of the entity;
[0040] In step S32, the specific entity representation of the entity pair includes a first specific entity representation. Second specific entity representation Its specific expression is:
[0041]
[0042]
[0043] In the formula, δ ij For entity node e in document D i The first mention of entity node e j The first mention of relative distance; δ ji For entity node e in document D j The first mention of entity node e i The first mention of relative distance;
[0044] Obtain the context relation representation o c The specific expression is:
[0045]
[0046] In the formula, W is a trainable parameter matrix, and the target relation represents... Oi Let o′ be the relation representation of the i-th entity pair. r o r The transpose of θ i For O i The attention weights are p, where p is the number of entity pairs.
[0047] Further: Step S4 includes the following sub-steps:
[0048] S41. Represent the target relationship. r And contextual relationship representation o c The input is fed forward into a neural network for prediction, and the predicted probability of belonging to category r is obtained.
[0049] S42. Based on the predicted probability of belonging to category r, define a loss function and obtain the relationship prediction result through a classifier to complete the text relationship extraction.
[0050] Further: In step S41, the predicted probability y of belonging to category r is obtained. r The specific expression is:
[0051] y r =sigmoid(FFNN([o r ;o c ]))
[0052] In the formula, FFNN(·) is the prediction result of the feedforward neural network, and sigmoid(·) is the machine learning function;
[0053] In step S42, the loss function The specific expression is:
[0054]
[0055] In the formula, For the true label of r, It is a set of target relation representations and context relation representations.
[0056] The beneficial effects of this invention are as follows: This invention proposes a document-level graph based on complex semantic information, which is a heterogeneous process containing mention nodes and sentence nodes, used to integrate rich semantic information of a document to obtain entity representations.
[0057] This invention proposes an entity-level graph acquisition method to discover long-distance relationships between entity pairs across sentences. Then, we use an attention mechanism to fuse global entity representations, inferred entity representations, and initial entity representations to extract the relationships between entity pairs. Attached Figure Description
[0058] Figure 1This is a flowchart of the present invention.
[0059] Figure 2 The figure shows the ablation study results of this invention. Detailed Implementation
[0060] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0061] Example 1:
[0062] like Figure 1 As shown, in one embodiment of the present invention, a text relation extraction method based on graph aggregation and reasoning includes the following steps:
[0063] S1. Obtain the initial entity representation of the document through the encoder, and then construct the document-level graph;
[0064] S2. Based on the type of edges in the document-level graph, convolve the document-level graph using l-layer stacked relational graph convolutional neural networks to generate a global representation of entities;
[0065] S3. Generate an entity-level graph based on the global entity representation in the document-level graph, and then generate the final entity representation; obtain the target relation representation and context relation representation based on the final entity representation;
[0066] S4. Based on the target relation representation and the context relation representation, a feedforward neural network is used to make predictions to obtain the relation prediction results, thus completing the text relation extraction.
[0067] In this embodiment, the documents utilize the DocRED and Chemical Disease Relationships (CDR) datasets. The DocRED dataset is a large-scale, human-annotated dataset built by Wikipedia and Wikidata for document-level RE, containing 96 relation types, 132,275 entities, and 56,354 relation facts. DocRED covers a wide range of relations related to science, art, time, personal life, and more. The Chemical Disease Relationships (CDR) dataset is a human-annotated dataset designed specifically for the BioCreative V Challenge. It consists of three subsets: training, development, and testing. Each dataset contains 500 articles on chemistry and disease.
[0068] The datasets were preprocessed, and some parameter settings for each dataset were determined. In the model implementation, the uncased BERT base was selected as the record, and the embedding and hidden dimensions were set to 768. For the CDR dataset, BioBERT-Base v1.1 was selected, and a BERT-Based-cased model for biomedicine was retrained. The dlg layer has two layers, and the elg layer has one layer of R-GCNs. Furthermore, the embedding of the size graph of the nodes is 768. All hyperparameters were tuned based on the development set. Additionally, the parameters in the network were initialized randomly and orthogonally and updated during training.
[0069] Step S1 includes the following sub-steps:
[0070] S11. Use BERT as an encoder to obtain the document embeddings, and obtain the initial entity representation of the document through the logsumexp pooling layer;
[0071] The expression for obtaining the embedding H of the document is specifically as follows:
[0072] H = [h1, h2, ..., h k2 ] = BERT([w1,w2,…,w k1 ])
[0073] In the formula, w k1 h is the k1th word of document D. k2 The hidden state sequence obtained from the output of the k2-th BERT layer;
[0074] Obtain the initial entity representation of the document. The specific expression is:
[0075]
[0076] In the formula, For including mentions The hidden state sequence, The total number of mentions;
[0077] S12. Construct a document-level graph based on the initial entity representation of the document;
[0078] The document-level graph includes sentence nodes and mention nodes;
[0079] The representation of a sentence node is defined by averaging the representations of the words it contains, and the representation of a mention node is defined by averaging the representations of the words it contains.
[0080] The sentence node The expression is Mentioning nodes The expression is
[0081] In this embodiment, choosing BERT as the encoder can better capture the semantic information of the article. The initial entity representation contains multiple mentions, and the initial entity representation can be obtained through the logsumexp pooling layer.
[0082] Step S2 includes the following sub-steps:
[0083] S21. Based on sentence nodes and mention nodes in the document-level graph, define the edge types in the document-level graph and generate the edges of the document-level graph;
[0084] S22. Convolve the document-level graph using a stacked relational graph convolutional neural network of l layers to obtain the relationship between edges in the document-level graph and generate a heterogeneous graph.
[0085] S23. Input the heterogeneous graph into the logsumexp pooling layer to obtain the global representation of the entity.
[0086] In step S21, the types of edges in the document-level graph include mention-mention edges, mention sentence edges, and sentence-sentence edges.
[0087] Step S21 specifically involves:
[0088] When two different entities are initially represented in the same sentence, the mention nodes of the two different entities are connected to generate mention-mention edges; when the mention node is in the sentence, the mention node and the sentence node in the current sentence are connected to generate mention-sentence edges; and all sentence nodes are connected to generate sentence-sentence edges.
[0089] In step S22, the expression for updating nodes via forward propagation in the l-layer stacked relational graph convolutional neural network is specifically as follows:
[0090]
[0091] In the formula, The nodes in the document-level graph output by an l-layer stacked relational graph convolutional neural network. and These are nodes in the document-level graph output by a stacked l-1 layers of a relational graph convolutional neural network, where σ(·) is the activation function. Let i be the set of neighbors of node i connected to edge x. A set of edge types, Let d be a trainable parameter matrix. n The dimension represented by the node.
[0092] In this embodiment, a stacked relational graph convolutional neural network (R-GCN) performs convolution operations on the document-level graph, taking into account various types of edges, and can better model heterogeneous graphs with multiple relationships.
[0093] In step S23, the global representation of the entity is calculated. The specific expression is:
[0094]
[0095] In the formula, and All of these are trainable parameter matrices. The functions related to the entity representation output of the logsumexp pooling layer. Let v be the initial representation of the entity and the correlation function, and v be the standardized feature vector.
[0096] In this embodiment, the entity representation is computed using the representation of the mentioned nodes after graph convolution via logsumexp pooling. The entity obtained from the document-level graph is represented as involving semantic information throughout the entire document. However, the information of the entire document inevitably contains noise; therefore, this invention employs an attention mechanism to fuse the initial entity representation and the semantic information of the entity to reduce noise.
[0097] Step S3 includes the following sub-steps:
[0098] S31. Generate an entity-level graph based on the global entity representation in the document-level graph. Convolve the entity-level graph using a stacked relational graph convolutional neural network of l layers to generate an entity inference representation. Obtain the final entity representation based on the entity inference representation and the global entity representation.
[0099] S32. Based on the final entity representation and the relative distance representation, obtain the specific entity representation of the entity pair. Connect the specific entity representations of the entity pair to obtain the target relation representation. Obtain the context relation representation based on the target relation representation.
[0100] In this embodiment, in order to discover some relationships between long-distance cross-sentence entity pairs, the present invention constructs an entity-level graph (Elg), which includes entity nodes that represent entities in document D.
[0101] Entity nodes are represented by entities obtained from document-level graphs, which include two types of edges: intra-sentence edges and logical reasoning edges.
[0102] When two entity nodes are mentioned in the same sentence, the two different entities are connected by an in-sentence margin. For example, if for an entity pair... <e i ,e j >Existence is represented as Path PIi,j Then elg uses inner edges within the sentence to connect entity nodes e. i and e j Because they appear in the input document In the same sentence s1. and These are mentions related to two entities. "->" indicates a reference from entity node e. i To entity node e j A reasoning step on the reasoning path.
[0103] When there is a bridge entity connecting the entity pairs in two sentences, the two entity nodes are connected using a logical reasoning edge. For example, a pair of entity pairs distributed in sentences s1 and s2. <e i ,e j The relationship between them is determined by bridge entity e. k It was established indirectly. Because the bridge entity e k The mentions and entities in s2 and e i and e j Related. For example, there exists a logical reasoning path PI. i, Represented as Connect entity node e using logical reasoning edges. i and e j .
[0104] In step S31, the final representation of the entity is obtained. The specific expression is:
[0105]
[0106] In the formula, and All of these are trainable parameter matrices. For entity reasoning representation, This is the initial representation of the entity;
[0107] The entity-level graph is convolved by a stacked R-GCN layer to obtain the entity reasoning representation. In order to better integrate the entity information, the present invention adopts an attention mechanism to fuse the global entity representation, the entity reasoning representation and the initial entity representation together to form the final entity representation.
[0108] In step S32, the specific entity representation of the entity pair includes a first specific entity representation. Second specific entity representation Its specific expression is:
[0109]
[0110]
[0111] In the formula, δ ij For entity node e in document D i The first mention of entity node e j The first mention of relative distance; δ ji For entity node e in document D j The first mention of entity node e o The first mention of relative distance;
[0112] The relative distances are first divided into several sets {1, 2, ..., 2j}. Then, each set is associated with a trainable distance embedding. Δ associates each δ with a set.
[0113] Obtain the context relation representation o c The specific expression is:
[0114]
[0115] In the formula, W is a trainable parameter matrix, and the target relation represents... O i Let o′ be the relation representation of the i-th entity pair. r o r The transpose of θ o For O i The attention weights are p, where p is the number of entity pairs.
[0116] This invention uses self-attention to capture contextual relationship representations, which can help us utilize the topic information of a document.
[0117] Step S4 includes the following sub-steps:
[0118] S41. Represent the target relationship. r And contextual relationship representation o c The input is fed forward into a neural network for prediction, and the predicted probability of belonging to category r is obtained.
[0119] S42. Based on the predicted probability of belonging to category r, define a loss function and obtain the relationship prediction result through a classifier to complete the text relationship extraction.
[0120] In step S41, the predicted probability y of belonging to category r is obtained. r The specific expression is:
[0121] y r =sigmoid(FFNN([o r ;o c ]))
[0122] In the formula, FFNN(·) is the prediction result of the feedforward neural network, and sigmoid(·) is the machine learning function;
[0123] In step S42, the loss function The specific expression is:
[0124]
[0125] In the formula, For the true label of r, It is a set of target relation representations and context relation representations.
[0126] In this embodiment, the loss function is optimized using the Adam optimizer. During experiments on the DocRED dataset, comparisons were made with two models, without two models, and without one of each model, with GARA-BERT set as the baseline model.
[0127] Two metrics were selected to test the effectiveness of graph filtering.
[0128] Following previous work, F1 and Ign F1 were used as evaluation metrics for DocRED. F1 scores can be calculated via an online interface because the gold standard for the DocRED test set is unknown. Furthermore, Ign F1 indicates that the F1 score ignores the fact that the training set and development / test set are shared, resulting in the following... Figure 2 As shown, this is an ablation study of GARA on the DocRED development set, where "w / o" indicates no ablation.
[0129] Depend on Figure 2 It can be seen that when the final representation of an entity obtained from the entity reasoning representation is removed, our F1 and IgnF1 model scores on the document development set decrease by 0.43% and 41%, respectively. Similarly, removing the generation of the final representation of an entity from the global entity representation results in a decrease of 0.16% and 0.24% in the error F1 and IgnF1 scores, respectively, with the IgnF1 score decreasing by 0.14%.
[0130] A greater drop occurs when the final representation of an entity is derived from both the entity reasoning representation and the entity global representation. The F1 score drops from 59.73% to 59.16%, and the Ign F1 score drops from 57.85% to 57.33%. This study suggests that generating the final representation of an entity from all entity global representations, entity reasoning representations, and initial entity representations is more effective for relation extraction tasks.
[0131] The beneficial effects of this invention are as follows: This invention proposes a document-level graph based on complex semantic information, which is a heterogeneous process containing mention nodes and sentence nodes, used to integrate rich semantic information of a document to obtain entity representations.
[0132] This invention proposes an entity-level graph acquisition method to discover long-distance relationships between entity pairs across sentences. Then, we use an attention mechanism to fuse global entity representations, inferred entity representations, and initial entity representations to extract the relationships between entity pairs.
[0133] In the description of this invention, it should be understood that the terms "center," "thickness," "upper," "lower," "horizontal," "top," "bottom," "inner," "outer," and "radial," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying the relative importance or the number of technical features implicitly specified. Therefore, a feature defined by "first," "second," and "third" may explicitly or implicitly include one or more of that feature.
Claims
1. A text relation extraction method based on graph aggregation and reasoning, characterized in that, Includes the following steps: S1. Obtain the initial entity representation of the document through the encoder, and then construct the document-level graph; S2. Based on the type of edges in the document-level graph, convolve the document-level graph using a stacked relational graph convolutional neural network of layer l to generate a global representation of entities; step S2 includes the following sub-steps: S21. Based on sentence nodes and mention nodes in the document-level graph, define the edge types in the document-level graph and generate the edges of the document-level graph; S22. Convolve the document-level graph using a stacked relational graph convolutional neural network of l layers to obtain the relationship between edges in the document-level graph and generate a heterogeneous graph. S23. Input the heterogeneous graph into the logsumexp pooling layer to obtain the global representation of the entity; S3. Generate an entity-level graph based on the global entity representation in the document-level graph, and then generate the final entity representation; obtain the target relation representation and context relation representation based on the final entity representation; step S3 includes the following sub-steps: S31. Generate an entity-level graph based on the global entity representation in the document-level graph. Convolve the entity-level graph using a stacked relational graph convolutional neural network of layer l to generate an entity inference representation. Obtain the final entity representation based on the entity inference representation and the global entity representation. : In the formula, , and All of these are trainable parameter matrices. For entity reasoning representation, This is the initial representation of the entity; S32. Based on the final entity representation and the relative distance representation, obtain the specific entity representation of the entity pair; connect the specific entity representations of the entity pair to obtain the target relation representation; obtain the context relation representation based on the target relation representation; the specific entity representation of the entity pair includes the first specific entity representation. Second specific entity representation Its expression is as follows: In the formula, For entity nodes in document D The first mention of entity nodes The first mention of relative distance; For entity nodes in document D The first mention of entity nodes The first mention of relative distance; Contextual Relationship Representation The specific expression is: In the formula, Given a trainable parameter matrix, the target relation is represented as... , For the first Relationship representation of pairs of entities for of , for Attention weights The number of entity pairs; S4. Based on the target relation representation and the context relation representation, a feedforward neural network is used to make predictions to obtain the relation prediction results, thus completing the text relation extraction.
2. The text relation extraction method based on graph aggregation and reasoning according to claim 1, characterized in that, Step S1 includes the following sub-steps: S11. Use BERT as an encoder to obtain the document embeddings, and obtain the initial entity representation of the document through the logsumexp pooling layer; Wherein, the embedding of the document is obtained. The specific expression is: In the formula, For the k1th word of document D, The hidden state sequence obtained from the output of the k2-th BERT layer; Obtain the initial entity representation of the document. The specific expression is: In the formula, For including mentions The hidden state sequence, The total number of mentions; S12. Construct a document-level graph based on the initial entity representation of the document; The document-level graph includes sentence nodes and mention nodes; The sentence node The expression is Mentioning nodes The expression is .
3. The text relation extraction method based on graph aggregation and reasoning according to claim 1, characterized in that, In step S21, the types of edges in the document-level graph include mention-mention edges, mention-sentence edges, and sentence-sentence edges; Step S21 specifically involves: When two different entities are initially represented in the same sentence, the mention nodes of the two different entities are connected to generate mention-mention edges; When a reference node is in a sentence, the reference node is connected to the sentence node in the current sentence to generate a reference sentence edge; Connect all sentence nodes to generate sentence-sentence edges.
4. The text relation extraction method based on graph aggregation and reasoning according to claim 1, characterized in that, In step S22, the expression for updating nodes via forward propagation in the l-layer stacked relational graph convolutional neural network is specifically as follows: In the formula, The nodes in the document-level graph output by a stacked l-layer relational graph convolutional neural network are... and All nodes in the document-level graph output by the l-1 stacked convolutional neural network are nodes in the graph, where σ(·) is the activation function. To be with the edge Connected nodes The neighborhood group, A set of edge types, ∈ For a trainable parameter matrix, The dimension represented by the node.
5. The text relation extraction method based on graph aggregation and reasoning according to claim 1, characterized in that, In step S23, the global representation of the entity is calculated. The specific expression is: In the formula, , and All of these are trainable parameter matrices. The entity representation related functions output by the logsumexp pooling layer. The relevant function is used to initially represent the entity. This is a standardized feature vector.
6. The text relation extraction method based on graph aggregation and reasoning according to claim 1, characterized in that, Step S4 includes the following sub-steps: S41. Represent the target relationship and contextual relationship representation The input is fed forward into a neural network for prediction, and the predicted probability of belonging to category r is obtained. S42. Based on the predicted probability of belonging to category r, define a loss function and obtain the relationship prediction result through a classifier to complete the text relationship extraction.
7. The text relation extraction method based on graph aggregation and reasoning according to claim 6, characterized in that, In step S41, the predicted probability of belonging to category r is obtained. The specific expression is: In the formula, The prediction results are from the feedforward neural network. For machine learning functions; In step S42, the loss function The specific expression is: In the formula, ∈ {0,1} is The true label, It is a set of target relation representations and context relation representations.
Citation Information
Patent Citations
Chapter-level relationship extraction method
CN111831783A
Extracting definitions from documents utilizing definition-labeling-dependent machine learning background
US20220050967A1