Event atlas relation prediction method and device based on graph neural network

By enhancing the edge and neighbor node feature vectors of the event graph and constructing a graph neural network model, the incompleteness problem of the event graph is solved and a more comprehensive prediction of the relationship between events is achieved.

CN120598005APending Publication Date: 2025-09-05TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510673748.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

In the existing technology, event graphs constructed by extracting event information from online texts are incomplete, making it difficult to fully reflect the complex relationships between events.

Method used

The edge feature vectors connected to the target node in the event graph are enhanced using a preset relationship enhancement function, and the neighbor node feature vectors are enhanced using a preset neighbor node enhancement function. A graph neural network model is constructed to predict the relationship probability distribution of different node pairs.

Benefits of technology

The performance of the graph neural network model has been enhanced, making it better suitable for complex relationship scenarios in event graphs, such as one-to-many and reciprocal relationships, and solving the problem of incomplete event graphs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120598005A_ABST
    Figure CN120598005A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to an event atlas relation prediction method and device based on a graph neural network, and the method comprises the steps: carrying out the enhancement of an original edge feature vector of at least one edge connected with a target node based on a preset relation enhancement function; based on the enhanced edge feature vector and a preset neighbor node enhancement function, enhancing an original neighbor node feature vector of at least one neighbor node adjacent to the target node; enhancing the original node feature vector of the target node based on at least one of the enhanced edge feature vector and the enhanced neighbor node feature vector; and based on the enhanced node feature vectors, constructing a graph neural network layer, and constructing a graph neural network model to predict relation probability distribution of different node pairs. Therefore, the problem that the event atlas is difficult to comprehensively reflect the complex association between the events due to certain incompleteness existing in the event atlas constructed through the event information extracted from the web text in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for predicting event graph relationships based on graph neural networks. Background Art

[0002] Online text, a primary form of online information, contains a vast amount of information about social events. With frequent online interactions, these events spread rapidly across social networks and news media, generating significant impact. In information science, an event refers to a specific action involving one or more parties at a specific time and place, often described as a change in state. Events are constantly evolving, interdependent, and subject to specific evolutionary patterns. To better understand the various components of an event, the relationships between events, and their evolutionary context, and thus grasp the overall patterns of its development, event extraction can be used to extract structured event information from unstructured online text. These structured events can then be represented as a graph consisting of nodes and edges, enabling better analysis and reasoning.

[0003] In related technologies, text information in related fields can be collected, and recognition models can be used to extract causal relationships from the text information to obtain a complete event knowledge graph. Based on the trained model, the graph attention network can be used to infer the connection strength between events in the predicted graph structure to achieve event prediction. The historical data in the fields related to hot events obtained can also be constructed into a graph database, and dictionaries and indexes can be established through data preprocessing to obtain a completion model, thereby achieving more accurate link estimation effects.

[0004] However, in related technologies, event graphs constructed by extracting event information from online texts usually have certain incompleteness: on the one hand, some extracted events may be repeated (i.e., co-reference relationships); on the other hand, other relationships between events (such as causal relationships, hierarchical relationships, temporal relationships, etc.) are often not clearly marked or effectively discovered, which makes it difficult for event graphs to fully reflect the complex relationships between events, and urgently needs to be improved. Summary of the Invention

[0005] The present application provides a method and device for predicting event graph relationships based on a graph neural network to address the problem in related technologies that event graphs constructed by extracting event information from online texts are somewhat incomplete, making it difficult for event graphs to fully reflect the complex relationships between events.

[0006] The first aspect of the present application provides an event graph relationship prediction method based on a graph neural network, which is applied to the graph neural network model construction stage, wherein the method includes the following steps: based on a preset relationship enhancement function, enhancing the original edge feature vector of at least one edge connected to the target node in the event graph to obtain an enhanced edge feature vector; based on the enhanced edge feature vector and a preset neighbor node enhancement function, enhancing the original neighbor node feature vector of at least one neighbor node adjacent to the target node in the event graph to obtain an enhanced neighbor node feature vector; based on at least one of the enhanced edge feature vector and the enhanced neighbor node feature vector, enhancing the original node feature vector of the target node to obtain an enhanced node feature vector; based on the enhanced node feature vector, constructing a graph neural network layer, and using at least one layer of graph neural network layer to construct the graph neural network model, so as to predict the relationship probability distribution of different node pairs based on the graph neural network model.

[0007] Optionally, in one embodiment of the present application, before enhancing the original edge feature vector of the edge connected to the target node based on a preset relationship enhancement function, it also includes: obtaining the head node feature vector of at least one head node and the tail node feature vector of at least one tail node in the event graph; obtaining the initial feature vector of at least one edge in the event graph; and improving the initial feature vector based on the head node feature vector, the tail node feature vector and the relationship aggregation function to obtain the original edge feature vector.

