Construction method and system of knowledge representation learning model based on multi-dimensional information interaction and dynamic frequency perception

By using a knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness, the problems of insufficient multidimensional feature fusion and time sensitivity of historical repetition facts in the time knowledge graph extrapolation model are solved, and more efficient time knowledge graph inference performance is achieved.

CN120874993APending Publication Date: 2025-10-31FUZHOU UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511019370.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-23
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing time knowledge graph extrapolation models cannot effectively integrate multi-dimensional features and lack time-sensitive modeling of historical recurring facts, resulting in poor performance in downstream applications.

Method used

A knowledge representation learning model employing multidimensional information interaction and dynamic frequency awareness is adopted. The multidimensional information encoder captures entity type and temporal structure dependencies, the historical query encoder learns the semantic information of historical facts, and the multidimensional awareness decoder calculates the association score and dynamic frequency score, which are finally fused into a score.

Benefits of technology

It achieves effective fusion of multi-dimensional features, captures fine-grained dependencies, improves the time-sensitive modeling of historical recurring facts, and enhances the accuracy and performance of time knowledge graph reasoning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120874993A_ABST
    Figure CN120874993A_ABST
Patent Text Reader

Abstract

The invention provides a method and system for constructing a knowledge representation learning model based on multi-dimensional information interaction and dynamic frequency perception. The method comprises the steps of constructing a multi-dimensional information encoder, constructing a historical query encoder and constructing a multi-dimensional perception decoder. According to the method, firstly, multi-dimension, entity type and time structure information in time knowledge graph reasoning is effectively modeled through a multi-dimensional information encoder; next, a historical query encoder aggregates their neighbouring semantics through constructed query-related historical facts, and additionally obtains duplicated global candidate facts through dynamic historical frequency coding, thereby providing global constraints for scoring in the decoder. Finally, the entity representation is decoded using a multi-dimensional perceptual decoder.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention proposes a method and system for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception, which relates to the field of computer technology. Background Technology

[0002] Temporal Knowledge Graphs (TKGs) overcome the limitations of static knowledge graphs by introducing temporal information. Static knowledge graphs cannot capture and represent the dynamic characteristics of knowledge changing over time, and cannot handle time-related reasoning. TKGs expand traditional triples by introducing timestamps, creating quadruples, thus fitting the static knowledge graph with temporal information, which has significant practical implications. However, like static knowledge graphs, TKGs suffer from incompleteness, affecting downstream tasks such as information retrieval and intelligent question answering. Therefore, knowledge graph reasoning technology has emerged, aiming to reason about and predict missing information in knowledge graphs. Knowledge representation learning in knowledge graphs aims to map entities and relations into low-dimensional vectors to capture semantic relationships, forming the foundation of knowledge graph reasoning. TKG reasoning is divided into two categories based on the temporal direction of reasoning: inference and extrapolation. Inference infers missing facts in past and future timestamps based on historical facts, respectively. This invention focuses on reasoning about unknown facts in future timestamps, i.e., the extrapolation task.

[0003] In extrapolation tasks, most existing temporal knowledge representation learning models approach knowledge graph reasoning from different aspects of historical information within the temporal knowledge graph. Based on different perspectives, they can be broadly categorized into two types: the first type captures concurrent features from recent snapshots and uses the evolution between snapshots to model historical information for reasoning; the second type predicts future events by statistically analyzing historical facts and utilizing recurring patterns.

[0004] For the first type of extrapolation model, graph convolutional networks (GCN) are usually used to capture the structural dependencies within the snapshot, that is, the static relationships and dependencies between entities. Temporal dependencies are usually modeled through gating mechanisms (such as GRU, LSTM, etc.) to capture the temporal dependencies between snapshots. For example, RE-GCN uses relation-aware graph convolutional networks (RGCN[5]) to model the structure of entities and relationships within the snapshot, and uses GRU to model the sequence. The second type of extrapolation model generally uses simple linear transformation as an encoder and uses the sparse frequency matrix generated by statistically repeating facts as a mask for prediction. CyGNet and CENET record the frequency of historical facts through multi-hot vectors and perform prediction masking. TiRGN integrates the two types of methods, uses local recurrent encoders to capture temporal dependencies, and records historical occurrence facts to provide global constraints for prediction.

[0005] Knowledge representation learning for the inference task of temporal knowledge graphs has been widely applied in many fields. However, due to the current limitations of the extrapolation model, which is not yet sufficient to support downstream applications, the following shortcomings still exist and require further improvement.

[0006] (1) Ineffective fusion of multidimensional features. Although existing models can learn multidimensional features (such as semantic features, temporal features, structural features, etc.) through graph convolutional networks, they often fail to effectively model the interdependencies between these features. How to process and fuse feature information of different dimensions in the same model and capture their fine-grained dependencies remains a challenge. Although some methods fuse features through simple feature concatenation or weighted aggregation, they fail to fully consider the complex interactions between them.

[0007] (2) Lack of modeling for the time sensitivity of historical recurring facts. The second type of model relies on static frequency statistics, which often fail to capture the time sensitivity of historical recurring facts. Therefore, how to effectively integrate multidimensional features in the same knowledge representation learning model and capture their fine-grained dependencies, as well as how to model the time sensitivity of historical recurring facts, are the research focus of this invention. Summary of the Invention

[0008] In view of this, to fill the gaps and deficiencies in existing technologies, this invention proposes a method and system for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness. This method and system first effectively models the multidimensional, entity type, and temporal structure information in temporal knowledge graph reasoning through a multidimensional information encoder. Next, a historical query encoder aggregates adjacent semantics by constructing query-related historical facts. Furthermore, dynamic historical frequency encoding obtains recurring global candidate facts, thereby providing global constraints for the scoring in the decoder. Finally, a multidimensional awareness decoder is used to decode the entity representation.

[0009] This invention proposes a method and system for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness, comprising the following:

