Time sequence knowledge graph completion method and device based on time sequence point process
By combining a multi-relation graph convolutional neural network based on temporal point processes and a two-dimensional convolutional network, the problem of the failure to effectively utilize temporal attributes in temporal knowledge graphs is solved, and efficient and accurate entity and relation completion is achieved.
Patent Information
- Application Number
- CN202610224452.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-25
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2046-02-25
AI Technical Summary
Existing technologies fail to effectively utilize time attributes in time-series knowledge graph completion tasks, resulting in inaccurate prediction of missing knowledge and low efficiency of manual annotation, which cannot meet the needs of data growth.
A multi-relation graph convolutional neural network based on temporal point processes is adopted. By classifying nodes in the temporal knowledge graph, entity static embedding matrices and relation embedding matrices are obtained. Linear feature modulation is performed by combining a two-dimensional convolutional network to calculate node confidence to fill in missing entities or relations.
It improves the accuracy and efficiency of time-series knowledge graph completion, can automatically adjust the importance of historical information, performs well on rare data, reduces inference time, and meets the needs of a large number of inference objectives.
Smart Images

Figure CN122087127B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph completion technology, and in particular to a method and apparatus for completing a time-series knowledge graph based on time-series point processes. Background Technology
[0002] Knowledge graphs are a widely used way to represent real-world facts, supporting various knowledge-driven tasks such as information retrieval, natural language understanding, recommendation systems, and healthcare. Temporal knowledge graphs differ in that the edges between nodes simultaneously contain the relationships between entities and the time to which those relationships belong. As knowledge graphs grow in size, their completeness becomes a significant issue. Traditional methods rely on manual annotation of missing data to obtain high-quality graphs, but this is inefficient and labor-intensive, far from meeting the demands of data growth. Therefore, researching time-aware event prediction models is crucial for inferring missing facts from existing graphs.
[0003] While existing work has achieved good results in the task of temporal knowledge graph completion, current techniques only represent changes in time by the evolutionary differences at different moments when learning the evolutionary trend of events, ignoring the characteristics of time as an intrinsic attribute. This results in these models being unable to effectively utilize relevant past knowledge and make accurate predictions for current missing knowledge. Therefore, how to effectively incorporate the temporal attribute into the learning of the evolutionary process is a problem worthy of in-depth investigation. Summary of the Invention
[0004] Based on this, it is necessary to propose a method and apparatus for completing a time-series knowledge graph based on time-series point processes to address the above problems.
[0005] A temporal knowledge graph completion method based on time-series point processes is proposed to complete the missing subject entity, object entity, or relation entity in the fact set = {subject entity, relation entity, object entity, time} of the temporal knowledge graph, where the fact set is a quadruple to be completed. The method includes:
[0006] S1: Classify the nodes in the input time-series knowledge graph, and obtain the entity static embedding matrix and relation embedding matrix based on the classification results;
[0007] S2: Using [Scholar D, Citation, P, 2025-09-01] as the quadruple to be completed, select the corresponding subgraph in the temporal knowledge graph based on the quadruple to be completed, that is, select the subgraph composed of event quadruples with a time less than "2025-09-01", and embed the subgraph, entity static embedding matrix, and relation embedding matrix. The input is fed into a multi-relation graph convolutional neural network based on time-series point processes to obtain the entity dynamic embedding matrix; the relation embedding matrix is not updated; "Scholar D" is the subject entity, "Citation" is the relation entity, "P" is the object entity to be completed, and "2025-09-01" is the time;
[0008] S3: Based on the dynamic embedding matrix of entities using "scholar D" The corresponding scholar D time-series information embedding and the citation relationship embedding in the relationship embedding matrix are used to perform linear feature modulation on the convolution kernel parameters of the two-dimensional convolutional network to obtain the model parameters of the two-dimensional convolutional network specific to the quadruple to be completed.
[0009] S4: Calculate the confidence level of each node in the time-series knowledge graph using the updated model parameters and entity dynamic embedding matrix, and select the node with the highest confidence level as the object entity to be completed in the quadruple to be completed.
[0010] In one embodiment, classifying the nodes in the input time-series knowledge graph and obtaining the entity static embedding matrix and relation embedding matrix based on the classification results includes:
[0011] S1.1: Execute a community detection algorithm on the time-series knowledge graph to obtain the community type of all nodes, and each node belongs to a community;
[0012] S1.2: Remove the edges between nodes belonging to different communities in the temporal knowledge graph to obtain a disconnected graph that only contains the internal relationships of different communities; after randomly initializing the entity embedding matrix and the initial relationship embedding matrix, the system applies a graph convolutional neural network to the disconnected graph for message passing and node state updates. The updated node embedding obtained from the graph convolutional neural network is the entity static embedding matrix that contains community relationships; the randomly initialized initial relationship embedding matrix is the obtained relationship embedding matrix.
[0013] In one embodiment, the community detection algorithm is the Louvain algorithm, and the formula for calculating the module degree gain of each node is:
[0014]
[0015] in, It is a node Rather than the sum of the edge weights between all nodes in the community to which it will be assigned, It is a node With time-series knowledge graphs The sum of the weights of the edges between all nodes. It is a time-series knowledge graph The sum of the weights of all edges, in this embodiment the weights of all edges are 1; for the time-series knowledge graph Repeatedly calculate the modularity gain of all nodes Until the module degree gain At that time, the resulting multiple communities achieve the node type division.
[0016] In one embodiment, the entity static embedding matrix The specific implementation process is as follows:
[0017]
[0018] in, It is a node The updated node embedding In the non-connected map In and nodes A set of nodes that have relationships. It is the product of the square roots of the node degrees, that is , It is an activation function. For nodes From randomly initialized entity embedding matrix The first initial embedding obtained in the process; It is a node From randomly initialized entity embedding matrix The second initial embedding obtained in the process; It is a node and nodes The connecting edges between them are embedded from the initial relation matrix. The third initial embedding obtained in the process; for non-connected graphs Each node in the time sequence knowledge graph Each node in the matrix has its updated node embedding calculated, and the multiple node embeddings together constitute the entity static embedding matrix. .
[0019] In one embodiment, the entity dynamic embedding matrix The process of obtaining it is as follows:
[0020] The first step of the multi-relation graph convolutional neural network (RGCN) based on time-series process The formula for updating the node state of a layer is:
[0021]
[0022] in, for The nodes are obtained from a multi-relation graph convolutional neural network based on time-series point processes. Embedding of time-series information; yes The nodes are obtained from a multi-relation graph convolutional neural network based on time-series point processes. Embedding of time-series information, when At that time, the input value is from the entity static embedding matrix. The corresponding node embedding obtained from the process; yes The nodes are obtained from a multi-relation graph convolutional neural network based on time-series point processes. Embedding of time-series information, when At that time, the input value is from the entity static embedding matrix. The corresponding node embedding obtained from the process; To embed the relation matrix The relational embedding obtained from it; It is a node exist Historical neighbors before that time, i.e. , For subgraphs; and It is a connection node With nodes The edges and their corresponding times; It is the conditional intensity function of a time series process, defined as ,function , It is a learnable constant term used to control the decay rate; It is a node The degree; It is the first The first weight matrix embedded in the layer is used to update the node itself. It is the first The second weight matrix used in the layer to update the messages received by the node is a learnable parameter. For activation functions;
[0023] Time series knowledge graph Each node in the matrix calculates the updated temporal information embedding, and these temporal information embeddings together constitute the entity dynamic embedding matrix. .
[0024] In one embodiment, the "scholar D" is used in the entity dynamic embedding matrix. The corresponding scholar D time series information embedding and "references" in the relation embedding matrix The corresponding reference relationship is embedded in Convolution kernel parameters for 2D convolutional networks Linear feature modulation is performed to obtain the model parameters of the 2D convolutional network specific to the quadruples to be completed. include:
[0025] S3.1: Dynamic Embedding Matrix from Entities The embedding of the time series information of scholar D corresponding to "scholar D" is obtained from the data. From the relation embedding matrix Retrieving the reference relationship embedded in the "reference" Embedded based on the time-series information of scholar D and the embedded reference relationship Scaling factors were obtained respectively. and offset factor ;
[0026] S3.2: By scaling factor and offset factor The convolution kernel parameters of the two-dimensional convolutional network Update to model parameters .
[0027] In one embodiment,
[0028] The scaling factor and the offset factor They are obtained respectively through the following expressions:
[0029]
[0030]
[0031] in, This is the scaling factor; Offset factor; Embedding time-series information for scholar D; Embedded for reference relationships; It is a vector concatenation operation; For activation functions; , Both are weight matrices; All are biased. All of these are learnable parameters.
[0032] In one embodiment, the model parameters of the quadruplets to be completed It can be obtained through the following expression:
[0033]
[0034] in, These are model parameters; These are the convolution kernel parameters of the two-dimensional convolutional network; It is the Hadamard product of a matrix, which is the product of corresponding elements.
[0035] In one embodiment, a time-series knowledge graph Confidence level of each node It can be obtained through the following expression:
[0036]
[0037] in, It is a node The embedding of temporal information from the entity dynamic embedding matrix Obtained from; This represents the concatenation of vectors in two dimensions. This is the weight matrix; Operations representing flattened vectors; It is the activation function, and the final result is... That is, a node Confidence level; Embedding time-series information for scholar D; Embedded for reference relationships.
[0038] A temporal knowledge graph completion device based on time-series point processes, the device comprising:
[0039] The embedding initialization module classifies the nodes in the input time-series knowledge graph and obtains the entity static embedding matrix and relation embedding matrix based on the classification results.
[0040] The temporal information fusion module takes [Scholar D, Citation, P, 2025-09-01] as the quadruple to be completed. Based on the quadruple to be completed, it selects the corresponding subgraph in the temporal knowledge graph, that is, selects the subgraph composed of event quadruples with a time less than "2025-09-01". The subgraph, entity static embedding matrix and relation embedding matrix are input into the multi-relation graph convolutional neural network based on temporal point process to obtain the entity dynamic embedding matrix; the relation embedding matrix is not updated; "Scholar D" is the subject entity, "Citation" is the relation entity, "P" is the object entity to be completed, and "2025-09-01" is the time.
[0041] The linear feature modulation module, based on "scholar D" in the entity dynamic embedding matrix The corresponding scholar D time-series information embedding and the citation relationship embedding in the relationship embedding matrix are used to perform linear feature modulation on the convolution kernel parameters of the two-dimensional convolutional network to obtain the model parameters of the two-dimensional convolutional network specific to the quadruple to be completed.
[0042] The inference completion module is used to dynamically embed the model using updated model parameters and entity embedding matrices. The confidence level of each node in the temporal knowledge graph is calculated, and the node with the highest confidence level is selected as the object entity to be completed in the quadruple to be completed.
[0043] This invention incorporates time-series processes into graph neural networks, automatically adjusting the importance of historical information at different times; it uses linear feature modulation to adjust model parameters according to different inference objectives, achieving good performance even on rare data; the inference process can be performed in batches, taking less time when there are many inference objectives; the trained model can simultaneously meet the needs of completing missing entities or relationships without requiring separate training. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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.
[0045] in:
[0046] Figure 1 This is an application environment diagram of a temporal knowledge graph completion method based on time-series point processes in one embodiment;
[0047] Figure 2 This is a flowchart of a temporal knowledge graph completion method based on time-series point processes in one embodiment;
[0048] Figure 3 This is a structural block diagram of a temporal knowledge graph completion device based on time-series point processes in one embodiment;
[0049] Figure 4 This is a structural block diagram of a computer device in one embodiment. 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] To address the technical problems in the background art, this application provides a method for completing a time-series knowledge graph based on time-series point processes.
[0052] Figure 1 This is a diagram illustrating the application environment of a temporal knowledge graph completion method based on time-series point processes in one embodiment. (Refer to...) Figure 1This time-series knowledge graph completion method based on time-series process points is applied to a time-series knowledge graph completion system based on time-series process points. The system includes a terminal 110 and a server 120. The terminal 110 and server 120 are connected via a network. The terminal 110 can be a desktop terminal or a mobile terminal; a mobile terminal can be at least one of a mobile phone, tablet, or laptop. The server 120 can be a standalone server or a server cluster consisting of multiple servers. The terminal 110 is used to classify the nodes in the input time-series knowledge graph and obtain the entity static embedding matrix and relation embedding matrix based on the classification results. The server 120 uses [scholar D, citation, P, 2025-09-01] as the quadruple to be completed. Based on the quadruple to be completed, it selects the corresponding subgraph in the time-series knowledge graph, that is, selects the subgraph composed of event quadruples with a time less than "2025-09-01". The subgraph, entity static embedding matrix, and relation embedding matrix are then integrated. The input is fed into a multi-relation graph convolutional neural network based on time-series point processes to obtain an entity dynamic embedding matrix; the relation embedding matrix is not updated; "Scholar D" is the subject entity, "citation" is the relation entity, "P" is the object entity to be completed, and "2025-09-01" is the time; S3: Based on "Scholar D" in the entity dynamic embedding matrix The corresponding scholar D temporal information embedding and the citation relation embedding in the relation embedding matrix are used to perform linear feature modulation on the convolution kernel parameters of the two-dimensional convolutional network to obtain the model parameters of the two-dimensional convolutional network specific to the quadruple to be completed; S4: The confidence of each node in the temporal knowledge graph is calculated by the updated model parameters and the entity dynamic embedding matrix, and the node with the highest confidence is selected as the object entity to be completed in the quadruple to be completed.
[0053] Time series knowledge graph The representation is: a time-series knowledge graph It is a directed multi-relation graph that contains structured facts. ,in These represent the entity set, relation set, and time set in a temporal knowledge graph, respectively; temporal knowledge graph Each node is an entity in a set of entities, and each edge is a combination of a relation and a time. It is a time-series knowledge graph The set of all facts, where each fact is an event quadruple. It contains the main entities in the event. relational entities object entity and time In time-series knowledge graphs The top is represented by two nodes and the edge connecting the two nodes. The entity originating from the directed edge is the subject entity, and the entity pointed to by the directed edge is the object entity.
[0054] like Figure 2 As shown, in one embodiment, a time-series knowledge graph completion method based on time-series point processes is provided. This method completes missing subject entities, object entities, or relation entities in the fact set = {subject entity, relation entity, object entity, time} of the time-series knowledge graph, where the fact set is the quadruple to be completed. This method can be applied to both terminals and servers; this embodiment illustrates its application to a terminal. The specific steps of this time-series knowledge graph completion method based on time-series point processes are as follows:
[0055] S1: The input time-series knowledge graph The nodes in the matrix are classified, and the entity static embedding matrix is obtained based on the classification results. and relation embedding matrix ;
[0056] Specifically, this paper constructs a time-series knowledge graph with academic themes. As an example of input, in this time-series knowledge graph Middle; Entity set It includes different scholars and papers; a set of relationships. This includes relationships between scholars and papers, such as "published," "cited," and "participated"; time series. It is a set of all dates between June 1, 2025 and August 31, 2025; in an event quadruple [scholar E, published, paper Z, 2025-07-01], "scholar E" is the subject entity, "published" is the relation, "paper Z" is the object entity, and "2025-09-01" is the time.
[0057] S2: Using [Scholar D, Citation, P, 2025-09-01] as the quadruple to be completed, based on the quadruple to be completed in the time-series knowledge graph... Select the corresponding subgraph That is, select the subgraph composed of event quadruples with a time earlier than "2025-09-01", and then divide the subgraph... Entity static embedding matrix and relation embedding matrix The input is fed into a multi-relation graph convolutional neural network (RGCN) based on time-series point processes to obtain the entity dynamic embedding matrix. Relational Embedding Matrix No update will be performed; "Scholar D" is the subject entity, "Citation" is the relation entity, "P" is the object entity to be completed, and "2025-09-01" is the time.
[0058] S3: Based on the dynamic embedding matrix of entities using "scholar D" The corresponding scholar D time series information embedding and "references" in the relation embedding matrix The corresponding reference relationship is embedded in Convolution kernel parameters for 2D convolutional networks Linear feature modulation is performed to obtain the model parameters of the 2D convolutional network specific to the quadruples to be completed. ;
[0059] S4: Using the updated model parameters and entity dynamic embedding matrix The time series knowledge graph was calculated. Confidence level of each node The node with the highest confidence is selected as the object entity to be completed in the quadruple to be completed.
[0060] In one embodiment, the input time-series knowledge graph The nodes in the matrix are classified, and the entity static embedding matrix is obtained based on the classification results. and relation embedding matrix include:
[0061] S1.1: In the time-series knowledge graph The community detection algorithm is executed to obtain the community type of all nodes, and each node belongs to a community; for example, paper X, paper Y, and scholar C belong to community 1, and scholar D belongs to community 2.
[0062] S1.2: Remove the time-series knowledge graph By dividing the edges between nodes belonging to different communities, we obtain a disconnected graph that only contains relationships within different communities. Randomly initialize the entity embedding matrix. and initial relation embedding matrix Subsequently, the system in the non-connected graph The graph convolutional neural network is applied for message passing and node state updates. The updated node embeddings obtained from the graph convolutional neural network are the entity static embedding matrices that contain community relationships. Randomly initialized initial relation embedding matrix That is, the obtained relation embedding matrix .
[0063] In one embodiment, the community detection algorithm is the Louvain algorithm, which calculates the module gain for each node. The formula is:
[0064]
[0065] in, It is a node Rather than the sum of the edge weights between all nodes in the community to which it will be assigned, It is a node With time-series knowledge graphs The sum of the weights of the edges between all nodes. It is a time-series knowledge graph The sum of the weights of all edges, in this embodiment the weights of all edges are 1; for the time-series knowledge graph Repeatedly calculate the modularity gain of all nodes Until the module degree gain At that time, the resulting multiple communities achieve the node type division.
[0066] In one embodiment, the entity static embedding matrix The specific implementation process is as follows:
[0067]
[0068] in, It is a node The updated node embedding In the non-connected map In and nodes A set of nodes that have relationships. It is the product of the square roots of the node degrees, that is , It is an activation function. For nodes From randomly initialized entity embedding matrix The first initial embedding obtained in the process; It is a node From randomly initialized entity embedding matrix The second initial embedding obtained in the process; It is a node and nodes The connecting edges between them are embedded from the initial relation matrix. The third initial embedding obtained in the process; for non-connected graphs Each node in the time sequence knowledge graph Each node in the matrix has its updated node embedding calculated, and the multiple node embeddings together constitute the entity static embedding matrix. .
[0069] In one embodiment, the entity dynamic embedding matrix The process of obtaining it is as follows:
[0070] The first step of the multi-relation graph convolutional neural network (RGCN) based on time-series process The formula for updating the node state of a layer is:
[0071]
[0072] in, for The nodes are obtained from a multi-relation graph convolutional neural network based on time-series point processes. Embedding of time-series information; yes The nodes are obtained from a multi-relation graph convolutional neural network based on time-series point processes. Embedding of time-series information, when At that time, the input value is from the entity static embedding matrix. The corresponding node embedding obtained from the process; yes The nodes are obtained from a multi-relation graph convolutional neural network based on time-series point processes. Embedding of time-series information, when At that time, the input value is from the entity static embedding matrix. The corresponding node embedding obtained from the process; To embed the relation matrix The relational embedding obtained from it; It is a node exist Historical neighbors before that time, i.e. , For subgraphs; and It is a connection node With nodes The edges and their corresponding times; It is the conditional intensity function of a time series process, defined as ,function , It is a learnable constant term used to control the decay rate; It is a node The degree; It is the first The first weight matrix embedded in the layer is used to update the node itself. It is the first The second weight matrix used in the layer to update the messages received by the node is a learnable parameter. For activation functions;
[0073] Time series knowledge graph Each node in the matrix calculates the updated temporal information embedding, and these temporal information embeddings together constitute the entity dynamic embedding matrix. .
[0074] In one embodiment, the "scholar D" is used in the entity dynamic embedding matrix. The corresponding scholar D time series information embedding and "references" in the relation embedding matrix The corresponding reference relationship is embedded in Convolution kernel parameters for 2D convolutional networks Linear feature modulation is performed to obtain the model parameters of the 2D convolutional network specific to the quadruples to be completed. include:
[0075] S3.1: Dynamic Embedding Matrix from Entities The embedding of the time series information of scholar D corresponding to "scholar D" is obtained from the data. From the relation embedding matrix Retrieving the reference relationship embedded in the "reference" Embedded based on the time-series information of scholar D and the embedded reference relationship Scaling factors were obtained respectively. and offset factor ;
[0076] S3.2: By scaling factor and offset factor The convolution kernel parameters of the two-dimensional convolutional network Update to model parameters .
[0077] In one embodiment,
[0078] The scaling factor and the offset factor They are obtained respectively through the following expressions:
[0079]
[0080]
[0081] in, This is the scaling factor; Offset factor; Embedding time-series information for scholar D; Embedded for reference relationships; It is a vector concatenation operation; For activation functions; , Both are weight matrices; All are biased. All of these are learnable parameters.
[0082] In one embodiment, the model parameters of the quadruplets to be completed It can be obtained through the following expression:
[0083]
[0084] in, These are model parameters; These are the convolution kernel parameters of the two-dimensional convolutional network; It is the Hadamard product of a matrix, which is the product of corresponding elements.
[0085] In one embodiment, a time-series knowledge graph Confidence level of each node It can be obtained through the following expression:
[0086]
[0087] in, It is a node The embedding of temporal information from the entity dynamic embedding matrix Obtained from; This represents the concatenation of vectors in two dimensions. This is the weight matrix; Operations representing flattened vectors; It is the activation function, and the final result is... That is, a node Confidence level; Embedding time-series information for scholar D; Embedded for reference relationships.
[0088] To better complete the temporal knowledge graph, in this embodiment of the invention, the completion of the temporal knowledge graph can be divided into main entity completion and relation entity completion. Main entity completion can be further divided into head entity completion and tail entity completion. As an example, the quadruples to be completed input in steps S3 and S4 can be replaced with quadruples for which different completion tasks will be performed, the confidence of missing objects in the quadruples can be calculated, and different completion tasks can be performed.
[0089] The completion methods for the tail entity completion task have been explained in steps S1 to S4. The completion methods for the head entity completion task and the relation completion task will be explained below.
[0090] For example, the quadruple to be completed in the main entity completion task [P, citation, paper N, 2025-09-01], where For the missing head entity, the entity dynamic embedding matrix obtained after steps S1 and S2 is: The relation embedding matrix is For the head entity completion task, in step S3, through... and The model parameters specific to the quadruples to be completed are calculated. In step S4, through and Calculate different candidate entities Based on the confidence level, candidate entities with high confidence levels are selected. As the missing head entity in the quadruple to be completed, complete the completion task;
[0091] For example, in a relation entity completion task, the quadruple to be completed is [Scholar D, P, Paper N, 2025-09-01], where... The missing relation is represented by the entity dynamic embedding matrix obtained after steps S1 and S2. The relation embedding matrix is For the relation completion task, in step S3, through... and The model parameters specific to the quadruples to be completed are calculated. In step S4, through and Calculate different candidate relations Based on the confidence level, candidate relations with high confidence levels are selected. As the missing relation in the quadruple to be completed, complete the completion task.
[0092] This invention also provides a temporal knowledge graph completion device based on time-series point processes, such as... Figure 3 As shown, the device includes:
[0093] Embedded initialization module 10 processes the input time-series knowledge graph. The nodes in the matrix are classified, and the entity static embedding matrix is obtained based on the classification results. and relation embedding matrix ;
[0094] The temporal information fusion module 20 takes [scholar D, citation, P, 2025-09-01] as the quadruple to be completed, and calculates the quadruple to be completed based on its position in the temporal knowledge graph. Select the corresponding subgraph That is, select the subgraph composed of event quadruples with a time earlier than 2025-09-01, and then... Entity static embedding matrix and relation embedding matrix The input is fed into a multi-relation graph convolutional neural network (RGCN) based on time-series point processes to obtain the entity dynamic embedding matrix. Relational Embedding Matrix No update will be performed; "Scholar D" is the subject entity, "Citation" is the relation entity, "P" is the object entity to be completed, and "2025-09-01" is the time.
[0095] Linear feature modulation module 30, based on "scholar D" in entity dynamic embedding matrix The corresponding scholar D time series information embedding and "references" in the relation embedding matrix The corresponding reference relationship is embedded in Convolution kernel parameters for 2D convolutional networks Linear feature modulation is performed to obtain the model parameters of the 2D convolutional network specific to the quadruples to be completed. ;
[0096] Inference completion module 40 is used to complete the inference based on the updated model parameters. and entity dynamic embedding matrix The time series knowledge graph was calculated. Confidence level of each node The node with the highest confidence is selected as the object entity to be completed in the quadruple to be completed.
[0097] This invention incorporates time-series processes into graph neural networks, automatically adjusting the importance of historical information at different times; it uses linear feature modulation to adjust model parameters according to different inference objectives, achieving good performance even on rare data; the inference process can be performed in batches, taking less time when there are many inference objectives; the trained model can simultaneously meet the needs of completing missing entities or relationships without requiring separate training.
[0098] In an Ubuntu 20.04 environment, the device described in this patent was implemented using Python 3.7.10 and PyTorch 1.6.0. Experiments were conducted on the ICEWS14 dataset. The test time for query requests was 29 seconds, while the time required without pre-generating the embedded inference method was 184 seconds. The highest average inverse ranking of the inference results was 0.4089, which is 14.3% higher than the highest value of 0.3577 obtained by the RE-NET inference method, which is not based on time-series process.
[0099] Figure 4 An internal structural diagram of a computer device in one embodiment is shown. This computer device can specifically be a terminal or a server. Figure 4As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a time-series knowledge graph completion method based on time-series process steps. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement the time-series knowledge graph completion method based on time-series process steps. Those skilled in the art will understand that... Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0100] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0101] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0102] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for completing a temporal knowledge graph based on time-series point processes, which completes the missing subject entity, object entity, or relation entity in the fact set = {subject entity, relation entity, object entity, time} of the temporal knowledge graph, wherein the fact set is a quadruple to be completed, characterized in that, The method includes: S1: Classify the nodes in the input time-series knowledge graph, and obtain the entity static embedding matrix and relation embedding matrix based on the classification results; S2: [scholar D, citation, P, ...] As a quadruple to be completed, the corresponding subgraph is selected in the time series knowledge graph based on the quadruple to be completed, that is, the subgraph with a time less than [a certain value] is selected. The subgraph is composed of event quadruples, and the subgraph, entity static embedding matrix, and relation embedding matrix are used to embed the subgraph. The input is fed into a multi-relation graph convolutional neural network based on time-series point processes to obtain a dynamic entity embedding matrix; the relation embedding matrix is not updated; "Scholar D" is the subject entity, "Reference" is the relation entity, and "P" is the object entity to be completed. For time; S3: Based on the temporal information embedding of "scholar D" in the entity dynamic embedding matrix and the citation relationship embedding in the relationship embedding matrix, linear feature modulation is performed on the convolution kernel parameters of the two-dimensional convolutional network to obtain the model parameters of the two-dimensional convolutional network corresponding to the quadruple to be completed; including: from the entity dynamic embedding matrix The embedding of the time series information of scholar D corresponding to "scholar D" is obtained from the data. From the relation embedding matrix Retrieving the reference relationship embedded in the "reference" Embedded based on the time-series information of scholar D and the embedded reference relationship Scaling factors were obtained respectively. and offset factor ; by scaling factor and offset factor The convolution kernel parameters of the two-dimensional convolutional network Update to model parameters ; S4: Calculate the confidence level of each node in the time-series knowledge graph using the updated model parameters and entity dynamic embedding matrix, and select the node with the highest confidence level as the object entity to be completed in the quadruple to be completed.
2. The method for completing a time-series knowledge graph based on time-series point processes according to claim 1, characterized in that, The process of classifying nodes in the input time-series knowledge graph and obtaining entity static embedding matrices and relation embedding matrices based on the classification results includes: S1.1: Execute a community detection algorithm on the time-series knowledge graph to obtain the community type of all nodes, and each node belongs to a community; S1.2: Remove the edges between nodes belonging to different communities in the temporal knowledge graph to obtain a disconnected graph that only contains the internal relationships of different communities; after randomly initializing the entity embedding matrix and the initial relationship embedding matrix, the system applies a graph convolutional neural network to the disconnected graph for message passing and node state updates. The updated node embedding obtained from the graph convolutional neural network is the entity static embedding matrix that contains community relationships; the randomly initialized initial relationship embedding matrix is the obtained relationship embedding matrix.
3. The time-series knowledge graph completion method based on time-series point processes according to claim 2, characterized in that, The community detection algorithm is the Louvain algorithm, and the formula for calculating the module gain of each node is: in, It is a node Rather than the sum of the edge weights between all nodes in the community to which it will be assigned, It is a node With time-series knowledge graphs The sum of the weights of the edges between all nodes. It is a time-series knowledge graph The sum of the weights of all edges, with all edges having a weight of 1; for time-series knowledge graphs Repeatedly calculate the modularity gain of all nodes Until the module degree gain At that time, the resulting multiple communities represent the node type division.
4. The method for completing a time-series knowledge graph based on time-series point processes according to claim 1, characterized in that, The entity static embedding matrix The specific implementation process is as follows: in, It is a node The updated node embedding In a disconnected graph In and nodes A set of nodes that have relationships. It is the product of the square roots of the nodal degrees, that is , It is an activation function. For nodes From randomly initialized entity embedding matrix The first initial embedding obtained in the process; It is a node From randomly initialized entity embedding matrix The second initial embedding obtained in the process; It is a node and nodes The connecting edges between them are embedded from the initial relation matrix. The third initial embedding obtained in the process; for disconnected graphs Each node in the time sequence knowledge graph Each node in the matrix has its updated node embedding calculated, and the multiple node embeddings together constitute the entity static embedding matrix. ; As weight; These are learnable parameters.
5. The method for completing a time-series knowledge graph based on time-series point processes according to claim 1, characterized in that, The entity dynamic embedding matrix The process of obtaining it is as follows: The first step of the multi-relation graph convolutional neural network (RGCN) based on time-series process The formula for updating the node state of a layer is: in, for The nodes are obtained from a multi-relation graph convolutional neural network based on time-series point processes. Embedding of time-series information; yes The nodes are obtained from a multi-relation graph convolutional neural network based on time-series point processes. Embedding of time-series information, when At that time, the input value is from the entity static embedding matrix. The corresponding node embedding obtained from the process; yes The nodes are obtained from a multi-relation graph convolutional neural network based on time-series point processes. Embedding of time-series information, when At that time, the input value is from the entity static embedding matrix. The corresponding node embedding obtained from the process; To embed the relation matrix The relational embedding obtained from it; It is a node exist Historical neighbors before time, that is , For subgraphs; and It is a connection node With nodes The edges and their corresponding times; It is the conditional intensity function of a time series process, defined as ,function , It is a learnable constant term used to control the decay rate; It is a time-series knowledge graph In China Any time before that time, i.e. ; It is a node The degree; It is the first The first weight matrix embedded in the layer is used to update the node itself. It is the first The second weight matrix used in the layer to update the messages received by the node is a learnable parameter. For activation functions; Time series knowledge graph Each node in the matrix calculates the updated temporal information embedding, and these temporal information embeddings together constitute the entity dynamic embedding matrix. .
6. The method for completing a time-series knowledge graph based on time-series point processes according to claim 1, characterized in that, The scaling factor and the offset factor They are obtained respectively through the following expressions: in, This is the scaling factor; Offset factor; Embedding time-series information for scholar D; Embedded for reference relationships; It is a vector concatenation operation; For activation functions; , Both are weight matrices; All are biased. All of these are learnable parameters.
7. The method for completing a time-series knowledge graph based on time-series point processes according to claim 6, characterized in that, The model parameters of the quadruple to be completed It can be obtained through the following expression: in, These are model parameters; These are the convolution kernel parameters of the two-dimensional convolutional network; It is the Hadamard product of a matrix, which is the product of corresponding elements.
8. The method for completing a time-series knowledge graph based on time-series point processes according to claim 1, characterized in that, Time series knowledge graph Confidence level of each node It can be obtained through the following expression: in, It is a node The embedding of temporal information from the entity dynamic embedding matrix Obtained from; This represents the concatenation of vectors in two dimensions. This is the weight matrix; Operations representing flattened vectors; It is the activation function, and the final result is... That is, a node Confidence level; Embedding time-series information for scholar D; Embedded for reference relationships; () represents a two-dimensional convolution operation.
9. A temporal knowledge graph completion device based on time-series point processes, characterized in that, The device includes: The embedding initialization module classifies the nodes in the input time-series knowledge graph and obtains the entity static embedding matrix and relation embedding matrix based on the classification results. The time-series information fusion module will integrate [scholar D, citation, P, ...] As a quadruple to be completed, the corresponding subgraph is selected in the time series knowledge graph based on the quadruple to be completed, that is, the subgraph with a time less than [a certain value] is selected. The subgraph, composed of event quadruples, is fed into a multi-relation graph convolutional neural network based on time-series point processes. This yields a dynamic entity embedding matrix; the relation embedding matrix is not updated. "Scholar D" represents the subject entity, "Reference" represents the relation entity, and "P" represents the object entity to be completed. For time; The linear feature modulation module, based on "scholar D" in the entity dynamic embedding matrix The temporal information embedding of the corresponding scholar D and the citation relationship embedding in the relation embedding matrix are used to perform linear feature modulation on the convolution kernel parameters of the two-dimensional convolutional network to obtain the model parameters of the two-dimensional convolutional network corresponding to the quadruple to be completed; including: from the entity dynamic embedding matrix The embedding of the time series information of scholar D corresponding to "scholar D" is obtained from the data. From the relation embedding matrix Retrieving the reference relationship embedded in the "reference" Embedded based on the time-series information of scholar D and the embedded reference relationship Scaling factors were obtained respectively. and offset factor ; by scaling factor and offset factor The convolution kernel parameters of the two-dimensional convolutional network Update to model parameters ; The inference completion module is used to dynamically embed the model using updated model parameters and entity embedding matrices. The confidence level of each node in the temporal knowledge graph is calculated, and the node with the highest confidence level is selected as the object entity to be completed in the quadruple to be completed.
Citation Information
Patent Citations
Knowledge graph completion method and device and storage medium
CN120235227A
Methods and systems for training artificial intelligence models
US20250384341A1