A target retrieval method and system based on local and global historical clues

By constructing a target retrieval method based on local and global historical clues, dynamically sampling the temporal knowledge graph, and utilizing the convolutional network model and ConvTransE decoder, the problem of discontinuous adjacent windows is solved, thereby improving the accuracy and computational efficiency of temporal knowledge graph reasoning.

CN119961292BActive Publication Date: 2025-10-03SHANGHAI UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510018295.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-10-03
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

Existing temporal knowledge graph reasoning methods cannot effectively handle the problem of discontinuity of fact elements when learning the structural information of facts in adjacent fixed time windows, resulting in low target retrieval accuracy.

Method used

By constructing a target retrieval method based on local and global historical clues, dynamic subgraph sampling is performed using the target query vector to obtain local and global prediction probabilities, and probability calculation is performed through a convolutional network model and ConvTransE decoder, fusing local and global prediction probabilities to improve accuracy.

Benefits of technology

It solves the problem of discontinuous adjacent windows, improves the accuracy of target retrieval, reduces the amount of calculation, and achieves more accurate global information modeling and reasoning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119961292B_ABST
    Figure CN119961292B_ABST
Patent Text Reader

Abstract

This application discloses a target retrieval method and system based on local and global historical clues, involving the field of temporal knowledge graph reasoning. The method includes dynamically sampling subgraphs of the temporal knowledge graph using a target query vector, using the target subgraph set as a local historical clue to obtain a local prediction probability; constructing a global answer object entity statistical vector using the subgraphs before the target time in the temporal knowledge graph as a global historical clue to obtain a global prediction probability; and obtaining a fused prediction probability based on the local and global prediction probabilities. This application obtains a continuous target subgraph set by dynamically sampling the subgraphs before the target time, thus solving the problem of discontinuous adjacent windows and improving the accuracy of target retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of temporal knowledge graph reasoning, and in particular to a target retrieval method based on local and global historical clues. Background Art

[0002] Temporal knowledge graph reasoning involves inferring missing facts based on historical data. It has been widely used in social networks and recommendation systems. Existing methods mainly achieve temporal reasoning by learning the structural information of facts in adjacent fixed time windows.

[0003] However, in the existing technology, temporal knowledge graph reasoning focuses on learning the structural information of facts in adjacent fixed time windows. However, when fact elements are discontinuous in adjacent windows, the subgraph associated with the facts cannot be sampled, resulting in missing reasoning clues and low target retrieval accuracy. Summary of the Invention

[0004] The purpose of this application is to provide a target retrieval method based on local and global historical clues, including:

[0005] Build a time series knowledge graph based on structured data with time as the clue;

[0006] Constructing a target query vector based on the retrieval target; the target query vector includes: a target subject entity, a target relation, an object entity to be predicted, and a target time;

[0007] Using the target query vector, dynamic subgraph sampling is performed on the temporal knowledge graph to obtain a target subgraph set; the target subgraph set is a set of subgraphs that have a relationship between the object entity to be predicted and the target subject entity before the target time; the relationship includes at least the target relationship;

[0008] Using the target subgraph set as a local history clue, a local prediction probability is obtained; the local prediction probability is the probability that the object entity to be predicted in the local history clue has a relationship with the target subject entity;

[0009] Using the target query vector, the subgraph before the target time in the temporal knowledge graph is used as a global history clue to construct a global answer object entity statistical vector;

[0010] Based on the global answer object entity statistical vector, a global prediction probability is calculated; the global prediction probability is the probability that the object entity to be predicted and the target subject entity in the global history clue have a target relationship;

[0011] The fused prediction probability is calculated using the local prediction probability and the global prediction probability; the fused prediction probability is used to characterize the probability that the object entity to be predicted has a target relationship with the target subject entity.

[0012] Optionally, the target query vector is used to perform dynamic subgraph sampling on the temporal knowledge graph to obtain a target subgraph set, specifically including:

[0013] Extract all subgraphs before the target time in the temporal knowledge graph, and use the target query vector to select the set of subgraphs that have a relationship with the target subject entity as the historical subgraph set;

[0014] In the historical subgraph set, a set of subgraphs within a preset time period before the target time is selected as the target subgraph set.