[0008] Optionally, in one embodiment of the present application, constructing the graph neural network model using at least one graph neural network layer includes: constructing a cross-entropy loss function applicable to the graph neural network model based on the graph neural network model; and training the graph neural network model based on the cross-entropy loss function and the at least one graph neural network layer to obtain a trained graph neural network model.

[0009] Optionally, in one embodiment of the present application, constructing a graph neural network layer based on the enhanced node feature vector includes: obtaining an implementation method of the enhanced node feature vector under a multi-head attention mechanism; obtaining contribution weight information of different neighbor nodes to the target node; and constructing the graph neural network layer based on the implementation method, the contribution weight information and the enhanced node feature vector corresponding to the contribution weight information.

[0010] The second aspect of the present application provides an event graph relationship prediction method based on a graph neural network, which is applied to the graph neural network model application stage, wherein the method includes the following steps: converting the target text information into the corresponding target event graph; inputting the node pairs to be predicted in the target event graph into a pre-built graph neural network model to output the relationship probability distribution of the node pairs to be predicted, wherein the pre-built graph neural network model is obtained by event graph training.

[0011] The third aspect of the present application is an embodiment that provides an event graph relationship prediction device based on a graph neural network, which is applied to the graph neural network model construction stage, wherein the device includes: a first enhancement module, which is used to enhance the original edge feature vector of at least one edge connected to the target node in the event graph based on a preset relationship enhancement function to obtain an enhanced edge feature vector; a second enhancement module, which is used to enhance the original neighbor node feature vector of at least one neighbor node adjacent to the target node in the event graph based on the enhanced edge feature vector and a preset neighbor node enhancement function to obtain an enhanced neighbor node feature vector; a first generation module, which is used to enhance the original node feature vector of the target node based on at least one of the enhanced edge feature vector and the enhanced neighbor node feature vector to obtain an enhanced node feature vector; a second generation module, which is used to construct a graph neural network layer based on the enhanced node feature vector, and use at least one graph neural network layer to construct the graph neural network model to predict the relationship probability distribution of different node pairs based on the graph neural network model.

[0012] Optionally, in one embodiment of the present application, it also includes: a first acquisition module, used to obtain the head node feature vector of at least one head node and the tail node feature vector of at least one tail node in the event graph before enhancing the original edge feature vector of the edge connected to the target node based on a preset relationship enhancement function; a second acquisition module, used to obtain the initial feature vector of at least one edge in the event graph; an improvement module, used to improve the initial feature vector based on the head node feature vector, the tail node feature vector and the relationship aggregation function to obtain the original edge feature vector.

[0013] Optionally, in one embodiment of the present application, the second generation module includes: a first construction unit, used to construct a cross-entropy loss function applicable to the graph neural network model based on the graph neural network model; a training unit, used to train the graph neural network model based on the cross-entropy loss function and the at least one graph neural network layer to obtain a trained graph neural network model.

[0014] Optionally, in one embodiment of the present application, the second generation module includes: a first acquisition unit for acquiring an implementation method of the enhanced node feature vector under the multi-head attention mechanism; a second acquisition unit for acquiring contribution weight information of different neighbor nodes to the target node; and a second construction unit for constructing the graph neural network layer based on the implementation method, the contribution weight information and the enhanced node feature vector corresponding to the contribution weight information.

[0015] The fourth aspect of the present application provides an event graph relationship prediction device based on a graph neural network, which is applied to the graph neural network model application stage, wherein the device includes: a conversion module for converting target text information into a corresponding target event graph; an output module for inputting the node pairs to be predicted in the target event graph into a pre-built graph neural network model to output the relationship probability distribution of the node pairs to be predicted, wherein the pre-built graph neural network model is obtained by event graph training.

[0016] The fifth aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the event graph relationship prediction method based on graph neural network as described in the above embodiment.

[0017] The sixth aspect of the present application provides a computer-readable storage medium, which stores a computer program. When the program is executed by a processor, it implements the above-mentioned event graph relationship prediction method based on graph neural network.

[0018] The seventh embodiment of the present application provides a computer program product, including a computer program, which, when executed, implements the above-mentioned event graph relationship prediction method based on graph neural network.

[0019] The embodiment of the present application can utilize a preset relationship enhancement function to enhance the original edge feature vector of at least one edge connected to the target node in the event graph, and utilize a preset neighbor node enhancement function to enhance the original neighbor node feature vector of the neighbor node, and then enhance the original node feature vector of the target node based on the enhanced edge feature vector and the enhanced neighbor node feature vector, thereby constructing a graph neural network model to predict the relationship probability distribution of different node pairs. Through the edge feature enhancement operation and the neighbor node feature enhancement operation, the performance of the constructed graph neural network model can be enhanced, and it can be better applied to complex relationship scenarios such as one-to-many and reciprocal in the event graph. Therefore, it solves the problem in the related technology that the event graph constructed by event information extracted from network text has certain incompleteness, making it difficult for the event graph to fully reflect the complex correlation between events.

