A Temporal Knowledge Graph Link Prediction Method for the News Domain

By constructing a temporal knowledge graph and utilizing CNN-LSTM and Time-ConvKB models, the problems of data sparsity and diversity in knowledge graph link prediction in the news domain are solved, improving prediction accuracy and model practicality.

CN116737943BActive Publication Date: 2026-03-13HAINAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-19
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies for predicting knowledge graph links in the news field suffer from problems such as data sparsity, data imbalance, lack of labeled data, diversity and variability, and model interpretability, which affect the accuracy and stability of link prediction.

Method used

We employ a temporal knowledge graph approach, which involves acquiring news datasets and adding timestamp information to construct a temporal knowledge graph. We then encode this graph using a CNN-LSTM model with an attention mechanism, and combine periodic and non-periodic time vectors to generate an embedding matrix. Finally, we construct a Time-ConvKB model based on ConvKB for prediction.

Benefits of technology

This improved the model's predictive accuracy, enhanced its timeliness in responding to news data, and increased the practicality and interpretability of the predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116737943B_ABST
    Figure CN116737943B_ABST
Patent Text Reader

Abstract

This invention discloses a method for predicting links in a time-series knowledge graph in the news domain, comprising the following steps: converting a preprocessed news dataset into a static knowledge graph; adding timestamp information to each entity node and relation edge of the static knowledge graph, and pruning it into several time subgraphs using a sliding time window to form a time-series knowledge graph; encoding the time-series knowledge graph to obtain a time-series encoding vector; generating periodic and aperiodic time vectors using a time vector generator, and combining the periodic and aperiodic time vectors with the time-series encoding vectors to form an embedding matrix; constructing a Time-ConvKB model, embedding the embedding matrix into the Time-ConvKB model, and obtaining the prediction result. This invention can solve the data sparsity problem of traditional knowledge graphs in the news domain, improve the prediction accuracy of the model, better reflect the timeliness of news data, and improve the practicality of prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of news, and more particularly to a method for predicting time-series knowledge graph links in the news field. Background Technology

[0002] Knowledge graphs are an important component of artificial intelligence, describing concepts, entities, and relationships in the real world in a structured way. Knowledge graph link prediction for news data is a research task that aims to predict relationships between entity nodes that have not yet appeared in the knowledge graph.

[0003] Currently, the technologies used for knowledge graph link prediction for news data are mainly based on graph neural networks, time series decomposition, deep reinforcement learning, or multi-task learning. However, these technologies suffer from the following drawbacks: 1. Data sparsity: Due to the uncertainty and timeliness of news data, entity and relationship information in news knowledge graphs is very sparse, posing a challenge to link prediction. 2. Data imbalance: Entities and relationships in news data often exhibit different categories and quantity distributions, leading to sample imbalance, which affects the accuracy and stability of link prediction. 3. Lack of labeled data: For knowledge graphs in the news domain, there is a lack of large-scale labeled data, making it difficult to train and evaluate link prediction models. 4. Diversity and variability: News data is characterized by diversity and variability. For example, the attributes and relationships of the same entity may change at different times, requiring link prediction models to adapt to this change and diversity. 5. Model interpretability: Knowledge graph link prediction models for news data need to have a certain degree of interpretability, meaning that the model's prediction results need to be understandable and interpretable by humans. This is crucial for knowledge reasoning and decision-making in the news domain. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention proposes a time-series knowledge graph link prediction method for the news domain. This method overcomes the data sparsity issue inherent in traditional knowledge graphs in the news domain, improves the model's prediction accuracy, better reflects the timeliness of news data, and enhances the practicality of prediction.

[0005] To achieve the above objectives, the technical solution of the present invention is as follows:

[0006] A method for predicting links in a time-series knowledge graph for the news domain includes the following steps:

[0007] Obtain and preprocess the news dataset, then convert the preprocessed news dataset into a static knowledge graph;

[0008] Add timestamp information to each entity node and relation edge of the static knowledge graph, and crop it into several time subgraphs through a sliding time window to form a time-series knowledge graph;

[0009] The temporal knowledge graph is encoded using a CNN-LSTM model with an attention mechanism to obtain a temporal encoding vector;

[0010] A time vector generator is used to generate periodic and aperiodic time vectors, and the periodic and aperiodic time vectors are combined with the time-series coding vector to form an embedding matrix;

[0011] A Time-ConvKB model based on ConvKB is constructed, and the embedding matrix is ​​embedded into the Time-ConvKB model to obtain the prediction results.

[0012] Preferably, the news dataset is obtained by crawling news data from multiple news websites in parallel using a distributed crawling framework.

[0013] Preferably, the step of encoding the time-series knowledge graph to obtain a time-series encoding vector specifically includes the following steps:

[0014] The entity nodes and relation edges in the temporal knowledge graph are represented as node feature matrices and adjacency matrices;

[0015] A CNN module is used to perform convolution operations on the node feature matrix of the time subgraph to extract local features, while an attention module performs a weighted average of the node feature matrix of the time subgraph to obtain attention features.