[0015] Optionally, construct a global answer object entity statistics vector, specifically including:

[0016] Construct a target vector for each subgraph in the global history clue;

[0017] Sum up the values ​​of the same elements in all target vectors to obtain the global answer object entity statistics vector.

[0018] Optionally, the target subgraph set is used as a local history clue to obtain the local prediction probability, including:

[0019] Substitute the target subgraph set into the convolutional network model, calculate each temporal embedding representation of the subject entity, and obtain the temporal embedding set of the target subject entity;

[0020] Using the temporal embedding set of the target subject entity, the temporal evolution features of the target subject entity are calculated using the temporal fusion encoder;

[0021] The temporal evolution characteristics of the target subject entity are utilized and the ConvTransE decoder is used to decode and obtain the local prediction probability.

[0022] Optionally, the convolutional network model is a relationship-aware graph convolutional network model.

[0023] Optionally, based on the global answer object entity statistics vector, a global prediction probability is calculated, specifically including:

[0024] Based on the global answer object entity statistical vector, the global features of the embedded representation of the target query vector are encoded to obtain the global features;

[0025] The global prediction probability is calculated using global features.

[0026] Optionally, the calculation formula of the global feature is as follows:

[0027] H g =N s +tanh(w m *(cat(H′ s , rs ))+b m );

[0028] Where H g is the global feature, N s is the global answer object entity statistical vector, tanh(·) is the activation function, w m and b m is a trainable parameter, H′ s is the embedding representation of the target subject entity, r s is the embedding representation of the target relation, cat(H′ s , r s ) represents the corresponding embedding representation of the target query vector.

[0029] Optionally, the global prediction probability is calculated using global features, specifically including:

[0030] The following formula is used to calculate the global prediction probability by using the softmax function

[0031] score2=softmax(H g );

[0032] Where score2 is the global prediction probability, softmax(·) is the normalized exponential function, and H g It is a global feature.

[0033] A computer system includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-mentioned target retrieval method based on local and global history clues.

[0034] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0035] This application first screens local historical clues, eliminates subgraphs in the temporal knowledge graph that have no relationship with the target subject entity, and then selects the subgraphs in the time period closest to the target time as the input subgraphs of the model to obtain local prediction probabilities, thereby solving the problem of discontinuous adjacent windows and improving the accuracy of target retrieval.

[0036] By constructing the target vector, the representation method of the probability of the existence of a relationship for each object entity in the global history subgraph is simplified, the amount of calculation is reduced, and the problem of global information redundancy affecting calculation efficiency is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0038] Figure 1 A flowchart of a target retrieval method based on local and global historical clues provided in an embodiment of the present application.

[0039] Figure 2 A flowchart of a target retrieval method based on local and global historical clues provided in an embodiment of the present application.

[0040] Figure 3 This is a structural representation diagram of the relationship-aware graph convolutional network provided in an embodiment of the present application.

[0041] Figure 4 This is a structural diagram of the timing fusion encoder provided in an embodiment of the present application.

[0042] Figure 5 This is a structural diagram of the ConvTransE decoder provided in an embodiment of the present application.

[0043] Figure 6 Local historical clues provided for the embodiments of this application Figure 1 .

[0044] Figure 7 Local historical clues provided for the embodiments of this application Figure 2 .

[0045] Figure 8 Local historical clues provided for the embodiments of this application Figure 3 .

[0046] Figure 9 A global historical clue diagram provided for an embodiment of the present application.

