Temporal knowledge graph completion method and system based on relational graph convolutional neural network

By using the global and local information perception strategies of the relational graph convolution neural network in tense knowledge graph completion, the model structure is simplified, and the problems of insufficient information capture and high model complexity in the existing methods are solved, and more efficient Complete task accuracy and resource conservation.

CN119106729APending Publication Date: 2024-12-10DALIAN UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410785425.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The existing tense knowledge graph completion method is difficult to fully capture the global and local information of events, resulting in a decrease in model inference capability. The deep learning-based method has high complexity, large parameters and large memory usage, which limits its resource limitations. Application in the environment.

Method used

GLARGCN, a tense knowledge graph completion method based on relational graph convolution neural network, acquire key neighbors through global and local information-aware subgraph samplers, the encoder generates time-aware representations, and uses graph convolution for feature aggregation, combining The knowledge graph scoring function performs time fact possibilities scoring, simplifies model structure, and reduces computational and memory requirements.

Benefits of technology

Improve the reasoning ability of event evolution laws, enhance the accuracy of completion tasks, reduce the computational and memory requirements, improve the practicality and efficiency of the model, and show higher parameter efficiency without additional learnable parameters. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106729A_ABST
    Figure CN119106729A_ABST
Patent Text Reader

Abstract

The invention discloses a tense knowledge graph completion method based on a relational graph convolutional neural network, and relates to the technical field of knowledge graph completion. The method comprises the following steps: a sub-graph sampler for global and local information perception creates a sub-graph after acquiring a key neighbor of a query node; an encoder generates time-aware representation of the key neighbors from the sub-graphs, and graph convolution is used for carrying out feature aggregation to obtain embedded representation of query; a knowledge graph scoring function, as a decoder, scores the likelihood of temporal facts using a query embedded representation. The problem of insufficient global and local information capture in temporal knowledge graph completion is solved, and the reasoning ability for the event evolution law is improved, so that the accuracy of the completion task is enhanced. According to the method, the problems of high model complexity, large parameter quantity and large memory occupation in an existing tense knowledge graph completion method based on deep learning are solved, the model structure is simplified, the calculation and memory requirements are reduced, meanwhile, the model performance is kept, and the practicability and efficiency of the model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image completion, and in particular to a temporal knowledge graph completion method and system based on a relational graph convolutional neural network. Background Art

[0002] In the context of the digital age, knowledge graphs, as core tools for structured knowledge representation, are widely used in search engines, recommendation systems, intelligent question-answering, and other fields. With the growing demand for dynamic knowledge representation, temporal knowledge graphs have emerged, which describe the evolution of relationships between entities over time by adding timestamps to triples in the knowledge graph. Temporal knowledge graph completion technology aims to predict and fill in missing entities in temporal knowledge graphs, which is of great significance for improving knowledge graphs and enhancing their application capabilities.

[0003] The core goal of temporal knowledge graph completion is to accurately predict and fill in missing entities in the knowledge graph, especially those dynamic links that change over time. This task is crucial to maintaining the integrity of the knowledge graph and improving its usability and accuracy in various intelligent systems. The effective implementation of temporal knowledge graph completion can significantly enhance the system's ability to interpret historical events, predict future development trends, and describe the knowledge evolution process. In order to capture complex contextual information, existing models are often designed to be very complex, which not only increases the training time of the model, but also puts higher requirements on hardware resources, resulting in a significant increase in computing costs. As the scale of the knowledge graph expands, existing models need to store a large number of parameters and intermediate representations, which leads to a sharp increase in memory usage and limits the application of models in resource-constrained environments. When dealing with time-sensitive knowledge completion tasks, existing models often find it difficult to effectively capture and model the evolution of knowledge over time, resulting in insufficient accuracy and robustness of the completion results.

[0004] The Relational Graph Convolutional Neural Network (RGCN) is a deep learning algorithm designed specifically for graph data. Its core idea is to learn the representation of nodes in the graph through convolution operations, while taking into account the type of relationship between nodes. Compared with traditional graph convolutional networks (GCN), the relational graph convolutional neural network can distinguish different types of relationships and learn independent embedding representations for each relationship, thereby more accurately capturing the complex interactions between entities. The relational graph convolutional neural network has a wide range of applications in many fields, including representation learning, social network analysis, bioinformatics, and recommendation systems.

