Time sequence knowledge graph reasoning method based on long and short term dependence
By constructing a long-term dense graph and a graph neural network that utilizes relationship awareness and attention mechanisms, it solves the problems of long-term dependence and short-term dynamics ignored in traditional temporal knowledge graph reasoning methods, and achieves accurate predictions of future events.
Patent Information
- Application Number
- CN202410850246.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-15
AI Technical Summary
Traditional temporal knowledge graph reasoning methods cannot effectively utilize time information and ignore long-term dependencies and high-order interactive information between events, resulting in insufficient accuracy in predicting future events.
A temporal knowledge graph reasoning method based on long-term and short-term dependencies is used to capture the long-term dependencies of event development by constructing long-term dense graphs and relationship-aware graph convolutional neural networks, and the attention-based relationship graph neural network is used to model the short-term evolution of events. Trends, adaptively adjust long-term dependencies to achieve accurate predictions.
It improves the prediction accuracy of future events, can effectively capture the long-term trends and short-term dynamics of event evolution, and reduces training time and space costs.
Smart Images

Figure CN118780360A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of knowledge graph reasoning, and relates to a temporal knowledge graph reasoning method based on long-term and short-term dependencies. It mainly uses Relational Graph Convolutional Neural Networks (R-GCN) and Relational Graph Attention Neural Networks (R-GAT) to jointly model the structural dependency and sequence pattern of event evolution from the perspectives of long-term dependency and short-term preference of event development, so that event-related entities and relationships are represented by low-dimensional embedding vectors, and on this basis, a Convolutional Translation Network (ConvTransE) is used as a decoder to calculate the possibility of future interactions between event entities, so as to achieve accurate event prediction. Background Art
[0002] The main purpose of temporal knowledge graph reasoning is to predict the occurrence of future events based on a large number of historical events, that is, to predict which entities will interact at a certain point in the future. Due to its important impact in decision-making areas such as disaster prediction, social relationship prediction, and financial analysis, temporal knowledge graph reasoning has attracted increasing attention recently.
[0003] Events in real life always evolve over time, but traditional knowledge graphs (KG) cannot model such temporal dynamics. To solve this limitation, temporal knowledge graphs (TKG) came into being. A temporal knowledge graph is usually composed of a series of knowledge graph snapshots that occur at different times, and these knowledge graph snapshots contain various real events that occur at the same time. By considering the temporal information, each event in the temporal knowledge graph can be expressed as a four-tuple form of (subject, relationship, object, time). For example, (LeBron James, played for, Miami Heat, 2010-2014) means that during the period from 2010 to 2014, LeBron James played for the Miami Heat. The present invention realizes the prediction of future events based on the historical events and time information recorded in the temporal knowledge graph.
[0004] Traditional temporal knowledge graph reasoning methods can be divided into three types: (1) Tensor Decomposition-based reasoning methods, which usually represent the 4-tuple representing an event as a fourth-order tensor; this method usually cannot effectively utilize time information; (2) Autoregression-based reasoning methods, which capture the evolutionary laws of event development by continuously modeling subgraphs; this method usually only models short-term dependencies and ignores important long-term dependencies; (3) Replication-based reasoning methods, which emphasize the repetitiveness and periodicity of event occurrence; this method usually ignores high-order interactive information between events. The present invention is an improvement on the autoregression-based reasoning method, which uses an autoregressive graph neural network method to model the trend of event evolution, and designs a long-term dense graph to learn the long-term dependencies of event evolution. On this basis, the long-term dependencies are adaptively adjusted according to the development of recent events to achieve accurate event prediction. Summary of the invention
[0005] The purpose of the present invention is to address the technical problems existing in the above-mentioned prior art and provide a temporal knowledge graph reasoning method based on long-term and short-term dependencies, by performing multi-scale modeling of event evolution from the perspective of long-term and short-term dependencies, so as to achieve accurate prediction of future events.
[0006] The idea of the present invention is to use the constructed long-term dense graph and relationship-aware graph convolutional neural network to capture the long-term dependencies of event development; on this basis, use the relationship-aware graph neural network based on the attention mechanism to model the short-term evolution trend of events, and through the strong focus on the short-term development of events, realize adaptive adjustment of long-term dependencies, and realize accurate prediction of future events.
[0007] Based on the above invention ideas, the present invention proposes a temporal knowledge graph reasoning method based on long-term and short-term dependencies, which specifically includes the following steps:
[0008] S1 combines several historical subgraph sequences into a long-term dense graph, and uses a relational graph neural network to model the high-order semantic interaction information between events and the repetitiveness of event occurrences, generating a long-term embedding representation of entities containing long-term semantic dependencies for each entity and relationship;
[0009] S2 initializes several subgraph sequences before the current moment using the long-term embedding representation obtained in step S1. Then, for each subgraph sequence, combined with the entity embedding representation and relationship embedding representation of the previous moment, the attention-based relational graph neural network and double loop network are used to model the recent evolution of the event, generating entity embedding representation and relationship embedding representation that contain long-term evolution dependency and short-term evolution preference for each entity and relationship.
[0010] S3 obtains the final prediction results of future events through the decoder based on the entity embedding representation, relationship embedding representation and known entities at the current moment.
[0011] The purpose of the above step S1 is to give a number of historical subgraph sequences (for example, M historical subgraphs {G t-m-M ,G t-m-M+1 ,…,G t-m-1}), first merge these historical subgraphs into a unified dense historical graph G g ,Then, on this basis, a relation-aware graph neural network is used to capture the high-order semantic interaction dependencies between entities across time and space and the repetitive patterns of event occurrence, that is, to achieve modeling of long-term dependencies on event evolution. This step S1 specifically includes the following sub-steps:
[0012] S11 builds a long-term dense graph based on several continuous historical subgraph sequences;
[0013] S12 uses several layers of relationship-aware graph neural networks to generate long-term embedding representations of entities that contain long-term semantic dependencies.
[0014] In the above step S11, a unified dense history graph containing rich long-term dependencies is constructed. For example, for a given M continuous history subgraph sequence {G t-m-M ,G t-m-M+1 ,…,G t-m-1}, t represents the timestamp of the current event to be predicted, and m represents the number of short-term dependent subgraphs. All entities are retained as nodes, that is, the same entity at different times is regarded as the same node, and the interactions between entities at different times are merged, that is, the time information of the interaction is removed, so that a unified dense history graph G can be obtained. g , that is, the long-term dense graph G g In this way, a large amount of historical information can be compressed into a unified historical graph, and on this basis, the long-term dependencies of event evolution can be modeled from a global perspective.
[0015] In the above step S12, in the long-term dense graph G obtained above g The high-order semantic interaction information between events across time is captured on the basis of the relationship-aware graph neural network. Here, the relationship-aware graph neural network is used to model the entity long-term embedding representation of entities and relationships:
[0016]
[0017] in, Represents the long-term embedding representation of the l+1th layer of the graph neural network; and They represent the embedding representations of subject s and object o in the l-th layer of the graph neural network respectively; h rThe global embedding representation of the relation r is given by a long-term dense graph; F g Represents G g A collection of all historical events in; and is a matrix of learnable parameters; φ(·) represents a one-dimensional convolution operation, for example Captures the migration relationship between subject s and the corresponding object o on relationship r; α o is the scaling factor, which is equal to the in-degree of entity o; f(·) is the RReLU activation function. Through the above operations, all entity embedding representations are updated.
[0018] The above step S1 also includes:
[0019] S13 updates the long-term embedding representation of the entity through a recurrent neural network.
[0020] In step S13, the GRU recurrent neural network is used to update the long-term embedding representation of the entity, and the formula is as follows:
[0021]
[0022] in, represents the long-term embedding representation of all entities after being updated by the GRU recurrent neural network. represents the initial embedding representation of all entities in the long-term dense graph, It represents the long-term embedding representation of all entities obtained by several graph neural networks according to step S12.
[0023] After multiple layers of aggregation, recurrent neural networks such as GRU are used to update entity and relationship representations, which can alleviate the long-term dense graph G. g The proposed long-term dense graph can enhance the prediction of future events, which helps to fully capture the long-term dependencies of event evolution.
[0024] The purpose of the above step S2 is to, for a given number of sub-image sequences before the current moment (for example, the most recent m sub-image snapshot sequences {G t-m ,…,G t-1}), using the attention-based relational graph neural network and the double recurrent network to model the recent evolution of events, and obtain a low-dimensional embedding h that can represent the recent evolution preferences of entities and relations e (i.e. h s or o ) and h r, that is, generating an entity embedding vector and a relationship embedding vector containing recent evolution preferences for each entity and relationship.
[0025] The step S2 specifically includes the following sub-steps:
[0026] S21 sorts several subgraph sequences before the current moment, and uses the long-term embedding representation obtained in step S1 as the initial embedding representation;
[0027] S22 uses several layers of relationship-aware graph neural networks to generate entity embedding representations for each subgraph sequence;
[0028] S23 uses a dual training network to construct entity embedding representations and relation embedding representations between consecutive time steps.
[0029] In the above step S21, the short-term TKG is defined as G s = {G t-m ,…,G t-1}, where each vertex represents an event entity e, and edges between vertices represent that the two entities have recently interacted. The long-term embedding representation obtained in step S1 is used as the initial embedding representation, that is, as the first subgraph G t-m The initial input is embedded, and then steps S22 and S23 are executed.
[0030] In the above step S22, a relational graph neural network based on an attention mechanism is used to generate a low-dimensional embedding containing recent evolution preferences for entities and relationships.
[0031] To get G s The present invention designs a relational graph neural network based on the attention mechanism as a semantic integrator to model the recent evolution preferences of entities and relations. Specifically, given a static knowledge graph G τ , where τ belongs to [tm, t-1]. For any object o in the l-th layer of the graph neural network, the representation of object o is obtained by integrating its neighbor entities and corresponding interaction relationships. The update process of object o in the l-th layer of the graph neural network is defined as follows:
[0032]
[0033] in, They represent the embedding vector representation of entity s,o and relation r in the l-th layer of graph neural network at time τ respectively; represents the migration characteristics of subject s to object o through relationship r at time τ, represents the importance coefficient of the message transmitted from subject s to object o through relationship r, represents the set of all events that occurred at the moment τ; and a represent the learnable weight matrix and vector respectively; g(·) represents the LeakyReLU activation function. Thus, through several layers of graph neural network, the embedded representations of entities and relations at each time τ can be obtained. Through the above operations, all entity embedding representations are updated.
[0034] In the above step S23, a dual recurrent network is used to model the sequence pattern of event evolution. Specifically, the present invention uses a first gated recurrent unit (GRU) for entities and a second gated recurrent unit for relations to integrate semantic information between consecutive time steps.
[0035] In particular, the entity embedding representation modeling between consecutive time steps is completed through the first gating unit, and the process is as follows:
[0036]
[0037] Among them, H s / o,τ ∈R |E|×d H represents the d-dimensional entity embedding representation vector matrix input at time τ; s / o,τ-1 ∈R |E|×d Represents the d-dimensional entity embedding representation vector matrix input at time τ-1; Represents the output vector matrix of the last layer of the graph neural network at time τ-1, obtained according to the operation given in step S21.
[0038] At the same time, this step also provides a lazy update strategy to aggregate the semantic representation of entities and update the vector representation of relations. At each time step, an average pooling operation (mean-pooling) and a second gated recurrent unit for relations are used to model the sequence pattern between relations:
[0039]
[0040] H r,τ =GRU(H r,τ-1 ,H′ r,τ ) (7);
[0041] in, h′ represents the entity embedding representation vector matrix of all entities that interact with relation r at time τ; r,τ ∈H′ r,τ The entity is embedded into the vector matrix The mean and relationship of h r The spliced h r represents the embedding representation of relation r; H r,τ and H r,τ-1 ∈R |R|×dThey are the relationship embedding matrices at time τ and time τ-1 respectively.
[0042] The purpose of the above step S3 is to use the entity and relationship embedding vectors containing the long-term and short-term dependencies of event evolution obtained in steps S1 and S2, and use the convolutional migration network as a decoder to calculate the probability of future events from the perspective of the joint effect of long-term and short-term dependencies and give a prediction result.
[0043] The probability of a future event occurring is:
[0044] p(o|s,r,H t ,H r,t )=σH t ConvTransE(h s,t ,h r,t ) (8);
[0045] Among them, σ(·) is the Softmax activation function; H t represents the entity embedding representation vector matrix at time t obtained after step S2, including H s,t and H o,t ;H r,t represents the relation embedding representation vector matrix at time t obtained after step S2; h s,t ,h r,t In H t ,H r,t The embedding vectors corresponding to entity s and relation r in ; ConvTransE(·) is the convolutional transfer network used. After performing the above operations on the embedding matrix obtained in step S2, we obtain the final probability p of the object occurrence, that is, the final probability of the event occurrence, and take the event with the highest probability as the final prediction result.
[0046] Thus, the present invention has realized a knowledge graph reasoning method based on long-term and short-term dependencies. Compared with the prior art, the present invention has the following beneficial effects:
[0047] (1) The present invention is based on the knowledge graph reasoning method of long-term and short-term dependencies. It uses a relationship-aware graph convolutional neural network to model the long-term dependencies of event evolution. By taking advantage of the construction of a long-term dense graph, it does not require a lot of training time and space. The long-term dense graph can well capture the long-term trend of event evolution.
[0048] (2) The knowledge graph reasoning method based on long-term and short-term dependencies of the present invention improves the prediction accuracy of future events by jointly modeling the dynamics of long-term and short-term event evolution and cleverly integrating long-term and short-term predictions in an adaptive way;
[0049] (3) The knowledge graph reasoning method based on long-term and short-term dependencies proposed in the present invention aims to achieve accurate event prediction by learning the long-term and short-term dependencies of event evolution. First, the high-order semantic dependencies and repetitive patterns of long-term interactions of historical events are learned using long-term dense graphs. Secondly, by paying special attention to recent developments, long-term dependencies are adaptively adjusted on this basis to achieve a comprehensive understanding of event evolution. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a flow chart of the knowledge graph reasoning method based on long-term and short-term dependencies of the present invention.
[0051] Explanation of terms
[0052] R-GCN is the abbreviation of Relational Graph Convolutional Neural Networks, which means "relational graph convolutional neural network", that is, a neural network framework for processing relational graph structure data. Its implementation method is referenced in [MS Schlichtkrull and TNKipf, "Modeling relational data with graph convolutional networks," in ESWC, 2018.]
[0053] ConvTransE is the abbreviation of Convolutional Translation Network, which means "convolutional transfer neural network", that is, a neural network model architecture for processing knowledge graph completion. Its implementation method refers to [Shang Cand Tang Y, et al. "End-to-end structure-aware convolutional networks for knowledge base completion," in AAAI, 2019.] DETAILED DESCRIPTION
[0054] The present invention is further described in conjunction with the accompanying drawings.
[0055] Example 1
[0056] As attached Figure 1 As shown, the temporal knowledge graph reasoning method based on long-term and short-term dependencies provided in this embodiment includes the following steps:
[0057] S1 merges several historical subgraph sequences into a long-term dense graph, and uses a relational graph neural network to model the high-order semantic interaction information between events and the repetitiveness of event occurrence, generating a long-term embedding representation of entities containing long-term semantic dependencies for each entity and relationship.
[0058] This step mainly models the evolution of events from the perspective of long-term evolution. Specifically, a relation-aware graph neural network is used to capture the long-term trend of event evolution by compressing a series of historical subgraph snapshots into a unified dense historical subgraph. On this basis, a relational graph neural network is applied to model the high-order semantic interaction dependencies between entities across time and the repetitive patterns of event occurrence.
[0059] This step includes the following sub-steps:
[0060] S11 constructs a long-term dense graph based on several continuous historical subgraph sequences.
[0061] Given M historical subgraphs {G t-m-M ,G t-m-M+1 ,…,G t-m-1}, t represents the timestamp of the event to be predicted, and m represents the number of short-term dependent subgraphs. All entities are retained as nodes, that is, the same entity at different times is regarded as the same node, and the interactions between entities at different times are merged, that is, the time information of the interaction is removed, so that a unified dense history graph G can be obtained. g , that is, the long-term dense graph G g .
[0062] S12 uses several layers of relationship-aware graph neural networks to generate long-term embedding representations of entities that contain long-term semantic dependencies.
[0063] The relationship-aware graph neural network used in this embodiment is R-GCN, and the number of layers of the graph neural network is L (L=2).
[0064] Use relation-aware graph neural networks to model entity long-term embedding representations of entities and relations:
[0065]
[0066] in, Represents the long-term embedding representation of the l+1th layer of the graph neural network; and They represent the embedding representations of subject s and object o in the l-th layer of the graph neural network respectively; h r represents the global embedding representation of relation r; F g Represents G g A collection of all historical events in; and is a matrix of learnable parameters; φ(·) represents a one-dimensional convolution operation, for example Captures the migration relationship between subject s and the corresponding object o on relationship r; α ois the scaling factor, which is equal to the in-degree of entity o; f(·) is the RReLU activation function. Through the above operations, all entity embedding representations are updated.
[0067] S13 updates the long-term embedding representation of the entity through a recurrent neural network.
[0068] Use the GRU recurrent neural network to update the long-term embedding representation of the entity. The formula is as follows:
[0069]
[0070] in, represents the long-term embedding representation of all entities after being updated by the GRU recurrent neural network. represents the initial embedding representation of all entities in the long-term dense graph, It represents the long-term embedding representation of all entities obtained by several graph neural networks according to step S12.
[0071] S2 initializes several subgraph sequences before the current moment using the long-term embedding representation obtained in step S1. Then, for each subgraph sequence, combined with the entity embedding representation and relationship embedding representation of the previous moment, it uses the attention-based relational graph neural network and double loop network to model the recent evolution of events, generating entity embedding representations and relationship embedding representations that include long-term evolutionary dependencies and short-term evolutionary preferences for each entity and relationship.
[0072] This step mainly uses a relationship-aware graph neural network based on the attention mechanism to model the short-term evolution preference of events based on the long-term dependencies learned above, and adaptively adjusts the long-term dependencies to obtain the final entity and relationship embedding representation.
[0073] This step includes the following sub-steps:
[0074] S21 sorts several subgraph sequences before the current moment, and uses the long-term embedding representation obtained in step S1 as the initial embedding representation.
[0075] Define the short-term TKG as G s = {G t-m ,...,G t-1}, where each vertex represents an event entity e, and edges between vertices represent that the two entities have recently interacted. The long-term embedding representation obtained in step S1 is used as the initial embedding representation, that is, as the first subgraph G t-m The initial input embedding (equivalent to the first subgraph G t-m Input initialization), and then execute according to steps S22 and S23.
[0076] For each subgraph sequence, S22 uses several layers of relationship-aware graph neural networks to generate entity embedding representations.
[0077] The relationship-aware graph neural network used in this embodiment is R-GCN.
[0078] Given a static knowledge graph G τ , where τ belongs to [tm, t-1]. For any object o in the l-th layer of the graph neural network, the representation of object o is obtained by integrating its neighbor entities and corresponding interaction relationships. The update process of object o in the l-th layer of the graph neural network is defined as follows:
[0079]
[0080] in, They represent the embedding vector representation of entity s,o and relation r in the l-th layer of graph neural network at time τ respectively; represents the migration characteristics of subject s to object o through relationship r at time τ, represents the importance coefficient of the message transmitted from subject s to object o through relationship r, represents the set of all events that occur at time τ; and a represent the learnable weight matrix and vector respectively; g(·) represents the LeakyReLU activation function. Thus, through several layers of graph neural network, the embedded representations of entities and relations at each time τ can be obtained. Through the above operations, all entity embedding representations are updated.
[0081] S23 uses a dual training network to construct entity embedding representations and relation embedding representations between consecutive time steps.
[0082] This embodiment uses a first gated recurrent unit for entities and a second gated recurrent unit for relations to integrate semantic information between consecutive time steps.
[0083] Specifically, the entity embedding representation modeling between consecutive time steps is completed through the first gating unit, and the process is as follows:
[0084]
[0085] Among them, H s / o,τ ∈R |E|×d H represents the d-dimensional entity embedding representation vector matrix input at time τ; s / o,τ-1 ∈R |E|×d Represents the d-dimensional entity embedding representation vector matrix input at time τ-1; Represents the output vector matrix of the last layer of the graph neural network at time τ-1, obtained according to the operation given in step S21.
[0086] At the same time, at each time step, an average pooling operation and a second gated recurrent unit are used to model the sequential pattern between relations:
[0087]
[0088] H r,τ =GRU(H r,τ-1 ,H′ r,τ ) (7);
[0089] in, h′ represents the entity embedding representation vector matrix of all entities that interact with relation r at time τ; r,τ ∈H′ r,τ The entity is embedded into the vector matrix The mean and relationship of h r The spliced h r represents the embedding representation of relation r; H r,τ and H r,τ-1 ∈R |R|×d They are the relationship embedding matrices at time τ and time τ-1 respectively.
[0090] Figure 1 The specific process of entity embedding and relation embedding at time t-2 and time t-1 is given in . Taking time t-2 as an example, the entity embedding input at time t-2 is represented as H s / o,t-2 ;H s / o,t-2 After the average pooling operation, r H′ r,t-2 ; Hτ r,t-2 and H r,t-3 , through the second gating unit, according to the formula (7) given above, we can get the relation entity embedding H at time t-2 r,t-2 According to H r,t-2 and H s / o,t-2 According to the formula (4) given above, the long-term dependency integration is completed through several layers of graph neural network iterations. Then H s / o,t-2 and The two pass through the first gating unit, and according to the formula (5) given above, the entity embedding representation H of the input at time t-1 can be obtained: s / o,t-1 .
[0091] S3 obtains the final prediction results of future events through the decoder based on the entity embedding representation, relationship embedding representation and known entities at the current moment.
[0092] This embodiment uses a convolutional migration network as a decoder to calculate the probability of future events from the perspective of the combined effects of long-term and short-term dependencies and give a prediction result.
[0093] The probability of a future event occurring is:
[0094] p(o|s,r,H t ,H r,t )=σH t ConvTransE(h s,t ,h r,t ),
[0095] Among them, σ(·) is the Softmax activation function; H t represents the entity embedding representation vector matrix at time t obtained after step S2, including H s,t and H o,t ;H r,t represents the relation embedding representation vector matrix at time t obtained after step S2; h s,τ ,h r,τ In H t ,H r,t The embedding vectors corresponding to entity s and relation r in ; ConvTransE(·) is the convolutional transfer network used. After performing the above operations on the embedding matrix obtained in step S2, we obtain the final probability p of the object occurrence, that is, the final probability of the event occurrence, and take the event with the highest probability as the final prediction result.
[0096] Application Examples
[0097] This application example uses the temporal knowledge graph reasoning method based on long-term and short-term dependencies provided by the embodiment to two different real data sets (ICEWS18 data set, ICEWS05-15 data set, ICEWS14 data set); the source of the former can be found in the reference [J.Woojeong and Q.Meng,et,al.“Recurrent Event Network:AutoregressiveStructure Inferenceover Temporal Knowledge Graphs,”in EMNLP,2020.], and the source of the latter two can be found in [Garcia-Duran,A.;Dumanˇci′c,S,et,al.“Learning Sequence Encoders for Temporal Knowledge Graph Completion,”in EMNLP,2018.]. This application example uses two common indicators for evaluating the effectiveness of the temporal knowledge graph reasoning method: mean reciprocal ranking (MRR) and top K share (Hits@k). The mean reciprocal ranking calculates the average reciprocal ranking of the correct candidate entities in all queries, while the top K share measures the proportion of queries in which the real entity appears in the top k candidates. Here. The K value is 1, 3, and 10. The larger the average reciprocal ranking and the top K percentage, the better the prediction effect.
[0098] At the same time, the temporal knowledge graph reasoning method based on long-term and short-term dependencies (TKG-LDG) provided by the present invention is compared with 8 different baseline models (RE-Net, RE-GCN, CyGNet, CENET, CEN, TITer, GHT, SiMFy). The prediction results are shown in Table 1.
[0099] Table 1: Comparison of prediction results on three datasets
[0100]
[0101] The remaining methods in the table are described as follows:
[0102] RE-Net: uses graph convolutional neural networks and recurrent neural networks to capture the temporal dependencies of event evolution. It uses sequence models to simulate historical interactions between entities. Its implementation process reference W. Jin and M. Qu, et, al. "Recurrent event network: Autoregressive structure inference over temporal knowledge graphs," in ACL, 2020.
[0103] RE-GCN: It uses relational graph convolutional neural networks and recurrent neural networks to model the structural dependencies and sequential patterns of event evolution, and uses the static attributes of entities to extract accurate semantic information. Here, since other compared models do not use additional information, in order to ensure the fairness of the comparison between models, we remove the static attributes in RE-GCN. Its implementation process reference Z.Li, X.Jin, W.Li, S.Guan, J.Guo, H.Shen, Y.Wang, and X.Cheng, "Temporalknowledge graphreasoning based on evolutional representation learning," inSIGIR, 2021.
[0104] CyGNet: It mainly uses the history replication mechanism to identify repeated facts. Its implementation process can be found in C.Zhu and M.Chen,et,al.“Modeling temporal knowledge graphs with sequentialcopy-generation networks,”in AAAI,2021.
[0105] CENET: This model designs a contrastive learning module to distinguish whether the query event has occurred before. Its implementation process reference Y.Xu,J.Ou,H.Xu,and L.Fu,“Temporal knowledgegraph reasoning with historical contrastive learning,”in AAAI,2023.
[0106] CEN: It mainly uses complex length-aware convolutional neural networks to capture the evolutionary dependencies of events with different time spans. Here, since other compared models do not use additional information, in order to ensure the fairness of the comparison between models, we delete the static attributes in CEN. Its implementation process reference Z.Li, S.Guan, et, al "Complex Evolutional Pattern Learning for Temporal Knowledge Graph Reasoning," in ACL, 2022.
[0107] TITer: It mainly adopts reinforcement learning method and uses novel time-based rewards based on Dirichlet distribution to guide model learning. Its implementation process can be found in H.Sun and J.Zhong,et,al.“Timetraveler:Reinforcement learning for temporalknowledge graph forecasting,”in ACL,2021.
[0108] GHT: A Transformer-based method is designed to capture event structure information and time evolution information respectively. The implementation process can be found in H.Sun and S.Geng,et,al.“Graph hawkes transformerfor extrapolated reasoning on temporal knowledge graphs,”in ACL,2022.
[0109] SiMFy: It mainly adopts a simple multi-layer perceptron-based approach to model the complex structural dependencies inherent in event sequences. Its implementation process can be found in Z.Liu and L.Tan,et,al.“SiMFy: A Simple Yet Effective Approach for Temporal Knowledge Graph Reasoning,”inEMNLP,2023.
[0110] It can be seen from the experimental results in Table 1 that the temporal knowledge graph reasoning method based on long-term and short-term dependencies proposed in the present invention can greatly improve the accuracy of event prediction compared with other baseline models.
[0111] It can be seen that the present invention realizes temporal knowledge graph reasoning based on long-term and short-term dependencies, uses a relationship-aware graph convolutional neural network to model the long-term dependencies of event evolution, and takes advantage of the construction of a long-term dense graph. It does not take a lot of training time and space to well capture the high-order semantic dependencies and repetitive patterns of long-term interactions of historical events. On this basis, a relationship-aware graph neural network algorithm based on an attention mechanism is used to model the short-term evolution trend of events. By paying special attention to recent developments, long-term dependencies are adaptively adjusted on this basis to achieve a comprehensive understanding of the evolution of events. By synthesizing the obtained long-term and short-term dependencies, accurate predictions of future events can be achieved.
[0112] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A temporal knowledge graph reasoning method based on long-term and short-term dependencies, characterized in that: The following steps are involved: S1 combines several historical subgraph sequences into a long-term dense graph, and uses a relational graph neural network to model the high-order semantic interaction information between events and the repetitiveness of event occurrences, generating a long-term embedding representation of entities containing long-term semantic dependencies for each entity and relationship; S2 initializes several subgraph sequences before the current moment using the long-term embedding representation obtained in step S1. Then, for each subgraph sequence, combined with the entity embedding representation and relationship embedding representation of the previous moment, the attention-based relational graph neural network and double loop network are used to model the recent evolution of the event, generating entity embedding representation and relationship embedding representation that contain long-term evolution dependency and short-term evolution preference for each entity and relationship. S3 obtains the final prediction results of future events through the decoder based on the entity embedding representation, relationship embedding representation and known entities at the current moment.
2. The temporal knowledge graph reasoning method based on long-term and short-term dependencies according to claim 1 is characterized in that: Step S1 specifically includes the following sub-steps: S11 builds a long-term dense graph based on several continuous historical subgraph sequences; S12 uses several layers of relationship-aware graph neural networks to generate long-term embedding representations of entities that contain long-term semantic dependencies.
3. The temporal knowledge graph reasoning method based on long-term and short-term dependencies according to claim 2 is characterized in that: In step S12, a relation-aware graph neural network is used to model entity long-term embedding representations of entities and relations: in, Represents the long-term embedding representation of the l+1th layer of the graph neural network; and They represent the embedding representations of subject s and object o in the l-th layer of the graph neural network respectively; h r represents the global embedding representation of relation r; F g Represents G g A collection of all historical events in; and is a matrix of learnable parameters; φ(·) represents a one-dimensional convolution operation; α o is the scaling factor; f(·) is the RReLU activation function.
4. The temporal knowledge graph reasoning method based on long-term and short-term dependencies according to any one of claims 1 to 3, characterized in that: Step S1 also includes: S13 updating the entity long-term embedding representation through a recurrent neural network.
5. The temporal knowledge graph reasoning method based on long-term and short-term dependencies according to claim 4 is characterized in that: In step S13, the GRU recurrent neural network is used to update the long-term embedding representation of the entity, and the formula is as follows: in, represents the long-term embedding representation of all entities after being updated by the GRU recurrent neural network. represents the initial embedding representation of all entities in the long-term dense graph, It represents the long-term embedding representation of all entities obtained by several graph neural networks according to step S12.
6. The temporal knowledge graph reasoning method based on long-term and short-term dependencies according to claim 4 is characterized in that: Step S2 specifically includes the following sub-steps: S21 sorts several subgraph sequences before the current moment, and uses the long-term embedding representation obtained in step S1 as the initial embedding representation; S22 uses several layers of relationship-aware graph neural networks to generate entity embedding representations for each subgraph sequence; S23 uses a dual training network to construct entity embedding representations and relation embedding representations between consecutive time steps.
7. The temporal knowledge graph reasoning method based on long-term and short-term dependencies according to claim 6 is characterized in that: In step S22, for any object o in the l-th layer of the graph neural network, the update process in the l-th layer of the graph neural network is defined as follows: in, They represent the embedding vector representation of entity s,o and relation r in the l-th layer of graph neural network at time τ respectively; represents the importance coefficient of the message transmitted from subject s to object o through relationship r, represents the set of all events that occurred at the moment τ; and a represent the learnable weight matrix and vector respectively; g(·) represents the LeakyReLU activation function.
8. The temporal knowledge graph reasoning method based on long-term and short-term dependencies according to claim 7 is characterized in that: In step S23, the entity embedding representation modeling between consecutive time steps is completed by the first gating unit, and the process is as follows: Among them, H s / o,τ ∈R |J|×L H represents the d-dimensional entity embedding representation vector matrix input at time τ; s / o,:F1 ∈R |O|×P Represents the d-dimensional entity embedding representation vector matrix input at time τ-1; Represents the output vector matrix of the last layer of the graph neural network at time τ-1, obtained according to the operation given in step S21; At the same time, at each time step, an average pooling operation and a second gated recurrent unit for relations are used to model the sequential pattern between relations: H r,τ =GRU(H r,τ-1 ,H′ r,τ ) (7); in, h′ represents the entity embedding representation vector matrix of all entities that interact with relation r at time τ; r,τ ∈Hτ r,τ The entity is embedded into the vector matrix The mean and relationship of h r The splicing result; H r,τ and H r,τ-1 ∈R |R|×d They are the relationship embedding matrices at time τ and time τ-1 respectively.
9. The temporal knowledge graph reasoning method based on long-term and short-term dependencies according to claim 7 is characterized in that: In step S3, a convolutional transfer network is used as a decoder.
10. The temporal knowledge graph reasoning method based on long-term and short-term dependencies according to claim 9 is characterized in that: The probability of a future event occurring is: p(o|s,r,H t ,H r,t )=σH t ConvTransE(h s,t ,h r,t ), Among them, σ(·) is the Softmax activation function; H t represents the entity embedding representation vector matrix at time t obtained after step S2, including H s,t and H o,t ;H r,t represents the relation embedding representation vector matrix at time t obtained after step S2; h s,t ,h r,t In H t , H r,t where s is the embedding vector corresponding to entity s and relation r; ConvTransE(·) is the convolutional transfer network used.
Citation Information
Cited By
Intelligent material circulation prediction method and system based on multi-scale time sequence knowledge graph
CN120525115A
Pig farm abortion rate early warning method and system integrating space-time diagram network and knowledge enhancement
CN120996285A
Recurrent neural network-based electronic commerce single time sequence trend prediction method
CN121563649A