[0010] This invention proposes a knowledge representation learning model based on multi-dimensional information interaction and dynamic frequency awareness, characterized by the following: the knowledge representation learning model follows an encoder and decoder architecture; the knowledge representation learning model includes the following modules:

[0011] Multidimensional Information Encoder: The multidimensional information encoder captures interdimensional dependencies through multidimensional interactive encoding, uses entity type similarity encoding to capture entity type dependencies, and utilizes gated loop mechanism and RGCN to capture temporal structure dependencies;

[0012] Historical Query Encoder: The historical information encoder learns the semantic information of historical facts by constructing a historical query subgraph based on relevant historical facts.

[0013] Multidimensional perceptual decoder: The multidimensional perceptual decoder captures the interaction between entities and relations and the interaction between entities by introducing two convolutional kernels of different scales, and simultaneously calculates the association score and dynamic frequency score of each candidate, and fuses the two into the final score.

[0014] This invention proposes a method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness. The method for constructing this model includes the following steps:

[0015] Step S1: Construct a multidimensional information encoder; the construction of the multidimensional information encoder includes using multidimensional interactive coding to divide the dimension of the entity vector into several blocks and independently modeling the dependency relationship of each block; using entity type similarity coding to capture equivalence relations and complete the modeling of entity type information; and using time structure information coding to simulate the evolution of the periodicity and monotonicity of entities over time.

[0016] Step S2: Construct a historical query encoder; wherein constructing a historical query encoder includes learning the semantic information of historical facts by using a historical query subgraph constructed with a historical information encoder; using dynamic frequency historical encoding to obtain the frequency of repeated facts and provide global constraints for the scoring in the multidimensional perceptual decoder;

[0017] Step S3: Construct a multidimensional perceptual decoder; The multidimensional perceptual decoder captures the interaction between entities and relations and the interaction between entities by introducing two convolutional kernels of different scales, while calculating the association score and dynamic frequency score of each candidate and fusing the two into the final score.

[0018] Further, step S1 includes the following:

[0019] Step S11: Multidimensional interactive coding is used to divide the entity vector into several blocks and independently model the dependencies of each block. The embedding dimension of each entity vector is set to d, and the entity vector is divided into K blocks, each with a length of... Then, semantic information is learned for each block embedding using linear projection to obtain multi-dimensional semantic information entity embeddings, including the following:

[0020] e me =cat(Linear(e i|1≤i≤K)

[0021] in This indicates the i-th embedding of entity embedding e; cat(·) represents the concatenation operation; Linear(·) represents the linear layer;

[0022] Furthermore, a seg representation is introduced to represent the density of entities around an entity, and the number of blocks is obtained based on the average node degree of the dataset. Where seg represents the average node degree of the dataset. This indicates taking the lower bound integer.

[0023] Furthermore, step S1 also includes the following:

[0024] Step S12: Use entity type similarity encoding to capture equivalence relations and complete the modeling of entity type information, including the following:

[0025] Step S121: Calculate the cosine similarity between the positive relation embedding and the inverse relation embedding, including the following:

[0026]

[0027] Where r and Let ||r||2 and ||r||2 represent the positive relation embedding and the inverse relation embedding, respectively. Representing r and The 2-norm,

[0028] Step S122: Calculate the attention score between the head and tail entities, including the following:

[0029]

[0030] Where a i,j Represents entity e i and e j The type of attention score, r i,j Represents entity e i and e j Relationship embedding, Represents entity e i and e j Embedding of inverse relationships between them;

[0031] Step S123: Weight the embedding vectors of neighboring entities using the attention scores between the head and tail entities, and update them, including the following:

[0032]

[0033] in, N represents the entity embedding after incorporating neighbor type information.E(i) Represents entity e i The neighborhood group, This represents the learnable parameter matrix.

[0034] Furthermore, step S1 also includes the following:

[0035] Step S13: Employing time-structured information to encode and simulate the periodicity and monotonicity of an entity over time includes the following:

[0036] Step S131: Employ dynamic entity embedding, including the following:

[0037]

[0038] Where Δt=|t q -t i | represents the time interval between the query time and the current time.

[0039] w p b p w m b m The parameters represent learnable parameters, Linear(·) and RNN(·) represent linear layers and recurrent neural networks, respectively, and W0 represents the linear transformation matrix. ‖ represents the entity embedding after fusing entity type information, and ‖ represents the vector concatenation operation;

[0040] Step S132: Utilize RGCN to capture structural dependencies between concurrent facts. The RGCN aggregator includes the following:

[0041]

[0042] in They represent l respectively th Embedding of head and tail entities of a layer, r l Indicates relational embedding. Let c represent the linear transformation matrix, σ(·) represent the activation function, and c s Representing entities The number of neighbors;

[0043] Step S133: Embed the entity output from the last layer as follows: Use gated loop units to update the representation of entities:

[0044]

[0045] Where GRU(·) represents a gated loop unit;

[0046] Step S134: Fuse the entity embeddings related to r into the relation embeddings to obtain the relation embedding matrix R′ of the time subgraph at time t.

[0047]

[0048] U t =σ(W3R′) t +b)

[0049] R t+1 =U t ·R′ t +(lU t )·R t

[0050] Where pooling(·) represents the average pooling operation, E t,r Let R′ be the entity embedding matrix associated with relation r at time t. t It is determined by time t. The relational embedding matrix is ​​composed of W3, which is the time-gated learnable weight matrix, σ(·) is the sigmoid activation function, and R is the relational embedding matrix. t+1 To pass through time gate U t The updated time-t relation embedding matrix;

[0051] Step S135: Obtain the query time t through steps S131 to S134. q The entity evolution representation of the m closest timestamps {e tq-m+2 ,…,e tp} and relational evolution representation {r tp-w+2 ,…,r tp};