[0005] The main technical methods currently include:

[0006] (1) Completion methods based on timestamp dependency. This type of method usually does not operate on timestamps, but associates timestamps with corresponding entities or relationships to achieve the evolution of entities or relationships. These methods use static knowledge graph completion methods to complete the prediction of missing items by associating timestamps with entities or relationships. The core of this method is that it uses time information as an additional attribute instead of performing complex time-dependent calculations.

[0007] (2) Completion methods based on timestamp-specific functions. This type of method uses specific functions to learn the embedded representation of timestamps, or the evolution of entities and relations. These methods capture the dynamic characteristics of time by encoding time information into specific transformation functions. For example, Gaussian functions or transformation functions are used to represent timestamps, and this time information is integrated into the embedded representation of entities and relations. The core of this method is that it simulates the impact of time on relations in the knowledge graph through mathematical functions.

[0008] (3) Completion methods based on deep learning. This type of method uses deep learning algorithms to encode temporal information and study the dynamic evolution of entities and relations. In addition to convolutional neural networks (CNNs) and long short-term memory networks (LSTMs) for processing time series data, graph neural networks (GNNs) also play an important role in temporal knowledge graph completion (TKGC). GNNs update the representation of nodes by aggregating information from neighboring nodes and are suitable for processing graph-structured data such as social networks, biological networks, and knowledge graphs. Under the framework of GNNs, relational graph convolutional neural networks are a model specially designed to process multi-relational graphs. They usually distinguish and learn different types of relations in knowledge graphs by introducing relational attention mechanisms and relation-specific weight matrices. The core advantage of RGCN is that it can capture the structural information of complex relations between entities, which is particularly important for the completion of temporal knowledge graphs. Existing methods use frequency-based gated recurrent units and data interpolation techniques to address the temporal variability and sparsity of temporal knowledge graphs, or use attention pruning strategies to iteratively expand subgraphs, and then dynamically update the representation and attention score of each entity in the subgraph through a time-aware graph neural network. However, these methods have complex model structures and high parameter consumption. Existing methods also perform subgraph sampling based on the probability of time difference, using a time-aware entity encoder to generate entity-specific representations at different times, but only focus on neighbors with similar time in the sampling process, ignoring global information that may have repeated patterns.

[0009] The problems with the above methods are: (1) When a query is given, how to narrow the prediction scope from a large number of candidate entities and capture related entities is an important issue in the task of temporal knowledge graph completion. Existing temporal knowledge graph completion methods often cannot fully capture the global and local information of events, and thus cannot better explore the evolution laws of events during the reasoning process, resulting in a decrease in the model's reasoning ability. (2) Most existing deep learning-based completion methods tend to focus on designing neural architectures using complex components (such as attention mechanisms and Transformers). Although these methods are powerful, they are conceptually and technically complex, increasing the number of model parameters and memory usage, and also increasing the burden of parameter optimization. Summary of the invention

[0010] The purpose of the present invention is to propose a temporal knowledge graph completion method and system GLARGCN based on relational graph convolutional neural network, so as to improve the reasoning ability of event evolution laws, thereby enhancing the accuracy of completion tasks; reduce computing and memory requirements while maintaining model performance, and improve its practicality and efficiency.

[0011] According to a first aspect of an embodiment of the present disclosure, a temporal knowledge graph completion method based on a relational graph convolutional neural network is provided, comprising the following steps:

[0012] The global and local information aware subgraph sampler obtains the key neighbors of the central node and creates a subgraph;

[0013] The encoder generates a time-aware representation of key neighbors from the subgraph and uses graph convolution to perform feature aggregation to obtain a query embedding representation;

[0014] The knowledge graph scoring function acts as a decoder and uses the query embedding representation to score the likelihood of a temporal fact.

