Tensor decomposition-based time dynamic adaptive temporal knowledge graph completion method
By using a time-dynamic adaptive module based on tensor decomposition, and combining time-dependent information from both macroscopic and microscopic perspectives, the fusion weights of entities and time are dynamically adjusted. This solves the problems of insufficient utilization of time information and excessive hyperparameters in existing temporal knowledge graph completion methods, achieving stronger adaptability and accuracy.
Patent Information
- Application Number
- CN202511033826.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-11-11
AI Technical Summary
Existing temporal knowledge graph completion methods fail to adequately model structural changes during temporal evolution and rely on a large number of hyperparameters, making it difficult to generalize to different datasets or real-world scenarios, thus affecting the model's adaptability and scalability.
A time-dynamic adaptive module based on tensor decomposition is adopted. From both macro and micro perspectives, it deeply integrates entity and time information, dynamically adjusts the time integration weight, and combines statistical analysis of the interaction frequency of entities and relationships over time periods to construct a scoring function for missing entity inference.
It significantly improves the modeling ability and reasoning accuracy of temporal evolution patterns in temporal knowledge graph completion tasks, enhances the adaptability and interpretability of the model, and is suitable for large-scale temporal knowledge graph completion tasks.
Smart Images

Figure CN120930744A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to a method for time-dynamic adaptive temporal knowledge graph completion based on tensor decomposition. Background Technology
[0002] In recent years, temporal knowledge graphs have received widespread attention and have been applied in fields such as event prediction, financial risk control, social network analysis, and biomedical research. As the scale of temporal knowledge graphs continues to grow, the completeness and accuracy of their structure become particularly crucial. However, due to limitations in information extraction techniques, data gaps, or noise, a large number of missing facts still exist in temporal knowledge graphs. To enhance the overall completeness of temporal knowledge graphs, the temporal knowledge graph completion task aims to infer missing facts in temporal knowledge graphs.
[0003] To address this challenge, researchers have proposed several representative completion methods, mainly falling into three technical categories: neural network-based methods, geometric space methods, and tensor decomposition methods. Neural network methods utilize structures such as recurrent neural networks, graph neural networks, or attention mechanisms to model entity interaction sequences within a temporal context. Geometric space methods model temporal dynamic trajectories in Euclidean space or hypersphere space to realize the geometric migration of entities over time. Tensor decomposition methods represent the temporal knowledge graph as a fourth-order tensor (head entity × relation × tail entity × time) and decompose it, directly capturing the latent structure between entity relations under temporal conditions. These methods have achieved significant performance improvements in standard temporal knowledge graph completion tasks, laying the technical foundation for this field.
[0004] While the aforementioned methods alleviate the incompleteness of temporal knowledge graphs to some extent, they still have several limitations. First, temporal information is often simplified to auxiliary embeddings or static bias terms, failing to fully model structural changes during temporal evolution, making it difficult for the model to capture long-term and short-term dynamic dependencies. Second, most models rely heavily on extensive hyperparameter tuning and fine-tuning, such as embedding dimensions, hyperparameter weights, and the number of attention heads, which are difficult to generalize to different datasets or real-world scenarios, limiting the adaptability and scalability of the methods. Summary of the Invention
[0005] The purpose of this invention is to provide a time-dynamic adaptive temporal knowledge graph completion method based on tensor decomposition. This method includes a time-dynamic adaptive module that takes a dual time perspective, from both macroscopic and microscopic perspectives. By deeply fusing entity and time information and statistically analyzing the interaction frequency of entities and relationships over time periods, it comprehensively measures the dependence of entities on time information from both perspectives, and then dynamically adjusts the time fusion weights. This effectively solves the problems of insufficient utilization of time information and excessive hyperparameters in existing temporal knowledge graph completion methods.
[0006] To achieve the above-mentioned technical objectives and effects, the present invention is implemented through the following technical solution:
[0007] This invention provides a method for time-dynamic adaptive temporal knowledge graph completion based on tensor decomposition, comprising the following steps:
[0008] S1. Obtain the temporal knowledge graph dataset to be completed;
[0009] S2. Perform tensor decomposition on the elements of the quadruples to generate complex embeddings;
[0010] S3. Deeply fuse the head and tail entity embeddings and the time embeddings respectively;
[0011] S4. Calculate the entity time dependence from a microscopic perspective using a gating function;
[0012] S5. Construct a sliding time window based on the timestamp;
[0013] S6. Statistically analyze the interaction preferences of entity-relationship pairs within the time window to obtain the entity time dependence from a macro perspective;
[0014] S7. Integrate the time dependencies of macroscopic and microscopic entities, and use them together with the embeddings obtained from tensor decomposition to construct a scoring function to infer missing entities.
[0015] Furthermore, in step S1, preprocessing operations such as format unification, deduplication, and index generation are performed on the original data.
[0016] Furthermore, the temporal knowledge graph dataset in step S1 consists of multiple quadruples, each quadruple being represented as (head entity, relation, tail entity, timestamp), and symbolically represented as: Where s and o represent the subject and object entities, r represents the relationship between them, and t represents the timestamp of the current fact.
[0017] Furthermore, the steps for generating complex embeddings in step S2 are as follows:
[0018] S201. Perform tensor decomposition on the head entity, relation, tail entity and timestamp in the quadruple and generate complex embeddings respectively. Each embedding includes a real part and an imaginary part.
[0019] The specific steps are as follows:
[0020] 1) Perform CP tensor decomposition on the head entity, relation, tail entity, and timestamp in the quadruple, and represent the entire temporal knowledge graph as a fourth-order tensor.
[0021] 2) For a given quadruple (s, r, o, t), generate complex embeddings (e...s ,e r ,e o ,e t Each embedding consists of two parts: a real part and an imaginary part.
[0022] S202, Generate two independent complex number embeddings for the timestamp. and They are used respectively for time fusion operations of the head entity and the tail entity.
[0023] Furthermore, the deep fusion steps in step S3 are as follows:
[0024] S301. The complex embedding representation of the head entity is combined with the independent temporal complex embedding generated in step S202. By performing nonlinear transformations and combinations, the fused head entity-temporal complex embedding e is obtained. st ;
[0025] S302, Combine the complex embedding representation of the tail entity with the second independent temporal complex embedding generated in step S202. Deep fusion is performed in the same manner as in S301 to obtain the fused tail entity-temporal complex embedding e. ot .
[0026] Furthermore, the steps for calculating the entity time dependence from a microscopic perspective in step S4 are as follows:
[0027] S401, Integrating the deeply fused entity-time complex embedding e through a gated function st and e ot The real and imaginary parts;
[0028] S402. Perform vectorized averaging on the results of step S401 to obtain the time dependence G of the head and tail entities from a microscopic perspective. s and G o .
[0029] Furthermore, the sliding time window in step S5 uses the timestamp t in the current quadruple. i Centered on a time window of fixed length 2δ[t], a time window of [t] is set. i -δ,t i +δ] forms a time window containing contextual information, used to statistically analyze the historical behavior of entity-relationships.
[0030] Furthermore, the steps for calculating the entity time dependency from a macroscopic perspective in step S6 are as follows:
[0031] S601. Count the frequency of occurrence of entity-relation pairs in the sliding time window within each time window to obtain the sequence. and This reflects their behavioral preferences;
[0032] S602. Normalize the frequency data obtained in step S601 to obtain the time dependence T of the head and tail entities from a macroscopic perspective. s and T o .
[0033] Furthermore, the reasoning steps for the missing entity in step S7 are as follows:
[0034] S701, Combine the entity time dependence G obtained from steps S4 and S6 from the macroscopic and microscopic perspectives. s With T s and G o and T o The components are integrated sequentially to obtain the overall head entity temporal dependency α and the overall tail entity temporal dependency β, which are used as the weights for the fusion of head and tail entity embeddings and independent temporal embeddings in the scoring function.
[0035] S702. Using the overall time dependence α and β obtained in step S701 as weights, apply the tensor decomposition-generated entity embedding e... s and e o With independent temporal embedding and The weighted combination is performed to generate the final embedded representation used for scoring;
[0036] S703, Embed the merged head entity Embedded with tail entity and the relation embedding e generated in step S201 r With time embedding The input is fed into a scoring function, which evaluates the reasonableness of candidate entities based on their scores, thereby enabling reasoning for missing entities. The scoring function formula is as follows:
[0037]
[0038] This invention also provides a system for time-dynamic adaptive temporal knowledge graph completion based on tensor decomposition, comprising:
[0039] The Tensor Decomposition module maps the head entity, relation, tail entity, and timestamp in the quadruple of the temporal knowledge graph to complex embedding representations to capture complex semantic structures. This module constructs basic high-order tensor representations to provide input for subsequent temporal dependency modeling.
[0040] The time-dynamic adaptive module models the dependence of entities on time from both micro and macro perspectives. The micro perspective integrates entity and time embeddings and uses a gating mechanism to dynamically extract micro-perspective time behavior features. The macro perspective uses a sliding time window to statistically analyze the interaction preferences of entity-relationship pairs and capture macro-time evolution patterns. Finally, the two are merged to dynamically adjust the entity time weights.
[0041] The model training module is used to optimize parameters during the training phase and output the results in conjunction with the quadruplet scoring function. This module optimizes the model based on a multi-class time-aware loss function.
[0042] The temporal knowledge graph reasoning module is responsible for reasoning about missing entities using a pre-trained model during the reasoning phase. It calculates and ranks candidate entity scores, and selects the top-ranked entity as the reasoning result.
[0043] The beneficial effects of this invention are:
[0044] 1. The time-dynamic adaptive module proposed in this invention adopts a dual-time perspective modeling framework combining macroscopic and microscopic perspectives. This framework comprehensively characterizes the multi-level dependencies of entities on time in temporal knowledge graphs, significantly improving the modeling ability and inference accuracy of temporal evolution patterns in completion tasks. The microscopic perspective achieves deep interaction between entities and temporal embeddings through a tensor fusion mechanism, and dynamically models fine-grained behavioral changes of entities at different time points using learnable gating functions, thereby effectively capturing the time-dependent characteristics of entities from a microscopic perspective. The macroscopic perspective, based on a sliding time window, statistically analyzes the interaction preferences of entity-relationship pairs, characterizing their long-term evolutionary trends and periodic patterns over time series, thus supplementing the time-dependent information of entities from a macroscopic perspective and enhancing the global consistency of time modeling.
[0045] 2. By integrating temporal dependency information at both macro and micro levels, this invention can dynamically adjust the contribution weight of temporal dependencies to the final embedded representation, giving the model stronger adaptability and expressive power. Simultaneously, this structure improves the interpretability of temporal modeling, facilitating the analysis of dynamic interaction mechanisms between entities, relationships, and time. Furthermore, the tensor decomposition framework exhibits good parameter efficiency and structural scalability, making the method applicable to large-scale temporal knowledge graph completion tasks. It also promotes the development of temporal knowledge reasoning technology while balancing accuracy, efficiency, and interpretability.
[0046] Of course, any product implementing this invention does not necessarily need to achieve all of the above advantages at the same time. Attached Figure Description
[0047] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a schematic diagram of the overall process of the method of the present invention;
[0049] Figure 2 This is a block diagram of the overall structure of the system of the present invention. Detailed Implementation
[0050] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0051] This embodiment provides a time-dynamic adaptive temporal knowledge graph completion method based on tensor decomposition, including the following steps:
[0052] Step S1: Input the entire temporal knowledge graph, as shown in Table 1:
[0053] Table 1
[0054] s r o t Michael Sata Demand Sylvia Masebo 2014-03-16 Barack Obama Make statement Japan 2014-04-24 Canada Make a visit New Zealand 2014-11-13 China Make statement Thailand 2014-12-24
[0055] The temporal knowledge graph dataset consists of multiple quadruples, each represented as (head entity, relation, tail entity, timestamp), and symbolically represented as: Here, s and o represent the head entity and tail entity, r represents the relationship between them, and t represents the timestamp of the current fact. In actual processing, the entities, relations, and timestamps in the original quadruples are uniformly mapped to corresponding index numbers to facilitate subsequent tensor encoding and embedding representation learning. This indexing process can be accomplished by constructing entity dictionaries, relation dictionaries, and time dictionaries, ensuring that the input data structure is standardized and adapted to the input format of the tensor decomposition and temporal modeling modules.
[0056] Step S2: Perform tensor decomposition on the elements of the quadruples to generate complex embeddings. The specific steps are as follows:
[0057] S201. Perform tensor decomposition on the quadruple (s,r,o,t) to generate complex embeddings, each of which includes a real part and an imaginary part.
[0058] The specific steps are as follows:
[0059] 1) Perform CP tensor decomposition on the head entity, relation, tail entity, and timestamp in the quadruple, and represent the entire temporal knowledge graph as a fourth-order tensor. |e|、 Let represent the size of the entity set, relation set, and time set, respectively. The CP tensor decomposition formula is as follows:
[0060]
[0061] 2) For a given quadruple (s,r,o,t), extend all CP decomposition embeddings to the complex space, i.e., each embedding consists of a real part and an imaginary part, formally represented as:
[0062] e s =a s +b s i
[0063] e r =a r +b r i
[0064] e o =a o +b o i
[0065] e t =a t +b t i,
[0066] Among them, e s and e o Represents head entity embedding and tail entity embedding, e r Represents relational embedding, e t This represents the time embedding at timestamp t, where i represents the imaginary unit. These are the real and imaginary parts, respectively, and k is the embedding depth.
[0067] S202, Generate two independent complex number embeddings for the timestamp. and They are used respectively for time fusion operations of the head entity and the tail entity.
[0068] Step S3: Perform deep fusion on the head and tail entity embeddings and the time embeddings respectively. The specific operation steps are as follows:
[0069] S301. Obtain the complex embedding representation of the head entity and compare it with the first independent temporal complex embedding generated in step S202. Deep fusion is performed. This process includes nonlinear transformations and combination operations to model the contextual interactions between entities and time, ultimately yielding the fused head entity-time complex embedding, denoted as e. st .
[0070] S302, In the same manner as S301, the complex embedding representation of the tail entity is combined with the second independent time complex embedding. Perform deep fusion to obtain the fused tail entity-temporal complex embedding, denoted as e. ot .
[0071] The above-mentioned entity-time fusion process can be completed through tensor concatenation operations. The specific entity-time fusion embedding calculation method is as follows:
[0072]
[0073] in, This represents a tensor concatenation operation. Through this fusion mechanism, the dynamic representation capability of entities embedded in specific temporal contexts can be significantly enhanced, providing support for subsequent entity temporal dependency computations.
[0074] Step S4: Calculate the entity time dependency from a microscopic perspective using a gating function. The specific steps are as follows:
[0075] S401. Obtain the head entity-temporal fusion embedding vector e obtained in step S3. st With tail entity-temporal fusion embedding vector e ot The data are then fed into a learnable gating function. The gating function integrates the real and imaginary parts of each embedding through an activation function, thereby automatically adjusting the contribution of different parts to the final representation and obtaining a dynamically adjusted entity temporal dependency vector.
[0076] S402. Perform a vectorized averaging operation on the fusion result output in step S401, and calculate the dependence of the head entity and the tail entity in the current time context to obtain the time dependence G of the head and tail entities from a microscopic perspective. s and G o The calculation method for entity time dependence from a microscopic perspective is as follows:
[0077]
[0078] in, d = k × b × 2, where k is the tensor embedding dimension and b is the batch size. These complex embeddings are obtained through deep fusion of independent temporal embeddings and entity embeddings, and σ(·) is the sigmoid activation function. Through the above micro-dependency modeling process, the behavioral change trends of entities at different time points can be captured from the local temporal context, enhancing the model's ability to perceive fine-grained temporal dynamics and providing micro-level support for time-weighted fusion and scoring inference.
[0079] Step S5: Using the timestamp t corresponding to the current quadruple... i Centered on a sliding time window of fixed length 2δ, the time range is [t] i -δ,t i The context time interval is defined by +δ]. This time window contains contextual information before and after the current time point, used to extract historical interaction features of entities and relationships from the time series. Within this window, by traversing all historical quadruples, the frequency of occurrence or interaction behavior of each entity-relationship pair within this time period is statistically analyzed, thus forming a type of time-based behavioral statistical feature, providing basic data support for subsequent macroscopic time dependency calculations.
[0080] Step S6: Analyze the interaction preferences of entity-relationship pairs within the statistical time window to obtain the entity time dependency from a macro perspective. The specific steps are as follows:
[0081] S601. Within the time window constructed in step S5, traverse the historical quadruples, count the frequency of each entity-relationship pair, and record the number of times the head entity and tail entity interact with a specific relationship within this time period, forming a frequency sequence, denoted as . and This statistical data reflects the behavioral activity and interaction preferences of entities within different time windows, and is an important basis for measuring their long-term time dependence. The statistical formula is as follows:
[0082]
[0083] Where t(·) represents the time window [t i -δ,t i The set of quadruples that match entity relation pairs within +δ].
[0084] S602. Normalize the frequency sequence obtained in step S601 to eliminate interference caused by differences in the frequency of different entities. The normalized result is denoted as T. s and T o This represents the time dependency between the head and tail entities from a macroscopic perspective. The normalized calculation formula is:
[0085]
[0086] Here, quad represents the number of all quadruples in the dataset. Through the above macro-statistical methods, this embodiment can extract the periodic and trend characteristics of entity-relationship interactions from a global time horizon, capture long-term evolution patterns, and provide macro-level supplementary information for time dynamics modeling.
[0087] Step S7: Integrate the time dependencies of macroscopic and microscopic entities, and construct a scoring function together with tensor decomposition embedding to infer missing entities. The specific operation steps are as follows:
[0088] S701, The microscopic perspective entity time dependence G obtained in step S4 s and G o The macroscopic entity time dependence T obtained in step S6 s and T o The data is integrated using an average aggregation method to obtain the overall head entity time dependency α and tail entity time dependency β. This overall dependency is used to dynamically adjust the degree of entity-time fusion in the scoring function, enhancing the guiding ability of the temporal context on entity representation. The formula for calculating the overall head and tail entity time dependencies is as follows:
[0089]
[0090] S702. Using the overall time dependency α and β obtained in step S701 as weights, the head entity embedding and tail entity embedding e generated during tensor decomposition are... s and e o Each of the two independent time embeddings obtained in step S202 is compared with the other two. and The weighted combination is performed to generate the final entity fusion representation used for scoring.
[0091] S703, Embed the merged head entity Tail entity embedding The relation embedding and time embedding generated in step S201 are input together into the scoring function. By calculating the score of each candidate entity, its reasonableness as a component of the quadruple is evaluated, thereby achieving reasoning for missing entities. The scoring function used is as follows:
[0092]
[0093] By fusing dynamically adjusted entity representations with structural semantic representations, the model's reasoning ability in temporal reasoning scenarios is significantly improved. Compared to traditional static modeling methods, this approach can dynamically perceive temporal evolution patterns, enhance the modeling ability for time-sensitive behaviors, and improve reasoning accuracy and interpretability.
[0094] Combination Figure 2 As shown, this embodiment also provides a completion system based on tensor decomposition and a time-dynamically adaptive temporal knowledge graph, including: a tensor decomposition module, a time-dynamically adaptive module, a model training module, and a temporal knowledge graph inference module. Details are as follows:
[0095] The Tensor Decomposition module maps the head entity, relation, tail entity, and timestamp in a temporal knowledge graph to complex embedding representations. This captures complex semantic structures. The module constructs a foundational high-order tensor representation, providing input for subsequent temporal dependency modeling.
[0096] The time-dynamic adaptive module models the dependence of entities on time from both micro and macro perspectives. The micro perspective integrates entity and time embeddings, dynamically extracting micro-level temporal behavioral features using a gating mechanism. The macro perspective uses a sliding time window to statistically analyze the interaction preferences of entity-relationship pairs, capturing macro-level temporal evolution patterns. Finally, the two are merged to dynamically adjust the entity's time weight.
[0097] Model training module: Used to optimize parameters during the training phase and output results in combination with the quadruplet scoring function. This module optimizes the model based on a multi-class time-aware loss function.
[0098] Temporal Knowledge Graph Reasoning Module: This module is responsible for reasoning about missing entities using a pre-trained model during the reasoning phase. It calculates and ranks candidate entity scores, and selects the top-ranked entity as the reasoning result.
[0099] The specific application of this embodiment is as follows:
[0100] I. Dataset and Experiment Setup
[0101] In this embodiment, three different types of public datasets are used: ICEWS14, GDELT, and YAGO15k. ICEWS14 originates from the International Crisis Early Warning System (ICEWS) and primarily contains interaction events between state actors at different points in time. YAGO15k is a subset extracted from the YAGO knowledge base, incorporating structured entity relationships and timestamp information. The GDELT dataset is based on global news events, covering a wide range and a long time span, recording numerous dynamic interactions between transnational entities. Statistical information for these three datasets is shown in Table 2.
[0102] Table 2
[0103] Dataset #Entities #Relations #Timestamps #train #validation #test ICEWS14 7128 230 365 72826 8941 8963 YAGO15k 15403 34 198 110441 13815 13800 GDELT 500 20 366 2735685 341961 341961
[0104] The model performance was evaluated using four commonly used evaluation metrics for knowledge graph completion: Hits@1, Hits@3, Hits@10, and MRR (Mean Reciprocal Ranks). MRR is the average of the reciprocals of correct entity rankings, while Hits@1, Hits@3, and Hits@10 represent the percentages of correct entities ranking first, third, and tenth, respectively. Generally, higher MRR, Hits@1, Hits@3, and Hits@10 indicate better model performance.
[0105] II. Knowledge Graph Completion Results
[0106] In this embodiment, application testing is performed by inputting missing quadruplets into the model, where the tail entity represents the missing item, as shown in Table 3:
[0107] Table 3
[0108]
[0109] As shown in Table 3, the method provided in this embodiment can effectively perform reasoning on missing quadruplets.
[0110] The proposed TDAComplEx achieves state-of-the-art results on all three datasets across all four evaluation metrics (MRR, Hits@1, Hits@3, and Hits@10), comprehensively outperforming all baseline methods. Specifically, compared to the mainstream model FTPComplEx, TDAComplEx maintains high accuracy on ICEWS14, and improves MRR by 5.2% and 23.5% on YAGO15k and GDELT, respectively, demonstrating strong generalization ability across different data structures and time patterns.
[0111] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to specific implementations. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A method for time-dynamic adaptive temporal knowledge graph completion based on tensor decomposition, characterized in that, Includes the following steps: S1. Obtain the temporal knowledge graph dataset to be completed; S2. Perform tensor decomposition on the elements of the quadruples to generate complex embeddings; S3. Deeply fuse the head and tail entity embeddings and the time embeddings respectively; S4. Calculate the entity time dependence from a microscopic perspective using a gating function; S5. Construct a sliding time window based on the timestamp; S6. Statistically analyze the interaction preferences of entity-relationship pairs within the time window to obtain the entity time dependence from a macro perspective; S7. Integrate the time dependencies of macroscopic and microscopic entities, and construct a scoring function together with the embeddings obtained from tensor decomposition to infer missing entities.
2. The method according to claim 1, characterized in that, The temporal knowledge graph dataset in step S1 consists of multiple quadruples, symbolically represented as: Where s and o represent the subject and object entities, r represents the relationship between them, and t represents the timestamp of the current fact.
3. The method according to claim 1, characterized in that, The steps for generating complex number embeddings in step S2 are as follows: S201. Perform tensor decomposition on the head entity, relation, tail entity and timestamp in the quadruple and generate complex embeddings respectively. Each embedding includes a real part and an imaginary part. The specific steps are as follows: 1) Perform CP tensor decomposition on the head entity, relation, tail entity, and timestamp in the quadruple, and represent the entire temporal knowledge graph as a fourth-order tensor. 2) For a given quadruple (s, r, o, t), generate complex embeddings (e... s ,e r ,e o ,e t Each embedding consists of two parts: a real part and an imaginary part. S202, Generate two independent complex number embeddings for the timestamp. and They are used respectively for participating in the time fusion operation of the head entity and the tail entity.
4. The method according to claim 3, characterized in that, The deep fusion steps in step S3 are as follows: S301. The complex embedding representation of the head entity is combined with the independent temporal complex embedding generated in step S202. By performing nonlinear transformations and combinations, the fused head entity-temporal complex embedding e is obtained. st ; S302, Combine the complex embedding representation of the tail entity with the second independent temporal complex embedding generated in step S202. Deep fusion is performed in the same manner as in S301 to obtain the fused tail entity-temporal complex embedding e. ot .
5. The method according to claim 4, characterized in that, The steps for calculating the entity time dependence from a microscopic perspective in step S4 are as follows: S401, Integrating the deeply fused entity-time complex embedding e through a gated function st and e ot The real and imaginary parts; S402. Perform vectorized averaging on the results of step S401 to obtain the time dependence G of the head and tail entities from a microscopic perspective. s and G o .
6. The method according to claim 5, characterized in that, The sliding time window in step S5 uses the timestamp t in the current quadruple. i Centered on a time window of fixed length 2δ[t], a time window of [t] is set. i -δ,t i +δ] forms a time window containing contextual information, used to statistically analyze the historical behavior of entity-relationships.
7. The method according to claim 6, characterized in that, Step S6, the calculation steps for entity time dependence from a macroscopic perspective, are as follows: S601. Count the frequency of occurrence of entity-relation pairs in the sliding time window within each time window to obtain the sequence. and This reflects their behavioral preferences; S602. Normalize the frequency data obtained in step S601 to obtain the time dependence T of the head and tail entities from a macroscopic perspective. s and T o .
8. The method according to claim 7, characterized in that, The reasoning steps for missing entities in step S7 are as follows: S701, Combine the entity time dependence G obtained from steps S4 and S6 from the macroscopic and microscopic perspectives. s With T s and G o and T o The components are integrated sequentially to obtain the overall head entity temporal dependency α and the overall tail entity temporal dependency β, which are used as the weights for the fusion of head and tail entity embeddings and independent temporal embeddings in the scoring function. S702. Using the overall time dependence α and β obtained in step S701 as weights, apply the tensor decomposition-generated entity embedding e... s and e o With independent temporal embedding and The weighted combination is performed to generate the final embedded representation used for scoring; S703, Embed the merged head entity Embedded with tail entity and the relation embedding e generated in step S201 r With time embedding The input is fed into a scoring function, which evaluates the reasonableness of candidate entities based on their scores, thereby enabling reasoning for missing entities. The scoring function formula is as follows: 。 9. A system for time-dynamic adaptive temporal knowledge graph completion based on tensor decomposition, characterized in that, include: The tensor decomposition module is used to map the head entity, relation, tail entity and timestamp in the quadruple of the temporal knowledge graph to complex embedding representations. This module is used to capture complex semantic structures; it constructs a basic high-order tensor representation, providing input for subsequent time-dependent modeling. The time-dynamic adaptive module models the dependence of an entity on time from both micro and macro perspectives. A microscopic perspective integrates entity and temporal embedding, and uses a gating mechanism to dynamically extract microscopic temporal behavior features; The macro perspective uses a sliding time window to statistically analyze the interaction preferences of entity-relationship pairs and capture macro-temporal evolution patterns; ultimately, the two are merged to dynamically adjust the temporal weights of entities. The model training module is used to optimize parameters during the training phase and output the results in conjunction with the quadruplet scoring function. This module optimizes the model based on a multi-class time-aware loss function. The temporal knowledge graph reasoning module is responsible for reasoning about missing entities using a pre-trained model during the reasoning phase. It calculates and ranks candidate entity scores, and selects the top-ranked entity as the reasoning result.