[0052] Step S136: Introduce an entity-aware attention mechanism to distinguish the impact of different time snapshots on the query, including first analyzing the query at timestamp t. q All relations related to the query entity are averaged and pooled, and then the final local entity representation is calculated using an entity-aware attention mechanism.

[0053] Furthermore, the impact of different time snapshots on queries includes the following:

[0054]

[0055] α i =σ(W5(e′) tq +e tq-m+i )), i∈[2,m-1]

[0056]

[0057] Where W4 and W5 are weight matrices, α i This represents the attention score.

[0058] Further, step S2 includes the following:

[0059] Step S21: Using the historical query subgraph constructed by the historical information encoder to learn the semantic information of historical facts includes the following:

[0060] Step S211: Construct the query-related historical subgraph using the LogCL method, including: for a time knowledge graph First, for the header entity e of the given query s Based on the relationships in the time knowledge graph, find the relationship with e. s The directly connected entities then extend further to those related to e. s The adjacent entities of directly connected entities form a historical query subgraph G with a two-hop relationship. h ;

[0061] Step S212: After obtaining the historical query subgraph, encode the historical query subgraph using RGCN, including the following:

[0062]

[0063] Among them, They represent l respectively th Embedding of the head and tail entities of the layer;

[0064] Step S213: Let the output of the last layer of the RGCN be... An entity-aware attention mechanism is used to learn and query relevant historical facts, including the following:

[0065]

[0066] Where β is the attention score and σ represents the sigmoid activation function. This indicates the entity embedding that ultimately integrates historical information;

[0067] Step S22: Obtain the frequency of recurring facts using dynamic frequency history encoding, and provide global constraints for the scoring in the multidimensional perceptual decoder, including the following:

[0068] Step S221: Use query timestamp t q Methods for assigning weights to the time frequency of historical facts include the following: For a query (s,r,o,t) q The frequency value f is calculated by aggregating the weighted frequency of occurrence of the fact in past timestamps, where the weights are based on the query timestamp t. q With historical timestamps ti The time difference is determined by the following:

[0069]

[0070] Among them, |t q -t+1| represents the absolute value of the time difference and t q >t i f(s,r,o) represents the total frequency of fact (s,r,o), ω(t) q ,t i ) with timestamp t i Distance from query timestamp t q The distance increases and the frequency gradually decreases; furthermore, the calculated frequency value f(s,r,o) ranges from [0,2).

[0071] Further, step S3 includes the following:

[0072] Step S31: A first convolutional kernel of size 3×3 and a second convolutional kernel of size 5×5 are used to capture the interaction between entities and relationships, as well as the interaction between entities. After convolution transformation, two feature mapping matrices are obtained. and

[0073] Step S32: Define the scoring function, including the following:

[0074]

[0075] Where M(·,·) represents the convolution operation, vec(·) represents reconstructing the feature mapping matrix into a vector, performing a linear transformation using W9, and finally passing it through the linear activation function f(·) and the candidate entity embedding e. o The score is obtained by performing the inner product, where λ is a hyperparameter.

[0076] Step S33: Obtain the association scores of the candidates by passing the scoring function through the sigmoid activation function:

[0077]

[0078] Where σ is the gimoid activation function;

[0079] Step S34: Calculate the dynamic frequency score using the dynamic frequency history matrix constructed through dynamic frequency history coding, including the following:

[0080]

[0081] Where ⊙ represents the dot product;

[0082] Step S35: Combine the two scores to calculate the final score of the candidate entity. The formula for the final score includes the following:

[0083]

[0084] Where α is a hyperparameter.

[0085] Furthermore, step S3 also includes the following:

[0086] Step S36: The formula for calculating the loss predicted by the BCE loss function includes the following:

[0087]

[0088] Among them, y i Let y be the label of the triple (s,r,o,t) if (s,r,o,t)∈ε. i It is 1 if it is true, otherwise it is 0.

[0089] According to a second aspect of the present invention, a system for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness includes an electronic device, wherein the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements a method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness as described in any one of the present invention.

[0090] According to a third aspect of the present invention, a system for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception is provided, comprising a computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, it implements a method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception as described in any one of the present invention.

[0091] The present invention has the following advantages:

[0092] 1) This invention achieves effective fusion of multi-dimensional features and captures fine-grained dependencies between them. It introduces a multi-dimensional information encoder to capture entity type, temporal, and structural dependencies, and designs an entity-aware attention mechanism to learn the impact of different time snapshots on the query. Through a multi-dimensional perceptual decoder, it utilizes multi-scale convolutional kernels to capture entity and relational interactions of different dimensions. This addresses the shortcomings of past models in effectively processing and fusing feature information of different dimensions and capturing their fine-grained dependencies.

[0093] 2) Achieve time-sensitivity modeling for historically recurring facts. By introducing historical query encoding, using a relation-aware graph convolutional network to learn historical information, and utilizing dynamic frequency historical encoding, time-sensitivity modeling is performed on the frequency of fact occurrence at different timestamps. This addresses the shortcoming of past models that could not capture the gradually diminishing influence of historically recurring facts over time. Attached Figure Description

[0094] Figure 1 This is the overall framework diagram of the present invention.

[0095] Figure 2 This is a schematic diagram of the steps of the present invention.

[0096] Figure 3 This is a schematic diagram of the experimental results of the block number K parameter in the multidimensional interactive coding of this invention on ICEWS14.

[0097] Figure 4 This is a schematic diagram of the experimental results of the block number K parameter in the multidimensional interactive coding of this invention on ICEWS18.

[0098] Figure 5 This is a schematic diagram of the experimental results of parameter λ in the multidimensional sensing decoding of this invention on ICEWS14.

[0099] Figure 6 This is a schematic diagram of the experimental results of parameter λ in the multidimensional sensing decoding of this invention on ICEWS18. Detailed Implementation

[0100] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.