[0015] Furthermore, the subgraph sampler provides a global and local sample for the query (s q ,r q ,? ,t q ) Sample a dependent subgraph G sub ,s q is the head entity, r q For the relationship, t q is the timestamp; it first obtains the query entity s from the temporal knowledge graph TKG q The set of all neighbor nodes Then, the sampling weights of all neighbor nodes are obtained through the global information collection module and the local information collection module respectively; finally, the two sampling weights are fused to obtain the final sampling weight.

[0016] Furthermore, the global information collection module is connected along tq Search the previous and next timeline for the tail entity set related to the query If a neighbor node e i exist , count it and entity s q In r q The frequency of interaction is used as the sampling weight; otherwise, a small value weight is given to it to avoid ignoring it completely; let w i For q The i-th neighbor node e i The sampling weight, w i is calculated as:

[0017]

[0018] Here, ε is a small constant, which is set to 10 in the experiment. -5 This value is not absolutely fixed and can be modified, indicating that it does not appear in the set The neighbor node weights in t∈T refer to all timestamps t in the timestamp set T in the temporal knowledge graph; G refers to the temporal knowledge graph, which is composed of a set of four-tuples; To represent the global information collection module s q The i-th neighbor node e i The probability of being sampled, is calculated as:

[0019]

[0020] Here, k refers to the number of all neighbor nodes of the query entity in the subgraph.

[0021] Furthermore, the local information collection module uses the timestamp t q The timestamp t of the neighboring node i The time displacement is used to capture the short-term dependencies between entities; the time displacement is exponentially transformed and normalized, and the Indicates the local information collection module s q The i-th neighbor node e i The probability of being sampled, is calculated as:

[0022]

[0023] Here, k refers to the number of all neighbor nodes of the query entity in the subgraph.

[0024] Furthermore, a variable parameter is used to measure the sampling probability of the global information acquisition module and the sampling probability of the local information acquisition module; the two are summed up in proportion to obtain the final sampling probability It means s qThe i-th neighbor node e i The probability of being sampled is:

[0025]

[0026] The variable hyperparameter α∈[0,1] is used; in addition, to avoid sampling too many irrelevant neighbors, a hyperparameter is used to control G sub The maximum number of samples in .

[0027] Furthermore, the encoder generates a time-aware representation of key neighbors from the subgraph by using a time-aware encoding method for neighbor nodes and then using neighbor aggregation to learn s q Context representation; shift the time tt q Mapping to a finite-dimensional function space It is defined as:

[0028]

[0029] where w i and φ i are trainable parameters, representing the frequency component and phase component of the i-th dimension in the time encoding, respectively. t refers to a finite-dimensional function space The temporal displacement is sinusoidally transformed to capture the periodic and continuous characteristics of time. Then, the encoding vector of the temporal displacement and the embedding vector of the relation are combined to learn a time-aware relational representation for each temporal neighbor relation:

[0030] h (r,t) =f(h r ||Φ(t,t q )) (6)

[0031] in is the time-invariant representation of each relation r in the temporal neighborhood; a feedforward neural network layer f is used to learn the relation representation h (r,t) .

[0032] Furthermore, we use graph convolution to aggregate features and obtain query embedding representation. Specifically, we use a layer of relational graph neural network to aggregate s q Neighborhood characteristics:

[0033]

[0034] in The expression according to s q and t q The set of critical time neighbors in the sampled subgraph; (r, t) refers to The relationship and timestamp of each time neighbor node in he Represents the time-invariant representation of each entity e in the temporal neighborhood; through the relationship graph neural network structure, the query entity s is obtained q At time t q The time-aware representation of It not only integrates the information of temporal neighbors, but also reflects the influence of temporal dynamic changes. Therefore, GLARGCN can learn specific representations of entities under different relations and times.

[0035] Furthermore, the knowledge graph scoring function acts as a decoder and uses the query embedding representation to score the likelihood of the temporal fact as follows:

[0036] Let score represent the DistMult scoring function. For a quadruple (s, r, ?, t), the score of the quadruple obtained by combining it with the candidate entity o' is defined as follows:

[0037] core(h (s,t) ,h (r,t) ,h o' )=(h (s,t) ⊙h (r,t) ) T ·h o' (8)

[0038] where h (s,t) is the time-aware representation of the query entity; h (r,t) is the relational time perception representation when the time difference is 0; ⊙ represents the Hadamard product; h o' is the time-invariant representation of the candidate entity o'; with the score of each candidate entity, the model is trained in a mini-batch manner using the cross entropy loss function:

[0039]

[0040] Where o represents the correct answer entity of the query, all observed quadruple in G are traversed, the loss of each quadruple is calculated and summed.

[0041] According to a second aspect of an embodiment of the present disclosure, a temporal knowledge graph completion system based on a relational graph convolutional neural network is provided, comprising:

[0042] Subgraph creation module: The subgraph sampler that perceives global and local information obtains the key neighbors of the central node and creates a subgraph;

[0043] Embedding representation module, the encoder generates time-aware representations of key neighbors from the subgraph and uses graph convolution to perform feature aggregation to obtain query embedding representation;

[0044] Scoring Module,The knowledge graph scoring function acts as a decoder and uses the query embedding,representation to score the likelihood of temporal facts.

[0045] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device comprising a memory, a processor and a computer program stored and running on the memory, wherein when the processor executes the program, the method for completing the temporal knowledge graph based on a relational graph convolutional neural network is implemented.

[0046] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the temporal knowledge graph completion method based on a relational graph convolutional neural network is implemented.

[0047] Compared with the prior art, the above technical solution adopted by the present invention has the following advantages: the present invention solves the problem of insufficient global and local information capture in temporal knowledge graph completion, improves the ability to reason about the laws of event evolution, and thus enhances the accuracy of the completion task. It solves the problems of high model complexity, large number of parameters, and high memory usage in existing deep learning-based temporal knowledge graph completion methods, simplifies the model structure, reduces computing and memory requirements, while maintaining model performance, and improves the practicality and efficiency of the model. By using a sampling strategy that combines global historical event frequency with local time relative displacement, key contextual information is effectively captured. Since the sampler does not require additional learnable parameters, it exhibits higher parameter efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The drawings in the specification, which constitute a part of the present application, are used to provide further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.

[0049] Figure 1 This is a schematic diagram of the temporal knowledge graph completion task;

[0050] Figure 2 This is the GLARGCN model framework diagram;

[0051] Figure 3 The structure diagram of the sub-graph sampler that is aware of global and local information;

[0052] Figure 4 The MRR diagram shows the MRR achieved by GLARGCN, TARGCN, T-GAP and TeMP SA at ICEWS14. Specific implementation methods

[0054] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.

[0055] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0056] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0057] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods and systems according to various embodiments of the present disclosure. It should be noted that each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code may include one or more executable instructions for implementing the logical functions specified in each embodiment. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the flowchart and / or block diagram, and the combination of boxes in the flowchart and / or block diagram can be implemented using a dedicated hardware-based system that performs a specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.

[0058] In the present invention, temporal knowledge graph completion refers to predicting missing entities in a given quad based on existing facts. Specifically, given a head entity, a relationship, and a timestamp, the tail entity needs to be completed, or given a tail entity, a relationship, and a timestamp, the head entity needs to be completed.

[0059] The problem addressed by the present invention is: the problem of incomplete quadruple in temporal knowledge graph. Assume that E, R and T are entity sets, relationship sets and timestamp sets respectively. The temporal knowledge graph G can be represented as a set of quadruple (s, r, o, t), that is, G = {(s, r, o, t) | s, o∈E, r∈R, t∈T}, where s represents the head entity, r represents the relationship, o represents the tail entity, and t represents the timestamp. The task of temporal knowledge graph completion is to predict the missing entities in a given quadruple based on the existing facts. Specifically, given the head entity s q , relationship q and timestamp t q , need to complete the tail entity (sq ,r q ,? ,t q ), or given a tail entity o q , relationship q and timestamp t q , you need to complete the head entity (?,r q ,o q ,t q ).

[0060] The schematic diagram of the temporal knowledge graph completion task is as follows Figure 1 As shown in the figure, for the query (a, visit, ?, 2012-03-27), where ? represents the entity to be predicted, a series of facts close to the query time and global facts can be obtained from the entire graph, and then the missing entities can be predicted based on the fact clues.