[0020] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0022] Figure 1 A flowchart of a method for predicting event graph relationships based on a graph neural network according to an embodiment of the present application;

[0023] Figure 2 A block diagram of a graph neural network model network architecture provided according to one embodiment of the present application;

[0024] Figure 3 Schematic diagram of a block diagram of an event graph relationship prediction device based on a graph neural network according to an embodiment of the present application;

[0025] Figure 4 A flowchart of a method for predicting event graph relationships based on a graph neural network according to another embodiment of the present application;

[0026] Figure 5 A flowchart for predicting the probability distribution of relationships between pairs of nodes to be predicted according to one embodiment of the present application;

[0027] Figure 6 Schematic diagram of a block diagram of an event graph relationship prediction device based on a graph neural network according to another embodiment of the present application;

[0028] Figure 7 A schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0029] The following describes in detail embodiments of the present application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0030] The following describes an event graph relationship prediction method and device based on a graph neural network embodiment of the present application with reference to the accompanying drawings. In response to the problem that the event graph constructed by event information extracted from network text mentioned in the above background technology has certain incompleteness, which makes it difficult for the event graph to fully reflect the complex relationship between events, the present application provides an event graph relationship prediction method based on a graph neural network. In this method, the original edge feature vector of at least one edge connected to the target node in the event graph can be enhanced by using a preset relationship enhancement function, and the original neighbor node feature vector of the neighbor node can be enhanced by using a preset neighbor node enhancement function, and then the original node feature vector of the target node is enhanced based on the enhanced edge feature vector and the enhanced neighbor node feature vector, thereby constructing a graph neural network model to predict the relationship probability distribution of different node pairs. Through the edge feature enhancement operation and the neighbor node feature enhancement operation, the performance of the constructed graph neural network model can be enhanced, and it is better applicable to complex relationship scenarios such as one-to-many and reciprocal in the event graph. Thus, the problem that the event graph constructed by event information extracted from network text in the related technology has certain incompleteness, which makes it difficult for the event graph to fully reflect the complex relationship between events, etc.

[0031] Specifically, Figure 1 This is a flowchart of a method for predicting event graph relationships based on a graph neural network according to an embodiment of the present application.

[0032] like Figure 1 As shown, the event graph relationship prediction method based on graph neural network is applied to the graph neural network model construction stage, wherein the method includes the following steps:

[0033] In step S101, based on a preset relationship enhancement function, the original edge feature vector of at least one edge connected to the target node in the event graph is enhanced to obtain an enhanced edge feature vector.

[0034] It is understandable that in the graph neural network model construction phase, the present embodiment proposes a preset relationship enhancement function. The feature vector of the edge can not only contain the semantic information of the edge itself, but also integrate the information of the nodes connecting the two ends. The present embodiment names this fusion mechanism as the preset relationship enhancement function. The preset relationship enhancement function is used to integrate the original feature vectors of the head node, tail node and edge to generate a new enhanced edge feature vector. Its expression can be, but is not limited to:

[0035]

[0036] in, It is the relationship vector that integrates the information of the nodes at both ends. is the learnable weight coefficient, h n ,h ois the node feature vector, r n,o is the original edge eigenvector.

[0037] In some embodiments, the embodiments of the present application may utilize a preset relationship enhancement function to enhance the original edge feature vector of at least one edge connected to the target node in the event graph, thereby generating an enhanced edge feature vector.

[0038] For example, in the embodiment of the present application, the original edge feature vector r is set to n,o is enhanced, and the corresponding enhanced edge feature vector is obtained make It can include semantic associations between nodes at both ends, thereby more comprehensively expressing the relationship between specific nodes.

[0039] Optionally, in one embodiment of the present application, before enhancing the original edge feature vector of the edge connected to the target node based on a preset relationship enhancement function, it also includes: obtaining the head node feature vector of at least one head node and the tail node feature vector of at least one tail node in the event graph; obtaining the initial feature vector of at least one edge in the event graph; and improving the initial feature vector based on the head node feature vector, the tail node feature vector and the relationship aggregation function to obtain the original edge feature vector.

[0040] It is understandable that in the embodiment of the present application, during the graph neural network model construction phase, the mapping method between different nodes can be inferred by introducing inductive bias. In machine learning, inductive bias can be understood as a set of assumptions made by a learning algorithm for induction (i.e., generalizing a limited observation data set or training data into a general model of the domain). The relationship prediction task can be summarized as a mapping method that infers the relationship between nodes from the semantic and topological information between them.