[0101] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0102] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the present invention; as used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise; furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0103] like Figure 1As shown, this invention proposes a knowledge representation learning model based on multi-dimensional information interaction and dynamic frequency awareness, characterized by the following: the knowledge representation learning model follows an encoder and decoder architecture; the knowledge representation learning model includes the following modules:

[0104] Multidimensional Information Encoder: The multidimensional information encoder captures interdimensional dependencies through multidimensional interactive encoding, uses entity type similarity encoding to capture entity type dependencies, and utilizes gated loop mechanism and RGCN to capture temporal structure dependencies;

[0105] Historical Query Encoder: The historical information encoder learns the semantic information of historical facts by constructing a historical query subgraph based on relevant historical facts.

[0106] Multidimensional perceptual decoder: The multidimensional perceptual decoder captures the interaction between entities and relations and the interaction between entities by introducing two convolutional kernels of different scales, and simultaneously calculates the association score and dynamic frequency score of each candidate, and fuses the two into the final score.

[0107] like Figure 2 As shown, this invention proposes a method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness. The method is characterized by using a method for constructing this knowledge representation learning model, which includes the following steps:

[0108] Step S1: Construct a multidimensional information encoder; the construction of the multidimensional information encoder includes using multidimensional interactive coding to divide the dimension of the entity vector into several blocks and independently modeling the dependency relationship of each block; using entity type similarity coding to capture equivalence relations and complete the modeling of entity type information; and using time structure information coding to simulate the evolution of the periodicity and monotonicity of entities over time.

[0109] Step S2: Construct a historical query encoder; wherein constructing a historical query encoder includes learning the semantic information of historical facts by using a historical query subgraph constructed with a historical information encoder; using dynamic frequency historical encoding to obtain the frequency of repeated facts and provide global constraints for the scoring in the multidimensional perceptual decoder;

[0110] Step S3: Construct a multidimensional perceptual decoder; The multidimensional perceptual decoder captures the interaction between entities and relations and the interaction between entities by introducing two convolutional kernels of different scales, while calculating the association score and dynamic frequency score of each candidate and fusing the two into the final score.

[0111] In one embodiment of the present invention, step S1 includes the following:

[0112] Step S11: Multidimensional interactive coding is used to divide the entity vector into several blocks and independently model the dependencies of each block. The embedding dimension of each entity vector is set to d, and the entity vector is divided into K blocks, each with a length of... Then, semantic information is learned for each block embedding using linear projection to obtain multi-dimensional semantic information entity embeddings, including the following:

[0113] e me =cat(Linear(e i |1≤i≤K)

[0114] in This indicates the i-th embedding of entity embedding e; cat(·) represents the concatenation operation; Linear(·) represents the linear layer;

[0115] Furthermore, a seg representation is introduced to represent the density of entities around an entity, and the number of blocks is obtained based on the average node degree of the dataset. Where seg represents the average node degree of the dataset. This indicates taking the lower bound integer.

[0116] In one embodiment of the present invention, step S1 further includes the following:

[0117] Step S12: Use entity type similarity encoding to capture equivalence relations and complete the modeling of entity type information, including the following:

[0118] Step S121: Calculate the cosine similarity between the positive relation embedding and the inverse relation embedding, including the following:

[0119]

[0120] Where r and Let ||r||2 and ||r||2 represent the positive relation embedding and the inverse relation embedding, respectively. Representing r and The 2-norm,

[0121] Step S122: Calculate the attention score between the head and tail entities, including the following:

[0122]

[0123] Where a i,j Represents entity e i and e j The type of attention score, r i,j Represents entity e i and e j Relationship embedding, Represents entity ei and e j Embedding of inverse relationships between them;

[0124] Step S123: Weight the embedding vectors of neighboring entities using the attention scores between the head and tail entities, and update them, including the following:

[0125]

[0126] in, N represents the entity embedding after incorporating neighbor type information. E(i) Represents entity e i The neighborhood group, This represents the learnable parameter matrix.

[0127] In one embodiment of the present invention, step S1 further includes the following:

[0128] Step S13: Employing time-structured information to encode and simulate the periodicity and monotonicity of an entity over time includes the following:

[0129] Step S131: Employ dynamic entity embedding, including the following:

[0130]

[0131] Where Δt=|t q -t i | represents the time interval between the query time and the current time.

[0132] w p b p w m b m The parameters represent learnable parameters, Linear(·) and RNN(·) represent linear layers and recurrent neural networks, respectively, and W0 represents the linear transformation matrix. ‖ represents the entity embedding after fusing entity type information, and ‖ represents the vector concatenation operation;

[0133] Step S132: Utilize RGCN to capture structural dependencies between concurrent facts. The RGCN aggregator includes the following:

[0134]

[0135] in They represent l respectively th Embedding of head and tail entities of a layer, r l Indicates relational embedding. Let c represent the linear transformation matrix, σ(·) represent the activation function, and c s Representing entities The number of neighbors;

[0136] Step S133: Embed the entity output from the last layer as follows: Use gated loop units to update the representation of entities:

[0137]

[0138] Where GRU(·) represents a gated loop unit;

[0139] Step S134: Fuse the entity embeddings related to r into the relation embeddings to obtain the relation embedding matrix R′ of the time subgraph at time t.

[0140]

[0141] U t =σ(W3R′) t +b)

[0142] R t+1 =U t ·R′ t +(lU t )·R t

[0143] Where pooling(·) represents the average pooling operation, E t,r Let R′ be the entity embedding matrix associated with relation r at time t. t It is determined by time t. The relational embedding matrix is ​​composed of W3, which is the time-gated learnable weight matrix, σ(·) is the sigmoid activation function, and R is the relational embedding matrix. t+1 To pass through time gate U t The updated time-t relation embedding matrix;

[0144] Step S135: Obtain the query time t through steps S131 to S134. q The entity evolution representation of the m closest timestamps {e tq-m+2 ,…,e tp} and relational evolution representation {r tp-w+2 ,…,r tp};