[0047] Figure 10 This is the final prediction result diagram of the embodiment of this application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0049] This patent belongs to the field of temporal knowledge graph reasoning and is suitable for extrapolation reasoning tasks. The technologies closest to this patent mainly include RE-GCN, EvoKG, TiRGN, RETIA, RPC, etc. Specifically, RE-GCN technology uses a relation-aware graph convolutional network (RGCN) to learn the embedding of entities and relationships in adjacent subgraphs, and uses time gates to fuse entity embeddings at different times to obtain temporal evolution features. EvoKG technology models both the temporal probability distribution of facts and the structural probability distribution of facts, and models the dynamic evolution of time through a recurrent neural network (RNN). TiRGN technology uses a relation-aware graph convolutional network (RGCN) to learn structural information in adjacent subgraphs, and uses a gated recurrent unit (GRU) to learn temporal evolution features. In addition, this technology assigns the same weights to historical entities when modeling global information, guiding the model to favor these weighted entities. RETIA first samples several subgraphs of adjacent time steps, then generates their respective twin super-relationship subgraphs based on these subgraphs, and uses the Relationship-Aware Graph Convolutional Network (RGCN) to aggregate the interaction information of entities and relationships in the super-relationship subgraph. In addition, the method also establishes a twin interaction module TIM, which can provide interaction information when relationships and entities are aggregated, making the representation of entities and relationships more comprehensive. RPC specifically uses a Relationship Communication Unit (RCU) to learn the mutual connections between relationships in adjacent subgraphs. Similarly, when learning entity embedding, the method also uses the Relationship Graph Convolutional Network (RGCN) to model the structural information in the adjacent subgraph, and uses the Gate Recurrent Unit (GRU) to learn the temporal evolution features.

[0050] Abbreviations and key terms:

[0051] LGHC (Temporal Knowledge Graph Reasoning based on Local and Global Historical Clues).

[0052] The purpose of this application is to provide a target retrieval method and system based on local and global historical clues, aiming to sample the subgraphs before the target time through dynamic subgraph sampling to obtain a continuous set of target subgraphs, thereby solving the problem of discontinuous adjacent windows; and by defining a target vector to represent the probability of the existence of a relationship for each object entity, solving the problem of global information redundancy affecting computational efficiency.

[0053] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0054] Example 1

[0055] like Figure 1-Figure 2 As shown, this embodiment discloses a target retrieval method based on local and global historical clues, the method comprising:

[0056] S1. Build a temporal knowledge graph based on structured data with time as the clue;

[0057] A target query vector is set; the target query vector includes: a target subject entity, a target relation, an object entity to be predicted, and a target time.