[0041] In this embodiment of the present application, the original edge feature vector is obtained by obtaining the head node feature vector of the head node, the tail node feature vector of the tail node, and the initial feature vector of the edge in the event graph, and improving the initial feature vector using the relationship aggregation function. It can be understood that the original edge feature vector in this embodiment of the present application can not only contain its own semantic information, but also integrate the feature vectors of the head node and the tail node, that is, the original edge feature vector can be, but is not limited to:

[0042]

[0043] Among them, h n ,h o is the node feature vector, g r is a relational aggregation function, It is the initial feature vector that describes the semantic information of the relationship.

[0044] In step S102, based on the enhanced edge feature vector and the preset neighbor node enhancement function, the original neighbor node feature vector of at least one neighbor node adjacent to the target node in the event graph is enhanced to obtain an enhanced neighbor node feature vector.

[0045] It is understandable that the embodiment of the present application obtains the enhanced edge feature vector After that, the original neighbor node feature vector of the neighbor node can be further integrated with the corresponding enhanced edge feature vector to obtain the enhanced neighbor node feature vector. The preset neighbor node enhancement function can be, but is not limited to, expressed as:

[0046]

[0047] in, It is an enhanced neighbor node feature vector that integrates neighbor information and corresponding relationship information. is the weight coefficient to be learned.

[0048] The embodiment of the present application enhances the original neighbor node feature vector of the neighbor node by presetting a neighbor node enhancement function to obtain an enhanced neighbor node feature vector, wherein the enhanced neighbor node feature vector can not only include the original neighbor node feature vector of the neighbor node, but also combine the dynamic relationship characteristics between the neighbor node and the target node, so that subsequent feature aggregation is more accurate.

[0049] In step S103, the original node feature vector of the target node is enhanced based on at least one of the enhanced edge feature vector and the enhanced neighbor node feature vector to obtain an enhanced node feature vector.

[0050] As a possible implementation method, the embodiment of the present application can use at least one of the enhanced edge feature vector and the enhanced neighbor node feature vector to perform an enhancement operation on the original node feature vector of the target node, thereby generating an enhanced node feature vector.

[0051] In step S104, a graph neural network layer is constructed based on the enhanced node feature vector, and a graph neural network model is constructed using at least one layer of graph neural network layer to predict the relationship probability distribution of different node pairs based on the graph neural network model.

[0052] It is understandable that the embodiment of the present application can use the enhanced node feature vector to construct a graph neural network layer, wherein the expression of the graph neural network layer can be, but is not limited to:

[0053]

[0054] in, represents the output vector of the t-th layer neural network, is the input of the t-th layer graph neural network, representing the feature vectors corresponding to the head node, tail node, and the directed edges connecting them.

[0055] Furthermore, the embodiment of the present application utilizes at least one graph neural network layer to construct a graph neural network model. In the embodiment of the present application, the graph neural network model can correctly handle complex relationships such as one-to-many, many-to-one, and self-reflexive. Its network architecture is as follows: Figure 2 shown.

[0056] It should be noted that in Figure 2 In the embodiment of the present application, h′ may be set o is the output vector of node o, i.e. the enhanced node feature vector, Among them, d o The input of the graph neural network model can include but is not limited to the original feature vector h of node o. o , original neighbor node feature vector h n |n∈N(o) and the corresponding original edge feature vector r n,o , the dimensions d of the input and output features i , d o and relationship characteristic dimension d r Doesn't have to be the same.

[0057] Furthermore, in order to improve the nonlinear expression capability of node and relationship features, the embodiment of the present application uses weights to store the initial enhanced node feature vector learned by each network layer, and uses a fully connected feedforward neural network layer to obtain an enhanced node feature vector, which can be expressed as, but not limited to:

[0058]

[0059] Among them, W1 and W2 are learnable weight matrices.

[0060] Optionally, in one embodiment of the present application, a graph neural network model is constructed using at least one graph neural network layer, including: constructing a cross-entropy loss function applicable to the graph neural network model based on the graph neural network model; training the graph neural network model based on the cross-entropy loss function and at least one graph neural network layer to obtain a trained graph neural network model.

[0061] It is understandable that in the embodiment of the present application, the graph neural network model adopts a cross entropy loss function, the expression of which can be but is not limited to:

[0062]

[0063] Among them, y i.r is the label value of the i-th sample in the relation category r (the value is 0 or 1), p i,rRepresents the probability that the model predicts that the i-th sample belongs to the relation category r (satisfying p i,r ∈[0,1]), N is the number of training samples, and R is the total number of relation categories.

