A time series knowledge graph completion method based on multi-feature fusion learning
By converting temporal knowledge graphs into quadruples and combining them with recurrent neural networks and embedding learning from external semantic libraries, and employing an attention mechanism for feature fusion, the problems of inaccurate temporal knowledge graph completion and high complexity in existing technologies are solved, achieving more efficient semantic feature capture and accurate completion results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIDIAN UNIV
- Filing Date
- 2024-03-05
- Publication Date
- 2026-04-17
AI Technical Summary
Existing time-series knowledge graph completion methods fail to effectively consider the semantic features and relationships between nodes, resulting in inaccurate completion results and high computational complexity.
We employ a multi-feature fusion learning method to convert temporal knowledge graphs into quadruples, use recurrent neural networks and external semantic libraries for embedding learning, and combine attention mechanisms for feature fusion to enhance the model's understanding of context and semantics.
It improves the accuracy and computational efficiency of temporal knowledge graph completion, reduces computational complexity, and enhances the ability to capture semantic relationships between nodes.
Smart Images

Figure CN118113881B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph technology, and in particular to a temporal knowledge graph completion method based on multi-feature fusion learning. Background Technology
[0002] With the rapid development of information technology and the emergence of big data, the size of knowledge graphs is constantly growing, containing a wealth of entities, attributes, and relationships. Meanwhile, events in the real world often exhibit temporal sequence, evolving over time, and different entities and relationships change over time. Therefore, the concept of temporal knowledge graphs has been proposed. Like traditional knowledge graphs, temporal knowledge graphs also suffer from incompleteness and missing information, and predicting future events is crucial in their dynamic evolution. Therefore, continuously exploring and developing research on completing temporal knowledge graphs is essential to address the complex temporal dynamics of the real world.
[0003] Chinese patent document CN115238855A proposes a method and related device for completing a temporal knowledge graph based on a graph neural network. The method acquires temporal knowledge graphs from multiple historical moments and the current moment, preprocesses each of the temporal knowledge graphs, inputs all the preprocessed temporal knowledge graphs into a pre-trained completion model, obtains the final representation vector of each node in the current moment's temporal knowledge graph, and selects the candidate node with the highest similarity to the node corresponding to the final representation vector from a pre-constructed candidate set using a similarity calculation model. The current moment's temporal knowledge graph is then completed based on this completion node. This method has the following shortcomings: 1. It does not consider the relationships between nodes and rich semantic features, only determining the completion node through vector similarity calculation, which may lead to some completion results that do not conform to the actual relationships and semantic constraints between nodes. 2. The accuracy of the similarity calculation model is affected by the candidate node set; if the candidate node set is not rich enough or of low quality, the completion effect may be poor.
[0004] Chinese patent document CN115391553B proposes a method for automatically searching a temporal knowledge graph completion model. The method includes: Step 1: Dividing the temporal knowledge graph to be completed into several static knowledge graph slices according to different timestamps; Step 2: Defining a search space and constructing a hypernetwork based on the defined search space; Step 3: Optimizing the parameters of the hypernetwork using a single-path sampling strategy; Step 4: Performing an architecture sampling on the hypernetwork, allowing the architecture to inherit the corresponding parameters of the hypernetwork, and using the architecture for inference on a validation set to obtain validation performance; Step 5: Implementing Step 4 several times to obtain the architecture with the optimal validation performance. The shortcomings or limitations of this method are: 1. High requirements for the temporal knowledge graph slices. This method divides the temporal knowledge graph into static knowledge graph slices, which requires high quality and completeness of the temporal knowledge graph itself, placing certain requirements on data quality. 2. Limitations in semantic understanding. This method only relies on surface-level semantic similarity for completion, without a deep understanding of the semantic relationships and constraints between nodes. This may lead to some completion results that do not conform to the actual semantics and fail to accurately capture the complex semantic relationships between nodes. 3. High computational complexity. Since this method involves slicing the temporal knowledge graph to be completed and constructing a hypernetwork for optimization, it inevitably leads to high computational complexity, especially in the case of large-scale knowledge graphs, which increases the time cost of training and inference. Summary of the Invention
[0005] The purpose of this invention is to provide a temporal knowledge graph completion method based on multi-feature fusion learning, which addresses all or part of the problems mentioned above, so as to fully consider the semantic knowledge features implicit in entities and relations during entity completion and improve the accuracy of temporal knowledge graph completion.
[0006] The technical solution adopted in this invention is as follows:
[0007] A temporal knowledge graph completion method based on multi-feature fusion learning, comprising:
[0008] The input temporal knowledge graph is converted into a quadruple form, which contains four tensors: head entity, relation, tail entity, and timestamp.
[0009] A recurrent neural network is used to learn the text embeddings of the existing tensors in the quadruples to obtain the text feature vectors.
[0010] The semantic knowledge of the quadruple is expanded using an external semantic library, and the expanded semantic knowledge is embedded and learned using a pre-trained model to obtain the expanded feature vector.
[0011] A sparse two-dimensional matrix is constructed based on the timestamps of the historical time sequence knowledge graph. A vector mask for the current time is generated based on the sparse two-dimensional matrix. The existing tensors in the quadruples are concatenated and then dimension-reduced. The vector mask is added to the dimension-reduced tensor to obtain the time evolution vector.
[0012] An attention mechanism is used to dynamically and adaptively fuse the text feature vector, the augmented feature vector, and the temporal evolution vector to obtain a prediction score.
[0013] The training is iteratively trained with the goal of minimizing the gap between the predicted score and the actual score of the training data. After training, the time-series knowledge graph to be completed is input, and the target entities corresponding to the obtained predicted scores are used to complete the graph.
[0014] Furthermore, the method of using a recurrent neural network to learn the embedding of the text in the existing tensors of the quadruples to obtain the text feature vector includes:
[0015] One-hot encoding is performed on the existing tensors in the quadruple to obtain the corresponding binary vectors;
[0016] Concatenate the binary vectors of each tensor along a specified dimension.
[0017] Furthermore, before using a pre-trained model to learn the embeddings of the augmented semantic knowledge, the following steps are also included:
[0018] Text cleaning of the expanded semantic knowledge includes:
[0019] Remove special characters and punctuation marks;
[0020] Standardize the text format;
[0021] Remove stop words.
[0022] Furthermore, the use of external semantic libraries to expand the semantic knowledge of quadruples is to use WordNet to expand the semantic knowledge of quadruples.
[0023] Furthermore, when using a pre-trained model to embed the expanded semantic knowledge, a first identifier and a second identifier are added to the beginning and end of the expanded semantic knowledge, respectively.
[0024] Furthermore, the construction of a sparse two-dimensional matrix based on the timestamps of the historical time-series knowledge graph includes:
[0025] Filter out all quadruples under each timestamp from the historical time-series knowledge graph;
[0026] For each timestamp, the row and column indices of the sparse two-dimensional matrix are calculated using the selected quadruples. The row index is the value of the linear transformation between the head entity index and the relation index in the quadruple, and the column index is the index of the tail entity.
[0027] Furthermore, the generation of the vector mask for the current time based on the sparse two-dimensional matrix includes:
[0028] In the sparse two-dimensional matrix constructed based on the historical time-series knowledge graph before the current time, the values of the positions containing entities are set to 0, and the values of the remaining positions are set to -100.
[0029] Furthermore, the step of concatenating existing tensors in the quadruple and then reducing dimensionality includes:
[0030] Concatenate the existing tensors in the quadruple along a specified dimension to obtain a new tensor;
[0031] The new tensor is then dimensionality-reduced by passing it through a linear layer and an activation function.
[0032] Furthermore, an attention mechanism is employed to dynamically and adaptively fuse the text feature vector, augmented feature vector, and temporal evolution vector, including:
[0033] The text feature vector, augmented feature vector, and temporal evolution vector are mapped to a unified score space using a multilayer perceptron and then normalized to obtain three corresponding prediction probabilities.
[0034] The prediction score is obtained by weighted summation of the three prediction probabilities.
[0035] Furthermore, the attention weights configured when weighting and summing the three predicted probabilities are adjusted using a linearly transformed attention model.
[0036] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0037] 1. This invention expands the semantic knowledge of entity relationships in a temporal knowledge graph with an external semantic library and uses deep learning technology to embed semantic knowledge features into text sequences with the help of advanced pre-trained language models, thereby enhancing the model's understanding of context and semantics.
[0038] 2. This invention captures three key features of temporal knowledge graphs: original text features, semantic knowledge features, and temporal history features. It uses different deep learning models to learn the features of different modules of temporal knowledge graphs, and performs feature fusion of the three modules based on an attention mechanism, effectively integrating the complementary features between the modules to improve the model's prediction and completion capabilities.
[0039] 3. Although the present invention designs three modules for feature extraction during the feature training stage, the model structures of the three modules are relatively simple, resulting in low overall computational complexity. Furthermore, the three modules can run in parallel, leading to high computational efficiency. Attached Figure Description
[0040] The present invention will be described by way of example and with reference to the accompanying drawings, wherein:
[0041] Figure 1 This is a model architecture diagram of the temporal knowledge graph completion method of this invention.
[0042] Figure 2 This is a flowchart of semantic knowledge expansion and cleaning.
[0043] Figure 3 This is the embedding flowchart for expanding feature vectors. Detailed Implementation
[0044] All features disclosed in this specification, or all steps in all disclosed methods or processes, may be combined in any way, except for mutually exclusive features and / or steps.
[0045] Any feature disclosed in this specification (including any appended claims and abstract) may be replaced by other equivalent or similar features, unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is merely one example of a series of equivalent or similar features.
[0046] Existing temporal knowledge graph completion methods have failed to effectively mine the rich semantic features within the knowledge graph. However, the existence of each node in a knowledge graph carries specific contextual meaning, and existing models do not consider the implicit semantic knowledge features of entities and relationships. This, to some extent, prevents the temporal knowledge graph from being effectively represented. To address this issue, the following section details the temporal knowledge graph completion method based on multi-feature fusion learning proposed in this invention.
[0047] Example 1
[0048] The input time-series knowledge graph is converted into a four-tuple form. During the training phase, the input time-series knowledge graph is the training data (historical time-series knowledge graph), while during the prediction phase, it is the time-series knowledge graph to be completed.
[0049] A temporal knowledge graph quadruple consists of four tensors: head entity, relation, tail entity, and timestamp, in the form G = {s, p, o, t}, where s, p, o, and t represent the head entity, relation, tail entity, and timestamp, respectively. As mentioned in the background section, temporal knowledge graphs often contain missing or incomplete elements, such as {s, p, ?, t} or {?, p, o, t}, where the ? position represents the missing part, usually an entity. Therefore, it is necessary to complete the quadruple by filling in the missing head entity s or tail entity o based on existing data.
[0050] The model architecture in this embodiment is designed into four parts: text feature embedding, semantic knowledge embedding, historical feature evolution, and feature fusion. The data flow of these four parts is described in [link to documentation]. Figure 1 The model architecture is shown. If the method of this embodiment is visualized and a system design is adopted, the system, in addition to the preprocessing module used to convert the temporal knowledge graph into quadruples, also includes a text feature embedding module, a semantic knowledge embedding module, a historical feature evolution module, and a feature fusion module, which correspond one-to-one with the four parts mentioned above.
[0051] 1. Text feature embedding part
[0052] This section uses a recurrent neural network to learn the embeddings of the text in the existing tensors of the quadruples, and obtains the text feature vectors.
[0053] This section utilizes deep learning techniques to extract and transform features from the original quadruples of the temporal knowledge graph, mapping the raw data into a high-dimensional tensor containing textual features. A quadruple consists of text containing a head entity s, a relation p, a tail entity o, and a timestamp t. Since it cannot be directly used for model learning, word embedding techniques are required to encode the text. Word embedding requires collecting and numbering all words to construct a vocabulary. All words in the vocabulary are independent and have a one-to-one index mapping. In some implementations, the text of the head / tail entities within the quadruples is converted into corresponding binary vectors using one-hot encoding, and the relation and timestamp are also converted into binary vectors in the same way. Alternatively, bag-of-words models, N-gram models, TF-IDF models, Word2Vec models, GloVe models, etc., can be chosen to implement the word embedding of this invention.
[0054] In practice, this part is configured in the model's embedding layer. The quadruple is input into the embedding layer, and based on the input data, it can determine whether the missing entity (i.e., the entity to be predicted) is a head entity or a tail entity. The binary vectors of the existing tensors (i.e., the three tensors other than the one to be predicted) are concatenated along a specified dimension, returning a tensor containing text features, which is the text feature vector. Taking the prediction of the tail entity 'o' as an example, this text feature vector r... q In the embedding layer, this is represented as follows:
[0055] r q =C r [s,p,t]+b r (1)
[0056] Where s, p, and t are three tensors representing entity, relation, and time, respectively, and C... r Concatenate three tensors along a specified dimension, where q represents a quadruple and C r b rThese are trainable parameters. The same applies when predicting the head entity s.
[0057] 2. Semantic knowledge embedding part
[0058] This part uses an external semantic library to expand the semantic knowledge of the quadruple, and uses a pre-trained model to embed the expanded semantic knowledge to obtain the expanded feature vector.
[0059] This section uses deep learning techniques to extract and transform features from the semantic knowledge of relations and entities constructed from external semantic libraries, mapping it into high-dimensional tensors containing rich semantic knowledge. In some implementations, WordNet is used to augment the semantic knowledge of the quadruplets.
[0060] WordNet is a semantic network for English vocabulary. By using WordNet's API, rich semantic knowledge such as context, hypernyms, hyponyms, parts of speech, and associations can be added to entities and relations, thereby improving the semantic expressive power of entity relations and facilitating a deeper understanding of the semantic features of entity relations.
[0061] This paper encapsulates the WordNet API interface to extend the semantic knowledge of entity relations within quadruples, achieving sentence-level semantic augmentation. Specifically, for the prediction task of the head entity s, the semantic knowledge of the tail entity o and relation p is extended, denoted as d. o and d p For the prediction task of tail entity o, the semantic knowledge of head entity s and relation p is expanded, denoted as d. s and d p .
[0062] For the expanded semantic knowledge, some implementations also include text cleaning operations, including:
[0063] (1) Remove special characters and punctuation marks;
[0064] (2) Standardize the text format, for example, standardize the text letters to lowercase;
[0065] (3) Stop word filtering. Removing stop words can reduce the dimensionality and noise of text data. In English text cleaning, stop word filtering is often necessary to better focus on key features and meaningful words. Stop word filtering refers to removing common meaningless words from the text. These words usually have no practical meaning for text analysis and modeling tasks, such as "a", "an", "the", "is", "are", etc. The specific process of semantic knowledge expansion and cleaning is as follows: Figure 2 As shown.
[0066] For the expanded semantic knowledge, in some implementations, a BERT pre-trained model is used for word embedding learning. Specifically, in this section, the BERT pre-trained model and its word segmenter are loaded to extract features from the (cleaned) semantic knowledge. The embedding process is as follows: Figure 3 As shown, the semantic knowledge text of entity relations is segmented into tokens (the smallest unit of text segmentation) required by the BERT pre-trained model using a tokenizer. Additionally, special markers (e.g., first marker - [CLS], second marker - [SEP]) can be added at the beginning and end of the sentence to indicate these distinctions. The obtained tokens are then encoded using the BERT pre-trained model. i Let t represent the embedding vector. i This represents the feature vector obtained after encoding the i-th token using the BERT pre-trained model. The output is the hidden state of the last layer of the BERT pre-trained model, which contains a deep representation of the input text. A fully connected layer is used to reduce the dimensionality of the obtained hidden state, yielding and returning the semantic tensor containing the semantic knowledge embedding. That is, to expand the feature vector.
[0067] y s =FL(BE(T(d) s )))+b s (2)
[0068] Where T represents the word segmentation operation of the BERT pre-trained model's word segmenter, BE represents the embedding operation of the loaded English pre-trained model, FL represents the fully connected operation of the fully connected layer, and b s These are trainable parameters.
[0069] 3. Historical Characteristics and Evolution
[0070] This section constructs a sparse two-dimensional matrix based on the timestamps of the historical time-series knowledge graph, generates a vector mask for the current time based on the sparse two-dimensional matrix, concatenates the existing tensors in the quadruples and performs dimensionality reduction, and adds the vector mask to the dimensionality-reduced tensors to obtain the time evolution vector.
[0071] Similarly, this part uses deep learning technology to combine historical snapshots of each timestamp in the temporal knowledge graph to construct a sparse two-dimensional matrix, assign weights to historical entities to generate mask tensors, which are beneficial for potentially correct historical entities, and obtain and return tensor representations containing historical features.
[0072] This section requires first constructing a sparse two-dimensional matrix to store the historical static graph based on the timestamps of the historical time-series knowledge graph. Assuming the timestamp displays time t, the sparse two-dimensional matrix is represented as follows: In some implementations, this sparse two-dimensional matrix is constructed through the following steps:
[0073] We filter all four-tuples for each timestamp from the historical time-series knowledge graph (i.e., training data). In this step, t represents the current time, and the statistical range of timestamps is 0 to t. Assuming t represents the current time, the sparse two-dimensional matrix for the current time is constructed from the historical time-series knowledge graph before timestamp t (i.e., before the current time). Under each timestamp:
[0074] The row and column indices of the sparse two-dimensional matrix are calculated using the selected quadruples. The row index is the value of the linear transformation between the head entity s index and the relation p index in the quadruple, and the column index is the index of the tail entity. The sparse two-dimensional matrix is constructed and saved according to the row and column indices. Based on this matrix, the time-series knowledge graph for the first t time steps can be represented using the sparse two-dimensional matrix. Perform representation
[0075] After inputting the sparse two-dimensional matrix and the temporal knowledge graph quadruple tensor, the entity, relation, and timestamp tensors are first concatenated to obtain a new tensor. For the task of predicting the head entity s, the order of the three tensors is relation p, tail entity o, and timestamp t; for the task of predicting the tail entity o, the order of the three tensors is head entity s, relation p, and timestamp t. The resulting new tensor is then subjected to dimensionality reduction through a linear layer and an activation function, transforming it into a new vector representation to improve computational efficiency while preserving important features.
[0076] Taking the task of predicting the tail entity o as an example, the new vector is represented as:
[0077]
[0078] Where s, p, and t are the head entity, relation, and timestamp tensors, respectively, and C... v This represents concatenating three tensors along a specified dimension, where q represents a quadruple, L is a linear operation of a linear layer, ReLU is the activation function, and C... v b v These are trainable parameters.
[0079] For each entity and relation, based on the sparse two-dimensional matrix... Generate a vector mask for the current time t. t , sparse two-dimensional matrix Entities present in the vector are considered potentially correct historical entities, with their positions set to 0 and the remaining positions set to -100. This is done to ensure that potentially correct historical entities are selected whenever possible. The new vector representation is added to the vector mask and returned to obtain the time evolution vector.
[0080]
[0081] Among them, Mask t Represents the time series knowledge graph based on the previous t time steps. The generated vector mask.
[0082] 4. Feature Fusion Section
[0083] This part employs an attention mechanism to dynamically and adaptively fuse text feature vectors, augmented feature vectors, and temporal evolution vectors to obtain a prediction score.
[0084] The above three parts yield the text feature vector, the augmented feature vector, and the temporal evolution vector, respectively. In this part, a multilayer perceptron is used to map the text feature vector, the augmented feature vector, and the temporal evolution vector to a unified score space, and then normalization processing (softmax) is performed to obtain three corresponding prediction probabilities:
[0085] p i =softmax(MLP(i)+b i ),i∈{r q ,y s ,h t} (5)
[0086] Where MLP represents a multilayer linear perceptron, softmax is the activation function, and b i For trainable parameters, r q ,y s ,h t These are the text feature vector, extended feature vector, and time evolution vector output from the three parts mentioned above, respectively.
[0087] An attention mechanism is used to dynamically and adaptively fuse the three predicted probabilities, and the prediction score is obtained by weighted summation. By integrating multi-dimensional features, the ability to complete the temporal knowledge graph is improved.
[0088] Attention mechanisms are a method for weighted combination of multiple features, which emphasizes or diminishes their contribution by assigning different weights to different features during training.
[0089] In some implementations, the feature fusion process includes: the attention model employs a linear transformation as the attention weight calculation method to adjust the weights of the three predicted probabilities. The normalized three predicted probabilities are then passed to the attention model to obtain the corresponding attention weights. The three input predicted probabilities are then weighted and summed using the attention weights to obtain and return the final result as the prediction score.
[0090] In addition, pooling average, max pooling, min pooling, and other methods can be selected as the methods for calculating attention weights to implement different attention mechanism allocation strategies.
[0091] This invention treats the problem of completing a time-series knowledge graph as a sequence prediction problem, combines the prediction probabilities of the three parts, and finally selects the entity with the highest prediction score as the target entity.
[0092] Taking the prediction of the tail entity o as an example, we have:
[0093]
[0094] Where α1, α2, and α3 are the training parameters of the attention weights of the three vectors, which satisfy α1 + α2 + α3 = 1. and These are the predicted probabilities of the three vectors, and p(o|s,p,t) is the prediction score.
[0095] The above sections describe the construction of the prediction model. When performing the prediction task, iterative training is required with the goal of minimizing the difference between the predicted score and the actual score in the training data. The training process can be terminated by setting a gap threshold or a set number of iterations. After training is complete, the temporal knowledge graph to be completed is input, resulting in a predicted score. The entity corresponding to this predicted score is then used as the target entity to complete the temporal knowledge graph.
[0096] In some embodiments, the task of predicting the tail entity o continues, and the training loss function is defined as:
[0097]
[0098] Where N is the number of semantic knowledge text segments, k represents the index of the current predicted entity, and y tk This indicates that y represents the prediction when entity o is the k-th entity. tk The value is 1 if the loss is positive and 0 otherwise. Minimizing this loss can improve the model's predictive completion ability.
[0099] Example 2
[0100] This embodiment performs side-tests on two public datasets to demonstrate the effectiveness of the invention. The two benchmark datasets and evaluation metrics will be described in detail below.
[0101] This experiment used two benchmark datasets, ICEWS18 and GDELT, to evaluate the proposed technical solution. The GDELT event dataset collects global news data from January 1979 to the present, while ICEWS18 records all timestamped facts from January 1, 2018 to October 31, 2018. The table below shows the statistics for the two datasets.
[0102] Table 1 Statistical data of the dataset
[0103] #Data #Entity #Relation #Training #Validation #Test #Granularity #Time Granules ICEWS18 23033 256 373018 45995 49545 24 hours 304 GDELT 7691 240 1734399 238765 305241 15mins 2751
[0104] The model's evaluation metrics are: MRR and Hits@1 / 3 / 10 (the proportion of correct test results ranked in the top 1 / 3 / 10). MRR is the average reciprocal ranking, calculated as follows:
[0105]
[0106] Where S is the set of quadruples, |S| is the number of sets of quadruples, and rank is... i The predicted rank of the entity in the i-th quadruple is determined by the position of the actual value in the predicted list.
[0107] Hits@n refers to the average percentage of quadruplets ranked less than n in link prediction. The specific calculation method is as follows:
[0108]
[0109] in, This is an indicator function; if the condition is true, the function value is 1, otherwise it is 0.
[0110] To evaluate the effectiveness of the model, this invention uses several representative temporal knowledge graph completion methods as benchmark models. This method selects multiple models for comparison, including classic static knowledge graph models TransE, R-GCN, and ConvE, as well as temporal knowledge graph completion models TTransE, R-GCRN+MLPRE-NET, and CyGNet. The evaluation metrics are shown in the table below.
[0111] Table 2 Comparison of Model Indicators
[0112]
[0113] As shown in the table, this technical solution achieved good performance in most cases. On the ICEWS18 dataset, compared with the comparison method, the proposed method improved the performance of the best-performing model by 3.21%, 5.61%, and 1.41% in the three evaluation metrics of MRR, Hits@1, and Hits@3, respectively, and slightly decreased in the Hits@10 evaluation metric, but still showed a certain improvement compared with other benchmark models. On the GDELT dataset, compared with the comparison method, the proposed method improved the performance of the model by 3.73%, 3.94%, 4.11%, and 3.07% in the four evaluation metrics of MRR, Hits@1, Hits@3, and Hits@10, respectively. It can be seen that this invention, by comprehensively enriching background knowledge, adding valuable semantic knowledge, and deeply mining the semantic connotation of temporal knowledge graphs, effectively improves the accuracy of temporal knowledge graph prediction and completion tasks.
[0114] Table 3 Model Ablation Experiment
[0115]
[0116] Furthermore, to explore the impact of augmented semantic knowledge, word embedding techniques, and attention mechanisms on the model, this invention also conducted multiple ablation experiments. The Onehot-GC model uses one-hot encoding for word embedding, while simultaneously removing modules other than the semantic knowledge embedding module to investigate the impact of external knowledge base augmented semantic knowledge on the model. It can be seen that using only semantic knowledge embedding for prediction is more effective than traditional methods such as TransE, but its performance is still poor, requiring the integration of temporal aspects to address the completion task. The Onehot model uses one-hot encoding for word embedding but does not add an attention mechanism; instead, it manually assigns weights to each module. The Onehot+att model uses one-hot encoding for word embedding and adds an attention mechanism for adaptive feature fusion. The Ber model uses the pre-trained language model BERT for word embedding but does not add an attention mechanism; instead, it manually assigns weights to each module. The Ber+att model uses the pre-trained language model BERT for word embedding and adds an attention mechanism for adaptive feature fusion. As shown in Table 3, the introduction of external semantic knowledge, word embedding techniques, and the use of attention mechanisms all have a certain performance enhancement effect on the model.
[0117] This invention is not limited to the specific embodiments described above. The invention extends to any new feature or combination disclosed in this specification, as well as any new method or process step or combination disclosed herein.
Claims
1. A temporal knowledge graph completion method based on multi-feature fusion learning, characterized in that, include: The input temporal knowledge graph is converted into a quadruple form, which contains four tensors: head entity, relation, tail entity, and timestamp. A recurrent neural network is used to learn the text embeddings of the existing tensors in the quadruples to obtain the text feature vectors. The semantic knowledge of the quadruple is expanded using an external semantic library, and the expanded semantic knowledge is embedded and learned using a pre-trained model to obtain the expanded feature vector. Constructing a sparse two-dimensional matrix based on the timestamps of the historical time-series knowledge graph includes: selecting all quadruplets under each timestamp from the historical time-series knowledge graph; for each timestamp, calculating the row and column indices of the sparse two-dimensional matrix using the selected quadruplets, where the row index is the value of the linear transformation between the head entity index and the relation index in the quadruplet, and the column index is the index of the tail entity. Generate a vector mask for the current time based on a sparse two-dimensional matrix, including: setting the values of positions containing entities in the sparse two-dimensional matrix constructed based on the historical time-series knowledge graph before the current time to 0, and setting the values of the remaining positions to -100; The existing tensors in the quadruple are concatenated and then dimension-reduced; the vector mask is added to the dimension-reduced tensor to obtain the time evolution vector; An attention mechanism is used to dynamically and adaptively fuse the text feature vector, the augmented feature vector, and the temporal evolution vector to obtain a prediction score. The training is iteratively trained with the goal of minimizing the gap between the predicted score and the actual score of the training data. After training, the time-series knowledge graph to be completed is input, and the target entities corresponding to the obtained predicted scores are used to complete the graph.
2. The temporal knowledge graph completion method based on multi-feature fusion learning as described in claim 1, characterized in that, The method of using a recurrent neural network to embed the text into the existing tensors of the quadruples to obtain text feature vectors includes: One-hot encoding is performed on the existing tensors in the quadruple to obtain the corresponding binary vectors; Concatenate the binary vectors of each tensor along a specified dimension.
3. The temporal knowledge graph completion method based on multi-feature fusion learning as described in claim 1, characterized in that, Before using a pre-trained model to learn the embeddings of the augmented semantic knowledge, the following steps are also included: Text cleaning of the expanded semantic knowledge includes: Remove special characters and punctuation marks; Standardize the text format; Remove stop words.
4. The temporal knowledge graph completion method based on multi-feature fusion learning as described in claim 1, characterized in that, The use of external semantic libraries to expand the semantic knowledge of quadruples refers to using WordNet to expand the semantic knowledge of quadruples.
5. The temporal knowledge graph completion method based on multi-feature fusion learning as described in claim 1, characterized in that, When using a pre-trained model to embed the augmented semantic knowledge, a first identifier and a second identifier are added to the beginning and end of the augmented semantic knowledge, respectively.
6. The temporal knowledge graph completion method based on multi-feature fusion learning as described in claim 1, characterized in that, The method of concatenating existing tensors in a quadruple and then reducing its dimensionality includes: Concatenate the existing tensors in the quadruple along a specified dimension to obtain a new tensor; The new tensor is then dimensionality-reduced by passing it through a linear layer and an activation function.
7. The temporal knowledge graph completion method based on multi-feature fusion learning as described in claim 1, characterized in that, An attention mechanism is used to dynamically and adaptively fuse the text feature vector, augmented feature vector, and temporal evolution vector, including: The text feature vector, augmented feature vector, and temporal evolution vector are mapped to a unified score space using a multilayer perceptron and then normalized to obtain three corresponding prediction probabilities. The prediction score is obtained by weighted summation of the three prediction probabilities.
8. The temporal knowledge graph completion method based on multi-feature fusion learning as described in claim 7, characterized in that, The attention weights configured when weighting and summing the three predicted probabilities are adjusted using a linearly transformed attention model.
Citation Information
Patent Citations
Complementation method of time sequence knowledge graph based on graph neural network and related equipment
CN115238855A
A method for automatically searching time-series knowledge graph completion models
CN115391553B
Time sequence knowledge graph completion method and system based on time graph convolutional network
CN114780739A
Entity type fused BERT knowledge graph completion method and system
CN116010622A