[0061] Embodiment 1:

[0062] like Figure 2 As shown, this embodiment provides a temporal knowledge graph completion method GLARGCN based on a relational graph convolutional neural network, including the following steps:

[0063] Step 1. The global and local information aware subgraph sampler obtains the key neighbors of the central node and creates a subgraph;

[0064] Specifically, given a query (s q ,r q ,? ,t q ), entity s q There may be multiple neighboring facts related to it that occurred at different times. If all the neighbor node features are aggregated, it will often bring a lot of noise. Therefore, in order to enhance the richness and accuracy of the central entity representation, the query (s q ,r q ,? ,t q ) to sample a dependent subgraph, using G sub It should be noted that in the temporal knowledge graph completion task, although there are some quadruple with missing information, some complete and real quadruple can still be observed at each timestamp. Therefore, these real quadruple can be used as clues for reasoning to sample neighbors along the timeline. Figure 3 As shown, first obtain the query entity s from the temporal knowledge graph TKG q The set of all neighbor nodes Then, the sampling weights of all neighbor nodes are obtained through the global information collection module and the local information collection module respectively; finally, the two sampling weights are merged to obtain the final sampling weight. The core of the global information collection module is to use historical events to provide a global perspective. The idea of ​​the local information collection module is to use the query timestamp t q The timestamp t of the neighboring node i The time displacement of t is used to capture the short-term dependencies between entities. q When reasoning about an event, it is believed that the factual information of the recent event is more likely to become a clue for reasoning and can better reflect the current state and attributes of the target entity, so a higher sampling weight should be given.

[0065] In recent years, some temporal knowledge graph completion models based on graph neural network structures use attention mechanisms to learn the weights of neighbors, which brings more parameter consumption and computational burden. GLARGCN only uses non-parametric historical interaction data and time information to select contributing temporal neighbors during the sampling process, and does not use trainable components. This method enables the model to extract useful information more directly from the structure and temporal dynamics of the graph without relying on complex parameter learning processes. It not only reduces the training difficulty and computational cost of the model, but also improves the flexibility and efficiency of the model in processing temporal knowledge graphs to a certain extent.

[0066] Step 2. The encoder generates a time-aware representation of key neighbors from the subgraph and uses graph convolution to perform feature aggregation to obtain the query embedding representation;

[0067] After obtaining the query entity s q G sub Afterwards, a time-aware encoding method is adopted for the neighbor nodes, and then neighbor aggregation is used to learn s q Some existing studies have emphasized the importance of relation embedding for temporal knowledge graph completion tasks, because each relation is related to multiple facts in the knowledge graph. Therefore, in order to enhance the relation expression at a specific time, a temporal encoder is proposed to realize the combined operation of relation and timestamp.

[0068] Step 3. The knowledge graph scoring function acts as a decoder and uses the query embedding representation to score the likelihood of the temporal fact.

[0069] Specifically, the knowledge graph scoring function is used to calculate the query quadruple (s q ,r q ,? ,t q ) and each candidate entity. It should be noted that by calculating To derive the query relation rq The time-aware representation of GLARGCN is used, and the time difference is set to 0. In addition, considering that subgraph sampling of candidate entities consumes a lot of time, the time-invariant representation of the candidate entities is input into the scoring function. Since GLARGCN outputs a time-aware entity representation, it can be coupled with any appropriate knowledge graph scoring function, such as DistMult, SimplE, ComplEx, etc. In the present invention, DistMult is selected as the scoring function of GLARGCN because it works well and has higher parameter efficiency than SimplE and ComplEx. DistMult obtains the score of the candidate tail entity by taking the dot product of the embedding vectors of the head entity and relationship with the embedding vectors of all candidate tail entities.

[0070] Embodiment 2:

[0071] This embodiment provides a temporal knowledge graph completion system based on a relational graph convolutional neural network, including:

[0072] Subgraph creation module: The subgraph sampler that perceives global and local information obtains the key neighbors of the central node and creates a subgraph;

[0073] Embedding representation module, the encoder generates time-aware representations of key neighbors from the subgraph and uses graph convolution to perform feature aggregation to obtain query embedding representation;