[0064] Furthermore, the embodiment of the present application uses a cross-entropy loss function to train a graph neural network model, thereby obtaining a trained graph neural network model.

[0065] Optionally, in one embodiment of the present application, a graph neural network layer is constructed based on the enhanced node feature vector, including: obtaining the implementation method of the enhanced node feature vector under the multi-head attention mechanism; obtaining the contribution weight information of different neighbor nodes to the target node; and constructing the graph neural network layer based on the implementation method, contribution weight information and the enhanced node feature vector corresponding to the contribution weight information.

[0066] It should be noted that in the embodiment of the present application, a node is usually connected to multiple neighboring nodes. Therefore, it is possible to first determine which neighboring features have a greater impact on the output node. In the embodiment of the present application, the attention mechanism can be used to dynamically assign importance weights to neighboring nodes, and then perform weighted aggregation on neighboring nodes and relationship information based on the attention weights. The expression can be, but is not limited to:

[0067]

[0068] Among them, a o,n Represents the normalized attention value. Through this attention mechanism, the graph neural network layer can dynamically adjust the importance weights of neighbor nodes to the target node, so that the information of key neighbor nodes receives more attention, while noise or irrelevant information is suppressed.

[0069] In some embodiments, the embodiments of the present application provide two implementation methods under the multi-head attention mechanism: splicing and averaging. Other implementation methods are also possible, and this application does not impose specific restrictions.

[0070] Among them, splicing can be understood as splicing the output of each attention head, and its expression can be but not limited to:

[0071]

[0072] Among them, cat represents the splicing operation, They represent the features of node n and edge [n→o] information aggregated in the kth attention and the corresponding attention value. In this case, the spliced ​​output The corresponding dimension is no longer d o But Kd o .

[0073] Averaging can be understood as taking the average of the outputs of different heads. Its expression can be, but is not limited to:

[0074]

[0075] According to the event graph relationship prediction method based on graph neural network proposed in the embodiment of the present application, the original edge feature vector of at least one edge connected to the target node in the event graph can be enhanced by using a preset relationship enhancement function, and the original neighbor node feature vector of the neighbor node can be enhanced by using a preset neighbor node enhancement function. Then, the original node feature vector of the target node is enhanced based on the enhanced edge feature vector and the enhanced neighbor node feature vector, so as to construct a graph neural network model and predict the relationship probability distribution of different node pairs. Through the edge feature enhancement operation and the neighbor node feature enhancement operation, the performance of the constructed graph neural network model can be enhanced, and it can be better applied to complex relationship scenarios such as one-to-many and reciprocal in the event graph. Therefore, the problem in the related technology that the event graph constructed by event information extracted from network text has certain incompleteness, making it difficult for the event graph to fully reflect the complex relationship between events, is solved.

[0076] Next, an event graph relationship prediction device based on a graph neural network proposed in accordance with an embodiment of the present application will be described with reference to the accompanying drawings.

[0077] Figure 3 A block diagram of an event graph relationship prediction device based on a graph neural network provided according to an embodiment of the present application.

[0078] like Figure 3 As shown, the event graph relationship prediction device 10 based on graph neural network is applied to the graph neural network model construction stage, wherein the device 10 includes: a first enhancement module 100, a second enhancement module 200, a first generation module 300 and a second generation module 400.

[0079] The first enhancement module 100 is configured to enhance the original edge feature vector of at least one edge connected to the target node in the event graph based on a preset relationship enhancement function to obtain an enhanced edge feature vector.

[0080] The second enhancement module 200 is used to enhance the original neighbor node feature vector of at least one neighbor node adjacent to the target node in the event graph based on the enhanced edge feature vector and the preset neighbor node enhancement function to obtain an enhanced neighbor node feature vector.

[0081] The first generating module 300 is configured to enhance the original node feature vector of the target node based on at least one of the enhanced edge feature vector and the enhanced neighbor node feature vector to obtain an enhanced node feature vector.

[0082] The second generation module 400 is used to construct a graph neural network layer based on the enhanced node feature vector, and use at least one layer of graph neural network layer to construct a graph neural network model to predict the relationship probability distribution of different node pairs based on the graph neural network model.

[0083] Optionally, in one embodiment of the present application, it further includes: a first acquisition module, a second acquisition module and an improvement module.

[0084] Among them, the first acquisition module is used to obtain the head node feature vector of at least one head node and the tail node feature vector of at least one tail node in the event graph before enhancing the original edge feature vector of the edge connected to the target node based on a preset relationship enhancement function.

[0085] The second acquisition module is used to obtain the initial feature vector of at least one edge in the event graph.

[0086] The improvement module is used to improve the initial feature vector based on the head node feature vector, the tail node feature vector and the relationship aggregation function to obtain the original edge feature vector.