[0016] The node feature vector is obtained by multiplying the local features output by the corresponding CNN module and the attention features output by the corresponding attention module element by element.

[0017] The node feature vectors of all time subgraphs are sequentially input into the LSTM network in chronological order to encode the time series information and generate time-series encoded vectors.

[0018] Preferably, the step of constructing a Time-ConvKB model based on ConvKB, embedding the embedding matrix into the Time-ConvKB model, and obtaining the prediction result includes the following steps:

[0019] Let the encoded main entity vector be... The objective entity vector is The relation vector is r t The periodic and non-periodic time vectors are and Then a quadruple is defined as a k×5 embedding matrix.

[0020] The embedding matrix is ​​passed through a k×5 filter to extract the global relationships between terms of the same dimension in the embedding matrix, generating different feature maps;

[0021] After obtaining the mapping, the prediction vector P of Time-ConvKB is as follows:

[0022]

[0023] Where Ω and w are shared parameters, * represents the convolution operator, concat represents the concatenation operator, and the loss function formula is shown below:

[0024]

[0025]

[0026] in, F′ t It is F t The set of invalid quadruples generated from the invalid quadruples in the valid quadruples is used to convert the prediction vector P into a probability value through the sigmoid function to obtain the prediction result.

[0027] Based on the above technical solution, the beneficial effects of this invention are as follows: A news dataset is acquired and preprocessed; the preprocessed news dataset is converted into a static knowledge graph; timestamp information is added to each entity node and relation edge of the static knowledge graph, and it is cropped into several time subgraphs through a sliding time window to form a temporal knowledge graph; the temporal knowledge graph is encoded using a CNN-LSTM model with an attention mechanism to obtain a temporal encoding vector; a time vector generator is used to generate periodic and aperiodic time vectors, and the periodic and aperiodic time vectors are combined with the temporal encoding vectors to form an embedding matrix; a Time-ConvKB model based on ConvKB is constructed, and the embedding matrix is ​​embedded into the Time-ConvKB model to obtain prediction results. This invention can solve the data sparsity problem of traditional knowledge graphs in the news domain, improve the prediction accuracy of the model, better reflect the timeliness of news data, and improve the practicality of prediction. Attached Figure Description

[0028] Figure 1 This is a flowchart of a time-series knowledge graph link prediction method for the news domain in one embodiment;

[0029] Figure 2 This is a flowchart of the process of forming a temporal encoding vector in a temporal knowledge graph link prediction method for the news domain, as described in one embodiment. Detailed Implementation

[0030] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0031] See Figure 1 This paper presents a flowchart of a time-series knowledge graph link prediction method for the news field, which includes the following steps:

[0032] Step 101: Obtain the news dataset and preprocess it, then convert the preprocessed news dataset into a static knowledge graph.

[0033] In this embodiment, news data from multiple news websites are crawled in parallel using a distributed crawling framework to form a news dataset. The crawling framework includes Scrapy, PySpider, etc.

[0034] The news dataset is preprocessed and then converted into a static knowledge graph. All entity nodes in the static knowledge graph correspond to the entity set E in the dataset, and all relation edges in the static knowledge graph correspond to the relation set R in the dataset. The static knowledge graph is then stored in the Neo4j graph database.

[0035] Step 102: Add timestamp information to each entity node and relation edge of the static knowledge graph, and trim it into several time subgraphs by sliding time windows to form a time-series knowledge graph.

[0036] In this embodiment, timestamp information is first added to each entity node and relation edge of the static knowledge graph. By adding timestamp information to the static knowledge graph, a denser temporal knowledge graph can be generated, allowing missing data to be filled in, thereby improving the model's accuracy. Then, a sliding time window method is used, treating news data over a period of time as a time window, and forming time subgraphs of news events occurring within that period. By continuously sliding the time window forward, a temporal knowledge graph oriented towards news data with time subgraphs is constructed. Traditional graph-based prediction models struggle to handle the dynamic evolution of entity nodes and relation edges, while using a temporal knowledge graph can encode the time-series information of entity nodes and relation edges into the model, thereby improving the model's prediction accuracy. Using a temporal knowledge graph can capture the temporal evolution trend of entity nodes and relation edges, better reflecting the timeliness of news data, thus improving the practicality of prediction.

[0037] Step 103: Encode the temporal knowledge graph using a CNN-LSTM model with an attention mechanism to obtain a temporal encoding vector.

[0038] See Figure 2This provides a flowchart for forming temporal encoding vectors. For each time step, the nodes and edges in the temporal knowledge graph are represented as node feature matrices and adjacency matrices. Then, a CNN module is used to convolve the node feature matrices of each time subgraph to extract local features W. CNN Simultaneously, the node feature matrix of each time subgraph is weighted and averaged using an attention mechanism, and then the result W output by the corresponding CNN module is used. CNN And the corresponding attention module output attention feature W attention Element-wise multiplication yields the node feature vector W(i, c). Then, the node feature vectors W(i, c) of all time subgraphs are input into the LSTM network in chronological order to encode the time series information and generate a time-series encoded vector.