[0074] Scoring Module,The knowledge graph scoring function acts as a decoder and uses the query embedding,representation to score the likelihood of temporal facts.

[0075] Embodiment three:

[0076] An electronic device includes a memory, a processor, and a computer program stored and running on the memory, wherein the processor implements the above-mentioned temporal knowledge graph completion method based on a relational graph convolutional neural network when executing the program, including:

[0077] The global and local information aware subgraph sampler obtains the key neighbors of the central node and creates a subgraph;

[0078] The encoder generates a time-aware representation of key neighbors from the subgraph and uses graph convolution to perform feature aggregation to obtain a query embedding representation;

[0079] The knowledge graph scoring function acts as a decoder and uses the query embedding representation to score the likelihood of a temporal fact.

[0080] Embodiment 4:

[0081] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned temporal knowledge graph completion method based on a relational graph convolutional neural network, comprising:

[0082] The global and local information aware subgraph sampler obtains the key neighbors of the central node and creates a subgraph;

[0083] The encoder generates a time-aware representation of key neighbors from the subgraph and uses graph convolution to perform feature aggregation to obtain a query embedding representation;

[0084] The knowledge graph scoring function acts as a decoder and uses the query embedding representation to score the likelihood of a temporal fact.

[0085] Based on the public temporal knowledge graph dataset, experiments are designed to analyze its beneficial effects.

[0086] In order to evaluate the effect of GLARGCN on the TKGC task, three popular TKG benchmark datasets are used: ICEWS14, ICEWS05-15 and GDELT. The Integrated Crisis Warning System (ICEWS) is automatically captured data from digital news media and social media, mainly used for early warning. ICEWS can be divided into multiple sub-datasets, where ICEWS14 contains all facts in 2014, and ICEWS05-15 contains all facts from 2005 to 2015. GDELT is an open database that records news from 1969 to the present and updates data every 15 minutes. The subset proposed by Trivedi et al. is used, which contains facts from April 1, 2015 to March 31, 2016. The same training set, validation set and test set are divided according to the method of Goe et al. Table 1 lists the detailed statistics of the dataset. In Table 1, |E| represents the number of entities, |R| represents the number of relations, |T| represents the number of timestamps, and N| represents the number of timestamps. train Represents the number of quadruplets in the training set, N valid Represents the number of quadruplets in the validation set, N test Represents the number of quadruplets in the test set.

[0087] Table 1 Statistics of the TKG dataset

[0088]

[0089] TKGC experiments usually use Mean Reciprocal Rank (MRR) and the ratio of inference results to the top K hits Hits@K as evaluation indicators. Currently, common hit rates include Hits@1, Hits@3, and Hits@10. The calculation method of the evaluation indicators is as follows:

[0090]

[0091] The rank indicates the ranking of the true result among all the predicted results. The larger the MRR, the higher the ranking of the true result. The higher the Hits@1, the more suitable the model is for the current dataset, and the higher the Hits@10, the better the model's potential learning ability.

[0092] The GLARGCN model was trained on a Tesla V100 GPU using the PyTorch framework. TKG was created using only the training set datasets, and GLARGCN was allowed to search for neighbors along the entire timeline of TKG. The learning rate for all datasets was 0.001 and the dropout rate was 0.3. The embedding dimension was set to 300 for the ICEWS14 and ICEWS0515-15 datasets and 200 for the GDELT dataset. The number of sampled neighbors was set to 100 for the ICEWS14 and ICEWS0515-15 datasets and 200 for the GDELT dataset.

[0093] In order to verify the effectiveness of the GLARGCN model, experiments were conducted on three public TKG datasets: ICEWS14, ICEWS05-15, and GDLET. GLARGCN was compared with mainstream baseline models, including static KG completion methods ComplEx and SimplE; TKGC methods DE-SimplE, ATiSE, TNTComplEx, ChronoR, TeLM, and BoxTE; and some TKGC models based on GNN architecture similar to GLARGCN were selected, including TeMP, T-GAP, TARGAT, and TARGCN.