[0087] Optionally, in one embodiment of the present application, the second generation module 400 includes: a first construction unit and a training unit.

[0088] Among them, the first construction unit is used to construct a cross entropy loss function applicable to the graph neural network model based on the graph neural network model.

[0089] The training unit is used to train the graph neural network model based on the cross entropy loss function and at least one graph neural network layer to obtain a trained graph neural network model.

[0090] Optionally, in one embodiment of the present application, the second generating module 400 includes: a first acquiring unit, a second acquiring unit and a second constructing unit.

[0091] Among them, the first acquisition unit is used to obtain the implementation method of enhancing the node feature vector under the multi-head attention mechanism.

[0092] The second acquisition unit is used to obtain contribution weight information of different neighbor nodes to the target node.

[0093] The second construction unit is used to construct a graph neural network layer based on the implementation method, contribution weight information and the enhanced node feature vector corresponding to the contribution weight information.

[0094] It should be noted that the aforementioned explanation of the embodiment of the event graph relationship prediction method based on graph neural network is also applicable to the event graph relationship prediction device based on graph neural network in this embodiment, and will not be repeated here.

[0095] According to the event graph relationship prediction device based on graph neural network proposed in the embodiment of the present application, the original edge feature vector of at least one edge connected to the target node in the event graph can be enhanced by using a preset relationship enhancement function, and the original neighbor node feature vector of the neighbor node can be enhanced by using a preset neighbor node enhancement function, and then the original node feature vector of the target node is enhanced based on the enhanced edge feature vector and the enhanced neighbor node feature vector, so as to construct a graph neural network model and predict the relationship probability distribution of different node pairs. Through the edge feature enhancement operation and the neighbor node feature enhancement operation, the performance of the constructed graph neural network model can be enhanced, and it can be better applied to complex relationship scenarios such as one-to-many and reciprocal in the event graph. Therefore, the problem in the related technology that the event graph constructed by event information extracted from network text has certain incompleteness, making it difficult for the event graph to fully reflect the complex relationship between events, is solved.

[0096] The above embodiment describes the model building phase. The following describes an embodiment of the test application phase.

[0097] Figure 4 This is a flowchart of an event graph relationship prediction method based on a graph neural network according to another embodiment of the present application.

[0098] like Figure 4 As shown, the event graph relationship prediction method based on graph neural network is applied in the graph neural network model application stage, wherein the method includes the following steps:

[0099] In step S401, the target text information is converted into a corresponding target event graph.

[0100] It is understandable that in the embodiment of the present application, a pre-trained language model can be used to implement feature vectorization of node semantics. The input of the pre-trained language model can be composed of the associated text of the node to be embedded, wherein the associated text of the event node includes the trigger word and all the arguments of the event, and the associated text of the argument node is the corresponding argument fragment, and the original text information corresponding to each event graph. Specifically, the pre-trained language model processing flow can be:

[0101] First, the original text information corresponding to each event graph is input into the pre-trained language model to obtain the context-aware encoding of each word. Then, a differentiated encoding strategy is implemented according to the node type: for argument nodes, the position of the argument is located in the text, and the corresponding position mask value is set to 1, and the rest are 0; for event nodes, the positions of all event elements (trigger words and related arguments) are marked, and their mask values ​​are set to 1; then, the character encodings of the mask area are averaged to generate a node vector for each node; finally, the edge vector is obtained.

[0102] Furthermore, embodiments of the present application can classify corresponding edges into three categories based on the relationship types of the event graph: edges connecting event nodes, edges connecting event nodes with argument nodes, and edges connecting argument nodes with argument nodes. Edges of different relationship types are then vectorized using one-hot encoding, thereby constructing discrete feature vectors with the same number of dimensions as the relationship types.

[0103] Among them, the edges connecting event nodes can be used to represent the temporal, causal and other logical relationships between events; the edges connecting event nodes and argument nodes can be used to represent the argument role played by the argument in the event; and the edges connecting argument nodes can be used to represent the association relationship between event elements.

[0104] In step S402, the node pairs to be predicted in the target event graph are input into a pre-built graph neural network model to output the relationship probability distribution of the node pairs to be predicted, wherein the pre-built graph neural network model is trained by the event graph.

[0105] In some embodiments, the present application embodiment can predict event relationships through a pre-built graph neural network model to obtain the relationship probability distribution of the node pairs to be predicted, the main contents of which are as follows: Figure 5 As shown, the main contents are:

[0106] Step S501: Node feature aggregation.