[0039] Step 104: Use a time vector generator to generate periodic and aperiodic time vectors, and combine the periodic and aperiodic time vectors with the time-series coding vector to form an embedding matrix.

[0040] Step 105: Construct a Time-ConvKB model based on ConvKB, embed the embedding matrix into the Time-ConvKB model, and obtain the prediction results.

[0041] Specifically, for a news quadruple (s, ?, o, t) that requires link prediction, s represents the main entity, o represents the objective entity, and t is the current time. A temporal knowledge graph G is defined as a sequence of temporal subgraphs, i.e., G = {G1, G2, ..., G...} t Time subgraph G t Over time t, there is a directed multi-relation graph, where E is the entity set, R is the relation set, and F is the relation set. t F is the set of facts at time t. t One of the facts can be formalized as a quadruple (s, r, o, t), where s, o ∈ E, r ∈ R.

[0042] First, for the ? part in (s, ?, o, t), a set of candidate relations r = [r1, r2, ..., r] is generated by negative sampling. k Generate k negative sample quadruples (s, r1, o, t), ..., (s, r k (o,t). Assume the encoded main entity vector is The objective entity vector is The relation vector is r t The periodic and non-periodic time vectors are and Then the embedding matrix By using a k×5 filter w, the overall relationship between the embedded models is studied, and feature maps v = [v1, v2, ..., v] are generated. k ],but

[0043] v i =g(w·A) i +b)

[0044] Among them, A i Let represent the i-th row of the embedding matrix A, b∈R be a bias term, and g be the activation function.

[0045] After obtaining the mapping, a score is returned for rating using the Time-ConvKB model based on ConvKB. The prediction vector P of the Time-ConvKB model is shown in the following formula:

[0046]

[0047] Where Ω and w are shared parameters, * represents the convolution operator, and concat represents the concatenation operator.

[0048] The formula for the loss function is shown below:

[0049]

[0050]

[0051] in, F′ t It is F t The set of invalid quadruples generated from corrupted valid quadruples.

[0052] Finally, the prediction vector P is converted into a probability value using the sigmoid function to obtain the prediction result.

[0053] The above description is merely a preferred embodiment of the time-series knowledge graph link prediction method for the news field disclosed in this invention, and is not intended to limit the scope of protection of the embodiments in this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments in this specification should be included within the scope of protection of the embodiments in this specification.

Claims

1.A link prediction method for a time-series knowledge graph in the field of news, characterized in that, The method comprises the following steps: Obtaining a news dataset and preprocessing, and converting the preprocessed news dataset into a static knowledge graph; Adding timestamp information to each entity node and relationship edge of the static knowledge graph, and cutting into several time subgraphs through a sliding time window to form a time sequence knowledge graph; Encoding the time sequence knowledge graph by using a CNN-LSTM model with an introduced attention mechanism to obtain a time sequence encoding vector; Generating periodic and non-periodic time vectors by using a time vector generator, combining the periodic and non-periodic time vectors with the time sequence encoding vector to form an embedding matrix; Constructing a Time-ConvKB model based on ConvKB, embedding the embedding matrix into the Time-ConvKB model to obtain a prediction result, comprising the following steps: Let the encoded subject entity vector be , the objective entity vector be , the relation vector be , the periodic and aperiodic time vector be and , then the quadruple is defined as a k x 5 embedding matrix ; Extracting the global relationship between items of the same dimension of the embedding matrix by a k*5 filter to generate different feature mappings; After obtaining the mapping, the prediction vector P of the Time-ConvKB is as follows: ; where Ω and w are shared parameters, denotes a convolution operator, concat denotes a concatenation operator, and the formula of the loss function is shown as follows: ; wherein , is a set of invalid quadruples in which the damage generation is performed, the prediction vector P is converted into a probability value by a sigmoid function to obtain a prediction result. 2.The news field oriented time sequence knowledge graph link prediction method according to claim 1, characterized in that, The news dataset is obtained based on a distributed crawler framework and by parallel crawling of news data of multiple news websites. 3.The news field oriented time sequence knowledge graph link prediction method according to claim 1, characterized in that, Encoding the time sequence knowledge graph to obtain a time sequence encoding vector, comprising the following steps: Expressing the entity nodes and relationship edges in the time sequence knowledge graph as a node feature matrix and an adjacency matrix; Performing convolution operation on the node feature matrix in the time subgraph by using a CNN module to extract local features, and performing weighted average on the node feature matrix of the time subgraph by using an attention module to obtain attention features; Element-wise multiplying the local features output by the corresponding CNN module and the attention features output by the corresponding attention module to obtain a node feature vector; Inputting the node feature vectors of all time subgraphs in time sequence to an LSTM network to encode time sequence information and generate a time sequence encoding vector.

Citation Information

Patent Citations

  • Semantic enhanced knowledge graph periodic reasoning method and device

    CN115186098A

  • System of dynamic knowledge graph based on probabalistic cardinalities for timestamped event streams

    US20190188332A1