[0094] The experimental results are shown in Table 2. The best results are shown in bold. In general, the proposed GLARGCN outperforms the current popular algorithms except Hits@10 on ICEWS14 and Hits@10 on ICEWS05-15, which proves the effectiveness of the model. Compared with ComplEx and SimplE, GLARGCN achieves significant performance improvements on all three datasets, which shows the importance of temporal information for the TKGC task. Compared with related models (such as TRARGCN), GLARGCN also achieves excellent performance. Unlike TARGCN, which only focuses on recent events, GLARGCN comprehensively considers global and local neighborhood information and learns dynamic representations of neighbor nodes through a time-aware relation encoder, which enables GLARGCN to learn richer and more accurate contextual representations. Models such as T-GAP, TeMP, and TARGAT use attention mechanisms to select important neighbor nodes. Although they achieve good performance, they also increase model parameters and memory consumption. GLARGCN adopts a sampling process without learnable parameters and has a simpler model structure. This also shows that pursuing complex modules is not the only approach when facing TKGC tasks.

[0095] Table 2: Comparison of experimental results of different TKGC methods on three benchmark datasets.

[0096]

[0097]

[0098] While GLARGCN performs well in performance, it also has certain advantages in parameter efficiency. The performance of TeMP, T-GAP, TARGCN and GLARGCN under different parameter amounts were compared on ICEWS14. The parameter amount of the model was adjusted only by adjusting the embedding size of entities and relations without changing the GLARGCN model structure and other hyperparameter configurations. Figure 4As shown in the figure, under similar parameter configuration, GLARGCN always outperforms the other three comparison models. At the same time, GLARGCN can also maintain good performance with a smaller parameter amount. This is because the sampler selects important time neighbors based on the global historical event frequency and the local time relative displacement, and the sampling process does not require learnable parameters. Models such as TeMP and T-GAP use the self-attention mechanism to generate the attention scores of neighbor nodes, which increases the computational complexity of the model to a certain extent. When faced with large-scale TKG completion tasks, this method often leads to higher memory consumption. For example, when training the model with the ICEWS05-15 dataset, T-GAP requires 29.8G of memory under the default configuration, while GLARGCN only requires 1.4G of memory. This is because T-GAP uses an initial GNN to create initial features for each entity in TKG, which brings a large memory footprint. However, GLARGCN uses a parameter-free sampling strategy and aggregates features in a unified manner, thus effectively controlling parameter consumption. TeMP takes a partial graph of time span τ as input, while TARGCN forces the sampler to focus on the fact that queries are temporally close. Neither of them can fully capture the information of the entire graph structure.

[0099] Those skilled in the art should understand that the modules or steps of the present disclosure can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present disclosure is not limited to any specific combination of hardware and software.

[0100] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0101] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Technical personnel in the relevant field should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.

Claims

1. A temporal knowledge graph completion method based on a relational graph convolutional neural network, characterized in that: The following steps are involved: The global and local information aware subgraph sampler obtains the key neighbors of the central node and creates a subgraph; The encoder generates a time-aware representation of key neighbors from the subgraph and uses graph convolution to perform feature aggregation to obtain a query embedding representation; The knowledge graph scoring function acts as a decoder and uses the query embedding representation to score the likelihood of a temporal fact.

2. According to the temporal knowledge graph completion method based on relational graph convolutional neural network according to claim 1, it is characterized in that: The subgraph sampler provides a global and local representation of the query (s q ,r q ,? ,t q ) Sample a dependent subgraph G sub ,s q is the head entity, r q For the relationship, t q is the timestamp; it first obtains the query entity s from the temporal knowledge graph TKG q The set of all neighbor nodes Then, the sampling weights of all neighbor nodes are obtained through the global information collection module and the local information collection module respectively; finally, the two sampling weights are fused to obtain the final sampling weight.

3. The temporal knowledge graph completion method based on relational graph convolutional neural network according to claim 2 is characterized in that: The global information collection module is located along t q Search the previous and next timeline for the tail entity set related to the query If a neighbor node e i exist , count it and entity s q In r q The frequency of the next interaction is used as the sampling weight; Otherwise, give it a small weight to avoid ignoring it completely; let w i For q The i-th neighbor node e i The sampling weight, w i is calculated as: Among them, ε is a small constant, indicating that it does not appear in the set The neighbor node weights in t∈T refer to all timestamps t in the timestamp set T in the temporal knowledge graph; G refers to the temporal knowledge graph, which is composed of a set of four-tuples; To represent the global information collection module s q The i-th neighbor node e i The probability of being sampled, is calculated as: Here, k refers to the number of all neighbor nodes of the query entity in the subgraph.