[0145] Step S136: Introduce an entity-aware attention mechanism to distinguish the impact of different time snapshots on the query, including first analyzing the query at timestamp t. q All relations related to the query entity are averaged and pooled, and then the final local entity representation is calculated using an entity-aware attention mechanism.

[0146] Furthermore, the impact of different time snapshots on queries includes the following:

[0147]

[0148] α i =σ(W5(e′) tq +e tq-m+i )), i∈[2,m-1]

[0149]

[0150] Where W4 and W5 are weight matrices, α i This represents the attention score.

[0151] In one embodiment of the present invention, step S2 includes the following:

[0152] Step S21: Using the historical query subgraph constructed by the historical information encoder to learn the semantic information of historical facts includes the following:

[0153] Step S211: Construct the query-related historical subgraph using the LogCL method, including: for a time knowledge graph First, for the header entity e of the given query s Based on the relationships in the time knowledge graph, find the relationship with e. s The directly connected entities then extend further to those related to e. s The adjacent entities of directly connected entities form a historical query subgraph G with a two-hop relationship. h ;

[0154] Step S212: After obtaining the historical query subgraph, encode the historical query subgraph using RGCN, including the following:

[0155]

[0156] Among them, They represent l respectively th Embedding of the head and tail entities of the layer;

[0157] Step S213: Let the output of the last layer of the RGCN be... An entity-aware attention mechanism is used to learn and query relevant historical facts, including the following:

[0158]

[0159] Where β is the attention score and σ represents the sigmoid activation function. This indicates the entity embedding that ultimately integrates historical information;

[0160] Step S22: Obtain the frequency of recurring facts using dynamic frequency history encoding, and provide global constraints for the scoring in the multidimensional perceptual decoder, including the following:

[0161] Step S221: Use query timestamp t q Methods for assigning weights to the time frequency of historical facts include the following: For a query (s,r,o,t) q The frequency value f is calculated by aggregating the weighted frequency of occurrence of the fact in past timestamps, where the weights are based on the query timestamp t. q With historical timestamps t i The time difference is determined by the following:

[0162]

[0163] Among them, |t q -t i +1| represents the absolute value of the time difference and t q >t i f(s,r,o) represents the total frequency of fact (s,r,o), ω(t) q ,t i ) with timestamp t i Distance from query timestamp t q The distance increases and the frequency gradually decreases; furthermore, the calculated frequency value f(s,r,o) ranges from [0,2).

[0164] In one embodiment of the present invention, step S3 includes the following:

[0165] Step S31: A first convolutional kernel of size 3×3 and a second convolutional kernel of size 5×5 are used to capture the interaction between entities and relationships, as well as the interaction between entities. After convolution transformation, two feature mapping matrices are obtained. and

[0166] Step S32: Define the scoring function, including the following:

[0167]

[0168]

[0169] Where M(·,·) represents the convolution operation, vec(·) represents reconstructing the feature mapping matrix into a vector, performing a linear transformation using W9, and finally passing it through the linear activation function f(·) and the candidate entity embedding e. o The score is obtained by performing the inner product, where λ is a hyperparameter.

[0170] Step S33: Obtain the association scores of the candidates by passing the scoring function through the sigmoid activation function:

[0171]

[0172] Where σ is the gimoid activation function;

[0173] Step S34: Calculate the dynamic frequency score using the dynamic frequency history matrix constructed through dynamic frequency history coding, including the following:

[0174]

[0175] Where ⊙ represents the dot product;

[0176] Step S35: Combine the two scores to calculate the final score of the candidate entity. The formula for the final score includes the following:

[0177]

[0178] Where α is a hyperparameter.

[0179] In one embodiment of the present invention, step S3 further includes the following:

[0180] Step S36: The formula for calculating the loss predicted by the BCE loss function includes the following:

[0181]

[0182] Among them, y i Let y be the label of the triple (s,r,o,t) if (s,r,o,t)∈ε. i It is 1 if it is true, otherwise it is 0.

[0183] According to a second aspect of the present invention, a system for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness includes an electronic device, wherein the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements a method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness as described in any one of the present invention.

[0184] According to a third aspect of the present invention, a system for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception is provided, comprising a computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, it implements a method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception as described in any one of the present invention.

[0185] In addition to the above, the present invention also includes the following embodiments:

[0186] In one embodiment of the present invention, to comprehensively evaluate the performance of the time knowledge graph reasoning model based on multidimensional information extraction and dynamic frequency awareness, four datasets were selected: ICEWS14, ICEWS18, ICEWS05-15, and GDELT. Each dataset was divided into training, validation, and test sets according to a set ratio. Specific data statistics are shown in Table 1.

[0187] Entity Number Relationships training set Validation set test set ICEWS14 6,869 230 74,845 8,514 7,371 ICEWS18 23,033 256 373,018 45,995 49,545 ICEWS05-15 10,094 251 368,868 46,302 46,159 GDELT 7,691 240 1,734,399 23,8765 305,241

[0188] Table 1 Dataset Details

[0189] In one embodiment of the present invention, two evaluation metrics are used: mean regression ranking (MRR) and the hit rate of the top N rankings (Hits@N). These two metrics are widely used to evaluate the effectiveness of temporal knowledge representation learning methods on temporal knowledge graph reasoning tasks.

[0190] MRR is the inverse average of the rankings of the true values ​​of all queries. A higher MRR indicates a higher ranking for the model and better predictive performance. The specific formula is as follows:

[0191]

[0192] Where |Q| is the size of the query set, and rank k i This represents the rank of the correct answer to the i-th query in the inference results. Hits@N calculates whether the model contains the correct answer in the first N inference results. If the correct answer is within the first N predictions, it is counted as a hit. Hit@N measures the model's ability to capture the correct answer in the first N positions. The specific formula is as follows:

[0193]

[0194] Where is the indicator function when rank i The value is 1 when ≤ N, indicating that the correct answer is among the first N reasoning results; otherwise, it is 0.