[0107] Among them, the embodiment of the present application is for the node to be predicted v h , v t In each graph neural network layer, the pre-built graph neural network model first enhances the semantic information of the edges and neighboring nodes connected to the target node through preset relationship enhancement functions and preset neighbor node enhancement functions. Then, the multi-head attention mechanism aggregates the neighbor node and edge information to the target node, and finally outputs it through the feedforward neural network. The nodes encoded by the graph neural network layer can contain network topology information, edge features, and neighbor node features.

[0108] Step S502: Pre-built graph neural network model.

[0109] In this embodiment of the present application, the pre-built graph neural network model has multiple layers of graph neural network layers, and the input-output relationship of each layer of the graph neural network layer is Among them, G t is the t-th graph neural network layer, For node v i The embedding vector at layer t, For node v j The embedding vector of node v at layer t-1 jis node v i neighbor nodes.

[0110] Step S503: relationship probability distribution prediction.

[0111] In this embodiment, the target node pair is encoded multiple times to obtain the output vector h h , h t , and concatenate the two output vectors, and calculate the relationship probability distribution after linear transformation and softmax function: P(r|v h ,v t )=softmax(W c [h h ||h t ]+b c ). Among them, W c , b c are the weights and biases of the linear layer respectively.

[0112] According to the event graph relationship prediction method based on graph neural network proposed in the embodiment of the present application, the target text information can be converted into the corresponding target event graph, and then the relationship probability distribution of the node pairs to be predicted can be obtained using the pre-built graph neural network model. Through edge feature enhancement operations and neighbor node feature enhancement operations, the performance of the constructed graph neural network model can be enhanced, and it can be better applied to complex relationship scenarios such as one-to-many and reciprocal in event graphs. Therefore, the problem in related technologies that the event graph constructed by event information extracted from network text has certain incompleteness, making it difficult for the event graph to fully reflect the complex relationships between events is solved.

[0113] Next, an event graph relationship prediction device based on a graph neural network proposed in accordance with an embodiment of the present application will be described with reference to the accompanying drawings.

[0114] Figure 6 A block diagram of an event graph relationship prediction device based on a graph neural network according to another embodiment of the present application.

[0115] like Figure 6 As shown, the event graph relationship prediction device 20 based on graph neural network is applied to the graph neural network model application stage, wherein the device 20 includes: a conversion module 500 and an output module 600.

[0116] The conversion module 500 is used to convert the target text information into a corresponding target event graph.

[0117] The output module 600 is used to input the node pairs to be predicted in the target event graph into a pre-built graph neural network model to output the relationship probability distribution of the node pairs to be predicted, wherein the pre-built graph neural network model is trained by the event graph.

[0118] It should be noted that the aforementioned explanation of the embodiment of the event graph relationship prediction method based on graph neural network is also applicable to the event graph relationship prediction device based on graph neural network in this embodiment, and will not be repeated here.

[0119] According to the event graph relationship prediction device based on graph neural network proposed in the embodiment of the present application, the target text information can be converted into the corresponding target event graph, and then the relationship probability distribution of the node pairs to be predicted can be obtained by using the pre-constructed graph neural network model. Through the edge feature enhancement operation and the neighbor node feature enhancement operation, the performance of the constructed graph neural network model can be enhanced, and it can be better applied to complex relationship scenarios such as one-to-many and reciprocal in the event graph. Therefore, the problem in the related technology that the event graph constructed by event information extracted from network text has certain incompleteness, making it difficult for the event graph to fully reflect the complex relationship between events is solved.

[0120] Figure 7 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. The electronic device may include:

[0121] Memory 701 , processor 702 , and computer programs stored in the memory 701 and executable on the processor 702 .

[0122] When the processor 702 executes the program, the event graph relationship prediction method based on the graph neural network provided in the above embodiment is implemented.

[0123] Furthermore, the electronic device further includes:

[0124] The communication interface 703 is used for communication between the memory 701 and the processor 702 .

[0125] The memory 701 is used to store computer programs that can be run on the processor 702 .

[0126] The memory 701 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0127] If the memory 701, processor 702, and communication interface 703 are implemented independently, the communication interface 703, memory 701, and processor 702 can be interconnected via a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0128] Optionally, in a specific implementation, if the memory 701, the processor 702 and the communication interface 703 are integrated on a chip, the memory 701, the processor 702 and the communication interface 703 can communicate with each other through an internal interface.

[0129] The processor 702 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0130] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned event graph relationship prediction method based on graph neural network.

[0131] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed, implements the above-mentioned event graph relationship prediction method based on graph neural network.

[0132] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" 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 application. 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 can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0133] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this application, "N" means at least two, for example, two, three, etc., unless otherwise specifically defined.

[0134] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing a custom logical function or process step, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed in a different order than shown or discussed, including performing functions in a substantially simultaneous manner or in a reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application pertain.

[0135] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or N wires (electronic devices), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting, or otherwise processing in a suitable manner as necessary, and then storing it in a computer memory.