4. The temporal knowledge graph completion method based on relational graph convolutional neural network according to claim 2 is characterized in that: The local information collection module uses the timestamp t q The timestamp t of the neighboring node i Temporal displacement to capture short-term dependencies between entities; The time displacement is exponentially transformed and normalized, using Indicates the local information collection module s q The i-th neighbor node e i The probability of being sampled, is calculated as: Here, k refers to the number of all neighbor nodes of the query entity in the subgraph.

5. The temporal knowledge graph completion method based on relational graph convolutional neural network according to claim 3 or 4 is characterized in that: Use a variable parameter to measure the sampling probability of the global information acquisition module and the sampling probability of the local information acquisition module; sum the two in proportion to get the final sampling probability It means s q The i-th neighbor node e i The probability of being sampled is: The variable hyperparameter α∈[0,1].

6. The temporal knowledge graph completion method based on relational graph convolutional neural network according to claim 1 is characterized in that: The encoder generates a time-aware representation of key neighbors from the subgraph by using a time-aware encoding of neighbor nodes and then using neighbor aggregation to learn s q Context representation; shift the time tt q Mapping to a finite-dimensional function space It is defined as: where w i and φ i are trainable parameters, representing the frequency component and phase component of the i-th dimension in the time encoding, respectively. t Finite-dimensional function space The temporal displacement is sinusoidally transformed to capture the periodic and continuous characteristics of time. Then, the encoding vector of the temporal displacement and the embedding vector of the relation are combined to learn a time-aware relational representation for each temporal neighbor relation: in is the time-invariant representation of each relation r in the temporal neighborhood; a feedforward neural network layer f is used to learn the relation representation h (r,t) .

7. The temporal knowledge graph completion method based on relational graph convolutional neural network according to claim 6 is characterized in that: Use graph convolution to aggregate features to get query embedding representation, specifically: use a layer of relational graph neural network to aggregate s q Neighborhood characteristics: in The expression according to s q and t q The set of critical time neighbors in the sampled subgraph; (r, t) refers to The relationship and timestamp of each time neighbor node in h e Represents the time-invariant representation of each entity e in the temporal neighborhood; through the relationship graph neural network structure, the query entity s is obtained q At time t q The time-aware representation of 8. The temporal knowledge graph completion method based on relational graph convolutional neural network according to claim 1 is characterized in that: The knowledge graph scoring function acts as a decoder and uses the query embedding representation to score the likelihood of a temporal fact as follows: Let score represent the DistMult scoring function. For a quadruple (s, r, ?, t), the score of the quadruple obtained by combining it with the candidate entity o' is defined as follows: where h (s,t) is the time-aware representation of the query entity; h (r,t) is the relational time perception representation when the time difference is 0; ⊙ represents the Hadamard product; h o' is the time-invariant representation of the candidate entity o'; with the score of each candidate entity, the model is trained in a mini-batch manner using the cross entropy loss function: Where o represents the correct answer entity of the query, all observed quadruple in G are traversed, the loss of each quadruple is calculated and summed.

9. A temporal knowledge graph completion system based on relational graph convolutional neural network, including: The subgraph creation module, a subgraph sampler that perceives global and local information, obtains the key neighbors of the central node and creates a subgraph; Embedding representation module, the encoder generates time-aware representations of key neighbors from the subgraph and uses graph convolution to perform feature aggregation to obtain query embedding representation; Scoring Module,The knowledge graph scoring function acts as a decoder and uses the query embedding,representation to score the likelihood of temporal facts.

Citation Information

Cited By

  • Multi-source heterogeneous data entity and relation extraction method and device based on large model

    CN119917525A

  • Wireless charging power adaptive adjustment method and system based on machine learning

    CN120824874A