[0195] In one embodiment of the present invention, in order to demonstrate the effectiveness of the proposed model in temporal knowledge graph reasoning, the model of the present invention is compared with some classic TKGR inference models, and also with the latest TKGR extrapolation models.

[0196] In one embodiment of the invention, the model is implemented using PyTorch, and all experiments are run on an RTX3090. For all datasets, the embedding size d is set to 200, the learning rate is set to 0.001, and the batch size is the number of quadruplets per timestamp in each dataset. The number of layers in the RGCN used in this model is set to 2, and the dropout rate per layer is set to 0.2. Adam is used to optimize the model parameters during training. The number of blocks K for entity embeddings of ICEWS14, ICEWS18, ICEWS05-15, and GDELT are 5, 10, 10, and 20, respectively. λ is set to 0.1 on all datasets, and the hyperparameter α for fusing association scores and dynamic frequency scores is set to 0.8. For the decoder on all datasets, the number of kernels is set to 50, and the two kernel sizes are 3×3 and 5×5, respectively.

[0197] In one embodiment of this invention, link prediction is a key task in the field of knowledge graph reasoning, with the main objective of predicting missing entities or relationships in the knowledge graph. Tables 2 and 3 summarize the link prediction results of the proposed model and the baseline model on four publicly available datasets. The bolded portions indicate the optimal results, and the underlined portions indicate the suboptimal results. Compared to the baseline model, the proposed model achieves a significant performance advantage, validating the effectiveness of the proposed method.

[0198]

[0199]

[0200] Table 2 Link prediction results for ICEWS14 and ICEWS18

[0201] In one embodiment of the present invention, the temporal knowledge representation learning method for inference models of temporal knowledge graphs performs poorly in extrapolation tasks because these models are not designed for extrapolation tasks and cannot model complex temporal evolution characteristics and dynamic dependencies. Compared to inference models, the model of the present invention outperforms most state-of-the-art methods compared to existing extrapolation models. Specifically, compared with suboptimal results, the model of the present invention improves the MRR by 5.16%, 8.22%, 11.95%, and 5.89% on the IEWS14, IEWS18, IEWS05-15, and GDELT datasets, respectively, and also shows significant improvements on Hits@1, reaching 12.14%, 8.25%, 19.37%, and 8.52%, respectively.

[0202] In one embodiment of this invention, RPC and CRAFT are excellent representatives of the first and second types of extrapolation models. Although RPC fully mines relational associations and periodic information through relational communication units and periodic communication units, it does not model the interdependence of the learned multidimensional features, nor does it consider the impact of repeated historical facts on prediction. CARFT models repeated historical facts, but it does not consider that the frequency of occurrence of historical facts will affect the prediction results, resulting in lower performance than the model of this invention. Experimental results show that the proposed model achieves an MRR of 51.74 on the ICEWS14 dataset, a 16.14% improvement compared to RPC's 44.55, and a 13.9% improvement compared to CRAFT's 45.71. Particularly on Hits@1, the proposed model performs exceptionally well, achieving improvements of 17.38% and 16.7% compared to RPC and CRAFT, respectively.

[0203]

[0204] Table 3. Link prediction results of GDELT for ICEWS05-15

[0205] Furthermore, existing extrapolation models still have limitations in deep modeling of temporal features and capturing cross-temporal correlations, while the model of this invention, by introducing dynamic frequency modeling and multi-dimensional interaction design, can better capture deep information on temporal dependencies and semantic relationships.

[0206] In one embodiment of the present invention, to evaluate the role of each module in the model, ablation experiments were conducted on the ICEWS14 and ICEWS18 datasets to verify the contribution of different modules to model performance. The present invention performed ablation on four modules: MIDFA w / o MDI indicates the removal of the multidimensional interaction encoding module in the multidimensional information encoder; MIDFA w / o ESE indicates the removal of the entity type similarity encoding module in the multidimensional information encoder; MIDFA w / o DFE indicates the removal of the dynamic frequency history encoding module in the history query encoder; and MIDFA w / o MPD indicates the replacement of the multidimensional perceptual decoder with the ConvTransE decoder. Specific experimental results are shown in the table below:

[0207]

[0208] Table 4 Ablation test results of ICEWS14 and ICEWS18

[0209] The ablation results show that removing the multidimensional interactive encoding module reduced the model's MRR by 2.1% and 1.8%, respectively. This is mainly because multidimensional interactive encoding can capture the dimensional dependencies of entity embeddings, which helps to learn entity semantics more deeply and thus improves the performance of link prediction. The entity type similarity encoding module uses equivalence relations to capture the similarity between head and tail entities, thereby achieving modeling of entity type information. Removing the entity type similarity encoding module also resulted in a certain degree of performance degradation.

[0210] After removing the dynamic frequency history encoding from the history query encoder, the model's performance declined significantly, decreasing by 4.1% and 3% in MRR, and by 6.3% and 4.3% in Hits@1. This is because the dynamic history frequency encoding models the time sensitivity of historical recurring facts, thereby providing global constraints for the multidimensional perceptual decoder's scoring and achieving better link prediction.

[0211] After switching to the ConvTransE decoder, the model's performance significantly decreased, indicating that using convolutional kernels of different dimensions can capture interactions between entities and relationships at different scales. Furthermore, simultaneously calculating the association score and dynamic frequency score of candidates can avoid the unpredictable situation caused by historical non-existence due to dynamic frequency history encoding.

[0212] In one embodiment of the present invention, to investigate the impact of the number of blocks K in multidimensional interactive coding on model performance, the present invention conducted parameter sensitivity experiments on K on the ICEWS14 and ICEWS18 datasets. The experimental results are as follows: Figure 3 , Figure 4 As shown.