[0136] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented using hardware, as in another embodiment, it can be implemented using any one or a combination of the following technologies known in the art: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0137] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0138] In addition, the functional units in the various embodiments of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0139] The storage medium mentioned above may be a read-only memory, a magnetic disk, or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application. Persons skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.

Claims

1. A method for predicting event graph relationships based on graph neural networks, characterized in that: Applied to the graph neural network model construction stage, wherein the method includes the following steps: Based on a preset relationship enhancement function, the original edge feature vector of at least one edge connected to the target node in the event graph is enhanced to obtain an enhanced edge feature vector; Based on the enhanced edge feature vector and a preset neighbor node enhancement function, an original neighbor node feature vector of at least one neighbor node adjacent to the target node in the event graph is enhanced to obtain an enhanced neighbor node feature vector; Based on at least one of the enhanced edge feature vector and the enhanced neighbor node feature vector, enhancing the original node feature vector of the target node to obtain an enhanced node feature vector; Based on the enhanced node feature vector, a graph neural network layer is constructed, and the graph neural network model is constructed using at least one layer of graph neural network layer to predict the relationship probability distribution of different node pairs based on the graph neural network model.

2. The method according to claim 1, characterized in that Before enhancing the original edge feature vector of the edge connected to the target node based on the preset relationship enhancement function, the following steps are also included: Obtaining a head node feature vector of at least one head node and a tail node feature vector of at least one tail node in the event graph; Obtaining an initial feature vector of at least one edge in the event graph; Based on the head node feature vector, the tail node feature vector and the relationship aggregation function, the initial feature vector is improved to obtain the original edge feature vector.

3. The method according to claim 1, characterized in that The method of constructing the graph neural network model using at least one graph neural network layer includes: Based on the graph neural network model, construct a cross entropy loss function applicable to the graph neural network model; Based on the cross entropy loss function and the at least one graph neural network layer, the graph neural network model is trained to obtain a trained graph neural network model.

4. The method according to claim 1, wherein The step of constructing a graph neural network layer based on the enhanced node feature vector includes: Obtaining an implementation method of the enhanced node feature vector under a multi-head attention mechanism; Obtain the contribution weight information of different neighbor nodes to the target node; The graph neural network layer is constructed based on the implementation method, the contribution weight information and the enhanced node feature vector corresponding to the contribution weight information.

5. A method for predicting event graph relationships based on graph neural networks, characterized in that: The event graph relationship prediction method based on a graph neural network according to any one of claims 1 to 4 is applied to the graph neural network model application stage, wherein the method comprises the following steps: Convert the target text information into the corresponding target event graph; The node pairs to be predicted in the target event graph are input into a pre-built graph neural network model to output the relationship probability distribution of the node pairs to be predicted, wherein the pre-built graph neural network model is trained by the event graph.

6. An event graph relationship prediction device based on graph neural network, characterized in that: Applied to the graph neural network model construction stage, wherein the device includes: A first enhancement module is configured to enhance an original edge feature vector of at least one edge connected to a target node in the event graph based on a preset relationship enhancement function to obtain an enhanced edge feature vector; a second enhancement module, configured to enhance an original neighbor node feature vector of at least one neighbor node adjacent to the target node in the event graph based on the enhanced edge feature vector and a preset neighbor node enhancement function, so as to obtain an enhanced neighbor node feature vector; a first generating module, configured to enhance an original node feature vector of a target node based on at least one of the enhanced edge feature vector and the enhanced neighbor node feature vector to obtain an enhanced node feature vector; The second generation module is used to construct a graph neural network layer based on the enhanced node feature vector, and use at least one layer of graph neural network layer to construct the graph neural network model to predict the relationship probability distribution of different node pairs based on the graph neural network model.

7. An event graph relationship prediction device based on graph neural network, characterized in that: Applied to the graph neural network model application stage, wherein the device includes: A conversion module, used to convert target text information into corresponding target event graph; An output module is used to input the node pairs to be predicted in the target event graph into a pre-built graph neural network model to output the relationship probability distribution of the node pairs to be predicted, wherein the pre-built graph neural network model is obtained by event graph training.

8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the event graph relationship prediction method based on a graph neural network as described in any one of claims 1 to 4 or the event graph relationship prediction method based on a graph neural network as described in claim 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the event graph relationship prediction method based on a graph neural network as described in any one of claims 1 to 4 or the event graph relationship prediction method based on a graph neural network as described in claim 5.

10. A computer program product, characterized in that It includes a computer program that, when executed, is used to implement the event graph relationship prediction method based on a graph neural network as described in any one of claims 1 to 4 or the event graph relationship prediction method based on a graph neural network as described in claim 5.