[0058] In the actual application process, the input layer of this application is the time series knowledge graph G and the corresponding target query vector (s q , r q ,? ,t q ), where (s q represents the target subject entity, r q represents the target relationship, ? represents the object entity to be predicted, t q Indicates the target time.

[0059] S2. Construct a target query vector based on the retrieval target.

[0060] S3. Using the target query vector, dynamically sample subgraphs of the temporal knowledge graph to obtain a target subgraph set; the target subgraph set is a set of subgraphs in which the object entity to be predicted has a relationship with the target subject entity before the target time; the relationship includes at least the target relationship.

[0061] Specifically, the relationship is all relationships between the object entity and the target subject entity, and the target relationship is one of the relationships; the target relationship is a relationship between the object entity and the target subject entity that only exists in the target query vector, such as a clear relationship such as "capture".

[0062] Furthermore, step S3 specifically includes:

[0063] S31. Extract all subgraphs before the target time in the temporal knowledge graph, and use the target query vector to select the set of subgraphs that have a relationship with the target subject entity as the historical subgraph set.

[0064] S32. In the historical subgraph set, a set of subgraphs within a preset time period before the target time is selected as the target subgraph set.

[0065] In actual applications, in order to obtain local historical clues of factual elements, we first use the dynamic subgraph sampling method to sample subgraphs associated with the target query vector in the temporal knowledge graph to ensure correct reasoning clues. The dynamic subgraph sampling process mainly includes two operations: sampling and selection. The specific process is as follows.

[0066] Sampling operation: For a given target query vector (sq, rq, ?, tq), i.e., fact element, according to the fact element i.e., entity s a , select the corresponding historical subgraph set, namely:

[0067]

[0068] In order to reduce space usage, ensure that each subgraph Contains only entities with s q A collection of relevant facts.

[0069] Selection operation: Since the closer the fact happens, the greater the impact on the final result. Therefore, in order to be able to approximate the evolution of the current entity, from entity s q The collection of all historical subgraphs This solves the problem of previous methods that only sample the first few adjacent windows discontinuously, and finally obtains the target subgraph set (the m temporally most adjacent subgraphs related to the target query vector), which is the local reasoning clue.

[0070] S4. Using the target subgraph set as a local history clue, obtain a local prediction probability; the local prediction probability is the probability that the object entity to be predicted in the local history clue has a relationship with the target subject entity.

[0071] Furthermore, step S4 specifically includes:

[0072] S41. Substitute the target subgraph set into the convolutional network model, calculate each temporal embedding representation of the subject entity, and obtain the temporal embedding set of the target subject entity.

[0073] S42. Using the temporal embedding set of the target subject entity, the global features are calculated using the temporal fusion encoder.

[0074] S43. Using global features, the ConvTransE decoder is used to decode and obtain the local prediction probability.

[0075] Optionally, the convolutional network model is a relationship-aware graph convolutional network model.

[0076] In actual application, the specific process of step S41 is as follows.

[0077] After obtaining the target subgraph set, in order to aggregate the structural information of the target query vector in each subgraph, a l-layer relationship-aware graph convolutional network is deployed to perform subgraph information aggregation. The main structure of the network is as follows: Figure 3 shown.

[0078] The principle of the relationship-aware graph convolutional network is to sum the aggregate information under each relationship, and then obtain the neighboring aggregate information of the target entity under multiple relationships. Figure 3 As can be seen in the figure, the structural information of entity s will be obtained through the five relationships and adjacent entities connected to it. For the target subject entity embedding at time t in layer l+1 Its embedding can be obtained by the following formula:

[0079]

[0080] in, Represent the embedding representation of entity s, relation r and entity o in layer l respectively. represents the trainable parameters when aggregating information, Represents the weight parameter during self-loop. c0 is the regularization constraint parameter, which represents the in-degree of the target subject entity s. f(·) represents the activation function RReLU. Relation-aware graph convolutional network uses Represents the information transmitted by the object entity o through the relation r. After feeding these m subgraphs into the l-layer relation-aware graph convolutional network, we can get the entity s q The m temporal embeddings in the last layer are:

[0081]

[0082] in, The embedding dimension is d. The input is the sampled m subgraphs, and the output is the entity s a m temporal embeddings of .

[0083] The specific process of step S42 is as follows.

[0084] Based on the temporal embedding set of the target subject entity obtained in step S41 (entity s g The temporal fusion encoder is used to learn the temporal evolution characteristics of facts between different subgraphs. The temporal evolution characteristics of entities contain information about their trends and preferences, which can provide temporal evolution rules for reasoning. Therefore, when learning temporal evolution characteristics, this embodiment needs to consider m subgraphs at the same time to include as much information as possible. The main structure diagram is as follows Figure 4 shown.

[0085] First, in the time encoding module, this embodiment obtains the time information corresponding to each sampling sub-graph, that is, where t i Indicates the time of the i-th subgraph. In this embodiment, t0=t1-1 is used as the time of the initial static embedding. In order to integrate the time information into the embedding representation, the time interval between the time series and the current time is obtained, and the periodic function cosine is used to obtain the time embedding, that is:

[0086]

[0087] Where cos(·) represents a periodic operation function, is the time weight, is the time offset. q is the time of the target query vector, t i Indicates the time corresponding to each subgraph embedding.

[0088] Then, in order to avoid over-smoothing, an initial embedding is introduced. For the target query vector (s q , r q ,? ,t q ), this embodiment uses the static embedding in RE-GCN To initialize entity s q Represents. Connect the m embeddings of the target subgraph set obtained by the dynamic subgraph sampling method with the initial embedding, cat(·) is the connection operation, that is:

[0089]

[0090] Furthermore, the time embedding is fused into the entity s as the position embedding q In the embedding of , the concatenated sequence embedding is expressed as:

[0091]

[0092] In the time series fusion module, the above sequence is embedded into Multi-head attention layer to obtain single-head attention weight matrix and single head hidden output Right now:

[0093]

[0094]

[0095] in, are three independent linear transfer matrices, k represents the number of attention heads. is The input of the single-head attention is obtained in . Connect the hidden layer outputs corresponding to the k heads to obtain the final hidden layer output, that is:

[0096]

[0097] In addition, in order to prevent overfitting, this embodiment uses a residual neural network to obtain the entity s q The evolution of is:

[0098]

[0099]

[0100]

[0101] in, is a trainable parameter, and the final Represents entity s q The temporal evolution characteristics of .

[0102] In the temporal information output module, considering the problem of large entity embedding deviation due to the complexity of the network, the initial static embedding With H s The last embed Fusion is performed through a single-layer neural network, namely:

[0103] H weight =sigmoid(W wei *H′ s +b wei ).

[0104]

[0105] in, and is a trainable parameter. After the above local feature modeling, this embodiment obtains the entity s q The temporal evolution characteristics H′ s Based on the temporal evolution characteristics, this embodiment will subsequently perform decoding to obtain local prediction results. The input is entity s q The output is entity s, which is the m temporal embedding of m subgraphs and the temporal embedding of m subgraphs. q The temporal evolution characteristics H′ s .

[0106] The specific process of step S43 is as follows.

[0107] The temporal evolution features of the target subject entity obtained in step S42 are used for probability prediction. Specifically, the ConvTransE decoder is used for prediction. The purpose of the ConvTransE decoder is to decode the learned entity and relationship embeddings to obtain local prediction results. Its structure is shown in the figure below. Figure 5 shown.

[0108] Specifically, given c different convolution kernels, the decoder first performs a one-dimensional convolution on the concatenation of entity embeddings and relation embeddings, i.e.:

[0109]

[0110] Where K is the width of the convolution kernel, n∈[0,d-1] represents the entry in the output vector, ω c Represents a trainable parameter. and They are entity embedding H′ s and relational embeddings s After c different convolution kernels, we can get an output vector, namely: Then, align the output vector with all convolution kernels to get the final matrix

[0111] Secondly, follow the steps below to get the local prediction score score1, namely:

[0112] score1=f(vec(M conv )W)H.

[0113] Among them, f represents a nonlinear function, vec is a feature mapping operation, is a linear transfer operation, is the embedding dictionary of all entities.

[0114] S5. Using the target query vector, the subgraph before the target time in the temporal knowledge graph is used as the global history clue to construct the global answer object entity statistical vector.

[0115] Specifically, constructing a global answer object entity statistical vector includes:

[0116] Construct a target vector for each subgraph in the global history thread.

[0117] The global answer object entity statistics vector is obtained by summing the values ​​of the same elements in all target vectors. The target vector includes multiple elements, each of which is used to indicate whether each object entity in the target vector has a target relationship with the target subject entity. The value of each element is 0 or 1. When the value of the element is 0, the current object entity in the target vector corresponding to the element does not have a target relationship with the target subject entity; when the value of the element is 1, the current object entity in the target vector corresponding to the element does have a target relationship with the target subject entity.

[0118] Specifically, the calculation formula for the global answer object entity statistical vector is as follows:

[0119]

[0120] Among them, N s is the global answer object entity statistics vector, For the tth i The target vector for each time step, tq is the target time, t i For the tth i Time step.

[0121] In the actual application process, in order to solve the problem that the global information of the fact cannot be modeled due to the limitation of the number of sampling subgraphs in the existing technology, this embodiment performs global feature encoding. First, global historical information must be obtained. In order to obtain global historical information, for a given target query vector (s q , r q ,? ,t q ), statistics of the target query vector in t q The object entity matched at all previous time steps. Specifically, a vector is defined in each subgraph where t i Represents the current statistical time step, and |V| represents the number of entities. Each element of this vector is either 0 or 1, where 0 means the entity does not match the target query vector, and 1 means the opposite. Then, add all the previous vectors to get a global answer entity statistics vector

[0122] S6. Based on the global answer object entity statistical vector, calculate the global prediction probability; the global prediction probability is the probability that the object entity to be predicted in the global history clue has a target relationship with the target subject entity.

[0123] Step S6 specifically includes:

[0124] S61. Based on the global answer object entity statistical vector, encode the global features of the embedded representation of the target query vector to obtain the global features.

[0125] S62. Calculate the global prediction probability using the global features.

[0126] Specifically, the calculation formula of the global feature is as follows:

[0127] H g =N s +tanh(w m *(cat(H′ s , r s ))+b m ).

[0128] Where H g is the global feature, N s is the global answer object entity statistical vector, tanh(·) is the activation function, w m and b m is a trainable parameter, H′ s is the embedding representation of the target subject entity, r sis the embedding representation of the target relation, cat(H′ s , r s ) represents the corresponding embedding representation of the target query vector.

[0129] In practical applications, since each element represents the number of times the corresponding object entity matches the target query vector, these numbers can be used as the weight of the object entity. Based on the weight distribution and the embedding of the target query vector, global features are encoded. This global feature will be used to generate the global prediction results in subsequent steps. Global feature encoding can reflect the repetitive and cyclical patterns of facts across all past time steps. Therefore, encoding global features can effectively improve the accuracy and comprehensiveness of predictions.

[0130] Furthermore, the global prediction probability is calculated using the global features, specifically including:

[0131] The global prediction probability is calculated using the softmax function using the following formula.

[0132] score2=softmax(H g ).

[0133] Where score2 is the global prediction probability, softmax(·) is the normalized exponential function, and H g It is a global feature.

[0134] S7. Using the local prediction probability and the global prediction probability, a fused prediction probability is calculated; the fused prediction probability is used to characterize the probability that the object entity to be predicted has a target relationship with the target subject entity.

[0135] In actual application, the global prediction score score2 is integrated into the local prediction probability score1 to obtain a more comprehensive and reasonable score, namely the fused prediction probability:

[0136] score=score1+score2.

[0137] Where score is the fusion prediction probability score.

[0138] This application takes the target query vector (A and B, capture,?, 2014.10.12) as an example, Figure 6-Figure 8 Shows the partial historical clues of this application, Figure 9 shows the global history thread, Figure 10 The final prediction result is shown. Specifically, Figure 6-Figure 8 Respectively represent the three subgraphs sampled in this application, Figure 6 The corresponding time is 2014.10.01, Figure 7The corresponding time is 2014.10.09, Figure 8 The corresponding time is 2014.10.10. As can be seen from the figure, all three subgraphs contain factual information related to the target subject entities "A and B". This proves that the subgraphs sampled by this application are relevant to the target query vector, allowing the application to learn more accurate structural information. Figure 9 This figure shows the process of assigning weights to different answer entities during the global modeling process. The application first obtains the answer vectors for the target query vector at all time steps. Then, the application sums these vectors to obtain a global answer vector, which is used as the weight for each entity. The results show that the application assigns more weight to the "Citizen (Z)" entity; that is, entities that interact more closely with the target query vector should receive a higher weight. Figure 10 The fusion of local and global prediction results is shown. The final predicted entity is "Citizen (Z)", which is consistent with the correct answer.

[0139] The technical effects of this application are as follows:

[0140] This application first screens local historical clues, removing subgraphs from the temporal knowledge graph that have no relationship with the target subject entity. It then selects the subgraph within the time period closest to the target time as the model's input subgraph to obtain local prediction probabilities, resolving the problem of discontinuous adjacent windows and improving target retrieval accuracy. By constructing a target vector, the global representation of the probability of a relationship for each object entity in the historical subgraph is simplified, reducing computational effort and addressing the issue of global information redundancy impacting computational efficiency.

[0141] Specifically, this application samples the temporal relationship graph using a dynamic subgraph sampling method, obtaining a continuous set of target subgraphs. This allows accurate modeling of both local and global features of this type of data when discontinuities occur between adjacent windows. Furthermore, global historical information is introduced to distinguish the importance of different historical entities and model global features, enabling global reasoning. Finally, the application fuses the local and global results to achieve more accurate and reasonable reasoning. Specifically, this application first samples relevant subgraphs using a dynamic subgraph sampling method and learns strongly correlated structural information using a relationship-aware graph convolutional network. Next, the application considers the impact of temporal information on the temporal evolution of facts, using time embeddings as position embeddings and modeling temporal evolution information using a temporal fusion encoder, achieving local reasoning. Furthermore, to model the global repetitive and cyclical patterns of facts, this application introduces global historical information, distinguishes the importance of different historical entities, and models global features, achieving global reasoning. This application uses a ConvTransE decoder to obtain local prediction probabilities and a Softmax classification function to obtain global prediction probabilities. Finally, the application fuses the local and global prediction probabilities to achieve more accurate and reasonable reasoning. Experimental results on four benchmark datasets show that the proposed application can effectively model the fact that elements appear discontinuous.

[0142] Example 2. This embodiment discloses a computer system, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the target retrieval method based on local and global historical clues described above.

[0143] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0144] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A target retrieval method based on local and global historical clues, characterized in that: The target retrieval method based on local and global historical clues includes: Build a time series knowledge graph based on structured data with time as the clue; Constructing a target query vector based on the retrieval target; the target query vector includes: a target subject entity, a target relation, an object entity to be predicted, and a target time; Using the target query vector, dynamic subgraph sampling is performed on the temporal knowledge graph to obtain a target subgraph set; the target subgraph set is a set of subgraphs that have a relationship between the object entity to be predicted and the target subject entity before the target time; the relationship includes at least the target relationship; Using the target subgraph set as a local history clue, a local prediction probability is obtained; the local prediction probability is the probability that the object entity to be predicted in the local history clue has a relationship with the target subject entity; Using the target query vector, the subgraph before the target time in the temporal knowledge graph is used as a global history clue to construct a global answer object entity statistical vector; Based on the global answer object entity statistical vector, a global prediction probability is calculated; the global prediction probability is the probability that the object entity to be predicted and the target subject entity in the global history clue have a target relationship; The fused prediction probability is calculated using the local prediction probability and the global prediction probability; the fused prediction probability is used to characterize the probability that the object entity to be predicted has a target relationship with the target subject entity.

2. The target retrieval method based on local and global historical clues according to claim 1 is characterized in that: Using the target query vector, dynamic subgraph sampling is performed on the temporal knowledge graph to obtain the target subgraph set, which specifically includes: Extract all subgraphs before the target time in the temporal knowledge graph, and use the target query vector to select the set of subgraphs that have a relationship with the target subject entity as the historical subgraph set; In the historical subgraph set, a set of subgraphs within a preset time period before the target time is selected as the target subgraph set.

3. The target retrieval method based on local and global historical clues according to claim 1 is characterized in that: Construct a global answer object entity statistics vector, specifically including: Construct a target vector for each subgraph in the global history clue; Sum up the values ​​of the same elements in all target vectors to obtain the global answer object entity statistics vector.

4. The target retrieval method based on local and global historical clues according to claim 1 is characterized in that: Using the target subgraph set as local history clues, we can obtain local prediction probabilities, including: Substitute the target subgraph set into the convolutional network model, calculate each temporal embedding representation of the subject entity, and obtain the temporal embedding set of the target subject entity; Using the temporal embedding set of the target subject entity, the temporal evolution features of the target subject entity are calculated using the temporal fusion encoder; The temporal evolution characteristics of the target subject entity are utilized and the ConvTransE decoder is used to decode and obtain the local prediction probability.

5. The target retrieval method based on local and global historical clues according to claim 4 is characterized in that: The convolutional network model is a relationship-aware graph convolutional network model.

6. The target retrieval method based on local and global historical clues according to claim 1 is characterized in that: Based on the global answer object entity statistical vector, the global prediction probability is calculated, including: Based on the global answer object entity statistical vector, the global features of the embedded representation of the target query vector are encoded to obtain the global features; The global prediction probability is calculated using global features.

7. The target retrieval method based on local and global historical clues according to claim 6 is characterized in that: The calculation formula of the global feature is as follows: H g =N s +tanh(w m *(cat(H' s ,r s ))+b m ); Where H g is the global feature, N s is the global answer object entity statistical vector, tanh(·) is the activation function, w m and b m is a trainable parameter, H′ s is the embedding representation of the target subject entity, r s is the embedding representation of the target relation, cat(H′ s ,r s ) represents the corresponding embedding representation of the target query vector.

8. The target retrieval method based on local and global historical clues according to claim 6 is characterized in that: The global prediction probability is calculated using global features, including: The following formula is used to calculate the global prediction probability by using the softmax function score2=softmax(H g ); Where score2 is the global prediction probability, softmax(·) is the normalized exponential function, and H g It is a global feature.

9. A computer system comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the target retrieval method based on local and global history clues according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Dynamic multi-target space-time problem query method based on grid space-time knowledge graph

    CN116010722A

  • Image semantic understanding method and device based on multilayer information enhancement and medium

    CN118522010A