[0213] On the ICEWS14 dataset, the model achieves optimal performance when K=5, consistent with the block-segmentation strategy based on average node degree proposed in this invention. When K<5, each block has a large dimension, which may not effectively capture fine-grained semantic features; while when K>5, the increased number of blocks leads to information fragmentation, with some key semantic information being split into different blocks, resulting in performance degradation. This indicates that a moderate block size can balance semantic integrity and feature interaction capability.

[0214] For the ICEWS18 dataset, which has a larger number of entities, the optimal K value increases to 10. This phenomenon is closely related to the characteristics of the dataset: the number of entities in ICEWS18 is 3.3 times that of ICEWS14, requiring finer-grained chunking to decouple complex semantics.

[0215] like Figure 3 , Figure 4As shown, the experimental results indicate that the number of blocks needs to be adapted to the size of the dataset and the semantic complexity. Large-scale, highly complex data requires finer-grained blocks. Excessive segmentation can lead to the fragmentation of semantic information, while too few blocks limit the ability for fine-grained interaction. The block segmentation strategy based on average node degree has both theoretical rationality and practical effectiveness.

[0216] In one embodiment of the present invention, to explore the impact of parameter λ on model performance in a multidimensional perceptual decoder, parameter sensitivity experiments on λ were conducted on the ICEWS14 and ICEWS18 datasets. The results of MRR and Hits@1 are as follows: Figure 5 , Figure 6 As shown. A larger λ value indicates greater historical information, representing e. h The higher the weight, the better. The results show that on both datasets, the performance of the proposed model first increases and then decreases as λ increases, indicating that considering only local or global representations is insufficient for effective link prediction.

[0217] In one embodiment of the present invention, the effectiveness of the model of the present invention in complex temporal reasoning tasks is verified through two cases (see Table 5), and a comparative analysis is conducted with two other models, RPC and TiRGN.

[0218] For the query (country Ch), the correct answer is country Fi. Our model correctly predicts country Fi with the highest confidence, while RPC and TiRGN both place country Fi in the third position. For the query (country Un), the correct answer is country NK. Our model correctly predicts this entity with a significant advantage. Although RPC predicts it correctly, its confidence is reduced by 45.3%, while TiRGN predicts country NK is not among the top four. This is mainly due to the collaborative design of multidimensional interactive coding and dynamic frequency history coding, which achieves cross-dimensional feature fusion and fine-grained temporal awareness. Experimental results verify that this method can effectively solve extrapolation inference problems in complex temporal scenarios.

[0219]

[0220] Table 5 Case Analysis

[0221] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.

Claims

1. A knowledge representation learning model based on multi-dimensional information interaction and dynamic frequency perception, characterized in that, The knowledge representation learning model includes the following: it follows an encoder-decoder architecture; the knowledge representation learning model includes the following modules: Multidimensional Information Encoder: The multidimensional information encoder captures interdimensional dependencies through multidimensional interactive encoding, uses entity type similarity encoding to capture entity type dependencies, and utilizes gated loop mechanism and RGCN to capture temporal structure dependencies; Historical Query Encoder: The historical information encoder learns the semantic information of historical facts by constructing a historical query subgraph based on relevant historical facts. Multidimensional perceptual decoder: The multidimensional perceptual decoder captures the interaction between entities and relations and the interaction between entities by introducing two convolutional kernels of different scales, and simultaneously calculates the association score and dynamic frequency score of each candidate, and fuses the two into the final score.

2. A method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception, characterized in that, To construct the knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness as described in claim 1, the method for constructing the knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness includes the following steps: Step S1: Construct a multidimensional information encoder; the construction of the multidimensional information encoder includes using multidimensional interactive coding to divide the dimension of the entity vector into several blocks and independently modeling the dependency relationship of each block; using entity type similarity coding to capture equivalence relations and complete the modeling of entity type information; and using time structure information coding to simulate the evolution of the periodicity and monotonicity of entities over time. Step S2: Construct a historical query encoder; wherein constructing a historical query encoder includes learning the semantic information of historical facts by using a historical query subgraph constructed with a historical information encoder; using dynamic frequency historical encoding to obtain the frequency of repeated facts and provide global constraints for the scoring in the multidimensional perceptual decoder; Step S3: Construct a multidimensional perceptual decoder; The multidimensional perceptual decoder captures the interaction between entities and relations and the interaction between entities by introducing two convolutional kernels of different scales, while calculating the association score and dynamic frequency score of each candidate and fusing the two into the final score.

3. The method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception according to claim 2, characterized in that, Step S1 includes the following: Step S11: Multidimensional interactive coding is used to divide the entity vector into several blocks and independently model the dependencies of each block. The embedding dimension of each entity vector is set to d, and the entity vector is divided into K blocks, each with a length of... Then, semantic information is learned for each block embedding using linear projection to obtain multi-dimensional semantic information entity embeddings, including the following: e me =cat(Linear(e i )|1≤i≤K) in This indicates the i-th embedding of entity embedding e; cat(·) represents the concatenation operation; Linear(·) represents the linear layer; Furthermore, a seg representation is introduced to represent the density of entities around an entity, and the number of blocks is obtained based on the average node degree of the dataset. Where seg represents the average node degree of the dataset. This indicates taking the lower bound integer.

4. The method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception according to claim 3, characterized in that, Step S1 also includes the following: Step S12: Use entity type similarity encoding to capture equivalence relations and complete the modeling of entity type information, including the following: Step S121: Calculate the cosine similarity between the positive relation embedding and the inverse relation embedding, including the following: Where r and Let ||r||2 and ||r||2 represent the positive relation embedding and the inverse relation embedding, respectively. Representing r and The 2-norm, Step S122: Calculate the attention score between the head and tail entities, including the following: Where a i,j Represents entity e i and e j The type of attention score, r i,j Represents entity e i and e j Relationship embedding, Represents entity e i and e j Embedding of inverse relationships between them; Step S123: Weight the embedding vectors of neighboring entities using the attention scores between the head and tail entities, and update them, including the following: in, N represents the entity embedding after incorporating neighbor type information. E(i) Represents entity e i The neighborhood group, This represents the learnable parameter matrix.

5. The method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception according to claim 4, characterized in that, Step S1 also includes the following: Step S13: Employing time-structured information to encode and simulate the periodicity and monotonicity of an entity over time includes the following: Step S131: Employ dynamic entity embedding, including the following: Where Δt=|t q -t i | represents the time interval between the query time and the current time. w p b p w m b m The parameters represent learnable parameters, Linear(·) and RNN(·) represent linear layers and recurrent neural networks, respectively, and W0 represents the linear transformation matrix. ‖ represents the entity embedding after fusing entity type information, and ‖ represents the vector concatenation operation; Step S132: Utilize RGCN to capture structural dependencies between concurrent facts. The RGCN aggregator includes the following: in They represent l respectively th Embedding of head and tail entities of a layer, r l Indicates relational embedding. Let c represent the linear transformation matrix, σ(·) represent the activation function, and c s Representing entities The number of neighbors; Step S133: Embed the entity output from the last layer as follows: Use gated loop units to update the representation of entities: Where GRU(·) represents a gated loop unit; Step S134: Fuse the entity embeddings related to r into the relation embeddings to obtain the relation embedding matrix R′ of the time subgraph at time t. U t =σ(W3R′ t +b) R t+1 =U t ·R′ t +(l-U t )·R t Where pooling(·) represents the average pooling operation, E t,r Let R′ be the entity embedding matrix associated with relation r at time t. t It is determined by time t. The relational embedding matrix is ​​composed of W3, which is the time-gated learnable weight matrix, σ(·) is the sigmoid activation function, and R is the relational embedding matrix. t+1 To pass through time gate U t The updated time-t relation embedding matrix; Step S135: Obtain the query time t through steps S131 to S134. q The entity evolution representation of the m closest timestamps {e tq-m+2 ,…,e tp } and relational evolution representation {r tp-w+2 ,…,r tp }; Step S136: Introduce an entity-aware attention mechanism to distinguish the impact of different time snapshots on the query, including first analyzing the query at timestamp t. q All relations related to the query entity are averaged and pooled, and then the final local entity representation is calculated using an entity-aware attention mechanism. Furthermore, the impact of different time snapshots on queries includes the following: a i =σ(W5(e′ tq +e tq-m+i )),i∈[2,m-1] Where W4 and W5 are weight matrices, α i This represents the attention score.

6. The method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception according to claim 5, characterized in that, Step S2 includes the following: Step S21: Using the historical query subgraph constructed by the historical information encoder to learn the semantic information of historical facts includes the following: Step S211: Construct the query-related historical subgraph using the LogCL method, including: for a time knowledge graph First, for the header entity e of the given query s Based on the relationships in the time knowledge graph, find the relationship with e. s The directly connected entities then extend further to those related to e. s The adjacent entities of directly connected entities form a historical query subgraph G with a two-hop relationship. h ; Step S212: After obtaining the historical query subgraph, encode the historical query subgraph using RGCN, including the following: Among them, They represent l respectively th Embedding of the head and tail entities of the layer; Step S213: Let the output of the last layer of the RGCN be... An entity-aware attention mechanism is used to learn and query relevant historical facts, including the following: Where β is the attention score and σ represents the sigmoid activation function. This indicates the entity embedding that ultimately integrates historical information; Step S22: Obtain the frequency of recurring facts using dynamic frequency history encoding, and provide global constraints for the scoring in the multidimensional perceptual decoder, including the following: Step S221: Use query timestamp t q Methods for assigning weights to the time frequency of historical facts include the following: For a query (s,r,o,t) q The frequency value f is calculated by aggregating the weighted frequency of occurrence of the fact in past timestamps, where the weights are based on the query timestamp t. q With historical timestamps t i The time difference is determined by the following: Among them, |t q -t i +1| represents the absolute value of the time difference and t q >t i f(s,r,o) represents the total frequency of fact (s,r,o), ω(t) q ,t i ) with timestamp t i Distance from query timestamp t q The distance increases and the frequency gradually decreases; furthermore, the calculated frequency value f(s,r,o) ranges from [0,2).

7. The method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception according to claim 6, characterized in that, Step S3 includes the following: Step S31: A first convolutional kernel of size 3×3 and a second convolutional kernel of size 5×5 are used to capture the interaction between entities and relationships, as well as the interaction between entities. After convolution transformation, two feature mapping matrices are obtained. and Step S32: Define the scoring function, including the following: Where M(·,·) represents the convolution operation, vec(·) represents reconstructing the feature mapping matrix into a vector, performing a linear transformation using W9, and finally passing it through the linear activation function f(·) and the candidate entity embedding e. o The score is obtained by performing the inner product, where λ is a hyperparameter. Step S33: Obtain the association scores of the candidates by passing the scoring function through the sigmoid activation function: Where σ is the gimoid activation function; Step S34: Calculate the dynamic frequency score using the dynamic frequency history matrix constructed through dynamic frequency history coding, including the following: Where ⊙ represents the dot product; Step S35: Combine the two scores to calculate the final score of the candidate entity. The formula for the final score includes the following: Where α is a hyperparameter.

8. The method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception according to claim 7, characterized in that, Step S3 also includes the following: Step S36: The formula for calculating the loss predicted by the BCE loss function includes the following: Among them, y i Let y be the label of the triple (s,r,o,t) if (s,r,o,t)∈ε. i It is 1 if it is true, otherwise it is 0.

9. A system for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency awareness, comprising an electronic device, wherein the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements a method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception as described in any one of claims 2 to 8.

10. A system for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception, comprising a computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements a method for constructing a knowledge representation learning model based on multidimensional information interaction and dynamic frequency perception as described in any one of claims 2 to 8.

Citation Information

Cited By

  • Query expansion method and system for power grid knowledge search

    CN121478903A