Method and apparatus for training a temporal knowledge graph prediction model

By combining logical reasoning models and neural network prediction models, leveraging the implicit data mining capabilities of logical reasoning models and the feature expression capabilities of neural networks, and optimizing model parameters through iterative training, the shortcomings of existing TKG prediction methods with a single technical approach are overcome, thereby improving the accuracy and effectiveness of time-series knowledge graph prediction.

CN120911570BActive Publication Date: 2026-01-23INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511396370.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2026-01-23
Estimated Expiration
2045-09-28

AI Technical Summary

Technical Problem

Existing TKG prediction methods suffer from inherent limitations due to their reliance on a single technical approach, resulting in limited model prediction performance and an inability to effectively utilize hidden logic rules or feature representations.

Method used

By combining logical reasoning models and neural network prediction models, leveraging the implicit data mining capabilities of logical reasoning models and the feature representation capabilities of neural networks, the model parameters are optimized through iterative training to improve prediction accuracy.

Benefits of technology

It significantly improves the accuracy and effectiveness of time-series knowledge graph prediction, and achieves the optimal state of the model through multiple iterations of training, comprehensively utilizing the advantages of logical reasoning and neural networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120911570B_ABST
    Figure CN120911570B_ABST
Patent Text Reader

Abstract

The application relates to the field of information technology and provides a training method and device for a time sequence knowledge graph prediction model. The method uses the implicit data mining capability of a logic reasoning model based on time sequence logic rules as a link, uses a neural network prediction model with a feature expression capability advantage, scores the credibility of the implicit data, provides additional supervision information for the logic reasoning model, and improves the learning effect of the logic reasoning model. In turn, the logic reasoning model uses optimized model parameters to provide more reliable potential missing expansion implicit events for the neural network prediction model, thereby realizing parameter optimization of the neural network prediction model. After a limited number of repeated iterations, the final time sequence knowledge graph prediction model reaches an optimal state, and compared with a method of using a single logic reasoning model or a neural network prediction model for prediction, the accuracy and effectiveness of time sequence knowledge graph prediction can be significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of information technology, in particular to a training method and device of a temporal knowledge graph prediction model. BACKGROUND

[0002] TKG (Temporal Knowledge Graph) breaks through the limitation of static representation of traditional knowledge graph, integrates time information into the representation of knowledge graph, so as to record the state of entities and relationships at different time points, and further obtain the ability to capture the change rule and trend of knowledge over time. TKG prediction, as a cross frontier field of knowledge engineering and artificial intelligence, its task is to predict the possibility of a certain unknown or not yet occurred event based on known real event information. It provides key technical support for intelligent governance and dynamic knowledge service of complex systems, and has important practical significance.

[0003] The current TKG prediction method mainly includes two technical routes. One is to search the logical reasoning rules in the knowledge base and learn their reliability, and then use the association between the rules and the unseen events to complete the prediction. The other is to learn the low-dimensional vector representation of entities, relationships and time elements in the knowledge base, which is used as the basis for predicting unseen events.

[0004] However, the former can exploit hidden field logical rules, but there are bottlenecks in rule effectiveness and operation efficiency; the latter has excellent feature expression and operation efficiency, but it is insufficient to learn and utilize the implicit logical rules. Therefore, these defects limit the performance of single technical route model in TKG prediction. SUMMARY

[0005] The present application provides a training method and device of a temporal knowledge graph prediction model, which solves the defect that the performance of the model prediction is limited by the inherent defects of a single technical route when predicting a temporal knowledge graph based on logical rules or feature expression in the prior art.

[0006] The present application provides a training method of a temporal knowledge graph prediction model, comprising:

[0007] Step S1, obtaining a sample real event, an initial logical reasoning model and an initial neural network prediction model;

[0008] Step S2, inputting the sample real event into the initial logical reasoning model to obtain an output initial implicit event; inputting the initial implicit event into the initial neural network prediction model to obtain an output initial credibility evaluation of the initial implicit event;

[0009] Step S3, based on the initial credibility evaluation, screening the supervision implicit event from the initial implicit event; inputting the sample real event and the supervision implicit event into the initial logical inference model to obtain a time sequence logic rule and an updated implicit event, and calculating an expected value for the supervision implicit event by using the time sequence logic rule;

[0010] Step S4, based on the expected value of the supervision implicit event, screening an expanded implicit event from the supervision implicit event; inputting the sample real event, the expanded implicit event and the updated implicit event into the initial neural network prediction model to obtain an updated credibility evaluation of the updated implicit event;

[0011] Step S5, taking the updated credibility evaluation as the initial credibility evaluation of the next round, taking the updated implicit event as the initial implicit event of the next round, repeating steps S3 and S4 until the number of cycles meets a preset cycle condition, and taking the logical inference model and the neural network prediction model obtained in the last round as a time sequence knowledge graph prediction model.

[0012] According to the method for training the time sequence knowledge graph prediction model,

[0013] The time sequence logic rule includes a candidate time sequence logic rule and a rule weight of the candidate time sequence logic rule;

[0014] The inputting the sample real event and the supervision implicit event into the initial logical inference model to obtain a time sequence logic rule and an updated implicit event includes:

[0015] Based on the sample real event and the supervision implicit event, a time sequence knowledge base is constructed;

[0016] Based on a random walk algorithm, a candidate time sequence logic rule is determined from the time sequence knowledge base;

[0017] Based on the initial logical inference model, the correlation degrees between the sample real event and the supervision implicit event and the candidate time sequence logic rule and the self credibility evaluation of the sample real event and the supervision implicit event are calculated to obtain the rule weight of the candidate time sequence logic rule;

[0018] Based on the candidate time sequence logic rule and the rule weight, the updated implicit event is determined;

[0019] The initial logical inference model is constructed based on a Markov logic network.

[0020] The application provides a time sequence knowledge graph prediction model training method, which comprises the following steps:

[0021] Screening credible implied events from the supervised implied events;

[0022] Based on the extracted entities, relationships and time information in the sample real events and the credible implied events, the time sequence knowledge base is constructed.

[0023] The application provides a time sequence knowledge graph prediction model training method, which comprises the following steps:

[0024] Searching for an open path only supporting the rule body in the candidate time sequence logic rule from the time sequence knowledge base;

[0025] Taking the head entity, time sequence logic rule head and path tail entity of the open path as a candidate static link;

[0026] Merging candidate time sequence logic rules supporting the same candidate static link to obtain a support rule set of the candidate static link;

[0027] Combining a preset time window, based on the distance between the earliest time in each candidate static link corresponding to the support rule set and each candidate time of the candidate static link, and the rule weight of each candidate time sequence logic rule in the support rule set, calculating the support degree evaluation of the candidate static link at each candidate time;

[0028] Based on the support degree evaluation, the candidate static link corresponding to each candidate time is sorted, a preset proportion of candidate time and the candidate static link corresponding to the preset proportion of candidate time are selected to form the updated implied event.

[0029] The application provides a time sequence knowledge graph prediction model training method, which comprises the following steps:

[0030] Determining an index minimum threshold and a maximum number upper limit;

[0031] Selecting an implied event with an initial credibility evaluation greater than the index minimum threshold from the initial implied events as a candidate implied event;

[0032] In the case where the number of candidate implied events exceeds the maximum number upper limit, the maximum number upper limit of candidate implied events is selected as the supervised implied event.

[0033] A training method of a time sequence knowledge graph prediction model is provided according to the present application, and the time sequence knowledge graph prediction model is obtained, and then includes:

[0034] Obtaining a test real event;

[0035] Inputting the test real event into the time sequence knowledge graph prediction model to obtain a logical inference prediction result output by the logical inference model and a neural network prediction result output by the neural network prediction model;

[0036] Based on a prediction weight, the logical inference prediction result and the neural network prediction result are weighted and calculated to obtain a comprehensive prediction result.

[0037] The present application also provides a training device of a time sequence knowledge graph prediction model, comprising:

[0038] An obtaining unit obtains a sample real event, an initial logical inference model and an initial neural network prediction model;

[0039] A starting unit inputs the sample real event into the initial logical inference model to obtain an output initial implicit event, and inputs the initial implicit event into the initial neural network prediction model to obtain an initial credibility evaluation of the initial implicit event;

[0040] A logical inference model training unit filters a supervised implicit event from the initial implicit event based on the initial credibility evaluation, inputs the sample real event and the supervised implicit event into the initial logical inference model to obtain a time sequence logical rule and an updated implicit event, and calculates an expected value for the supervised implicit event using the time sequence logical rule;

[0041] A neural network training unit filters an expanded implicit event from the supervised implicit event based on the expected value of the supervised implicit event, and inputs the sample real event, the expanded implicit event and the updated implicit event into the initial neural network prediction model to obtain an updated credibility evaluation of the updated implicit event;

[0042] An iteration unit takes the updated credibility evaluation as the initial credibility evaluation of the next round, takes the updated implicit event as the initial implicit event of the next round, repeatedly executes the logical inference model training unit and the neural network training unit until the number of cycles meets a preset cycle condition, and takes the logical inference model and the neural network prediction model obtained in the last round as a time sequence knowledge graph prediction model.

[0043] The application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the training method of the time sequence knowledge graph prediction model according to any one of the above when executing the program.

[0044] The application further provides a non-transitory computer-readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the training method of the time sequence knowledge graph prediction model according to any one of the above.

[0045] The application further provides a computer program product, which includes a computer program, and the computer program is executable on a processor to implement the training method of the time sequence knowledge graph prediction model according to any one of the above.

[0046] The application provides a training method and device of a time sequence knowledge graph prediction model, which has the implicit data mining capability of a logic reasoning model constructed based on time sequence logic rules, and uses a neural network prediction model with the advantage of feature expression as a link, scores the credibility of the implicit data, provides additional supervision information for the logic reasoning model, and improves the learning effect of the logic reasoning model; in turn, the logic reasoning model uses the optimized model parameters to provide more reliable potential missing expansion implicit events for the artificial neural network prediction model, so that the parameter optimization of the artificial neural network prediction model is realized. After a limited number of repeated iterations, the final time sequence knowledge graph prediction model reaches an optimal state, and compared with the method of using a single logic reasoning model or neural network prediction model for prediction, the accuracy and effectiveness of the time sequence knowledge graph prediction are significantly improved. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0048] Figure 1 is a flowchart of the training method of the time sequence knowledge graph prediction model provided by the present application;

[0049] Figure 2 is a flowchart of the prediction of the neural network prediction model provided by the present application;

[0050] Figure 3 is a structure diagram of the Transformer unit of the neural network prediction model provided by the present application;

[0051] Figure 4 is a structural schematic diagram of a multilayer perceptron mixer of the neural network prediction model provided by the present application;

[0052] Figure 5 is a structural schematic diagram of a training device of the time sequence knowledge graph prediction model provided by the present application;

[0053] Figure 6 is a structural schematic diagram of an electronic device provided by the present application. DETAILED DESCRIPTION

[0054] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0055] In view of the above problems, the present application provides a training method of a time sequence knowledge graph prediction model to significantly improve the effect of time sequence knowledge graph prediction. Figure 1 is a flowchart of the training method of the time sequence knowledge graph prediction model provided by the present application, as shown in the figure, the method comprises: Figure 1

[0056] Step S1, obtaining sample real events, an initial logical reasoning model and an initial neural network prediction model.

[0057] Specifically, a time sequence knowledge base composed of historical events occurring in a certain field and period can be taken as sample real events to train the initial logical reasoning model and the initial neural network prediction model. For example, the actually available data set includes the Integrated Crisis Early Warning System data ICEWS for predicting, tracking and responding to global events, containing millions of data points from digitized news, social media and other sources; the Global Database of Events, Language and Tone GDELT for global social dynamics, comprehensive global events, language and emotion; the collaborative multilingual auxiliary knowledge base Wikidata; the multi-source knowledge base YAGO integrating Wikipedia, WordNet lexical database and GeoNames geographic database, etc.

[0058] ​It should be noted that the original data in the data set needs to be pre-processed, and entities, relationships and time are grouped and specifically coded using non-negative integers. Python and other programming languages can be used for coding or with the help of tool software. Taking the ICEWS14 data set as an example, there are 7128 entities, 230 relationships, and 365 times; The data is divided into training, validation, and test sets, and the number of events is 72826, 8941, and 8963 respectively. Since the initial logical reasoning model does not need to be verified during training, the sample real events used in step S3 actually contain training data and validation data; The sample real events used in step S4 only contain training data, and the validation data is used to verify the training effect during training.

[0059] In addition, the logical reasoning model and the neural network prediction model currently used for time sequence knowledge graph prediction can be obtained as the initial logical reasoning model and the initial neural network prediction model.

[0060] Among them, the initial logical reasoning model refers to a model framework constructed based on domain knowledge and a small amount of known logical relationships, which is used to perform logical reasoning on the input events to generate implicit events. The initial neural network model refers to a model constructed by using a suitable neural network structure, which is used to learn features of the input events to realize future event prediction.

[0061] Step S2, input the sample real event into the initial logical reasoning model to obtain the output initial implicit event; input the initial implicit event into the initial neural network prediction model to obtain the initial credibility evaluation of the initial implicit event.

[0062] Here, the initial implicit event refers to the potential event generated by the initial logical reasoning model reasoning on the sample real event. The initial credibility evaluation here refers to the numerical value output by the initial neural network prediction model after evaluating the possibility of the occurrence of the initial implicit event. It can be understood that the higher the credibility evaluation of the implicit event, the more likely the event will actually occur; the lower the credibility evaluation of the implicit event, the less likely the event will actually occur.

[0063] Specifically, the sample real event can be input into the initial logical reasoning model to obtain the initial implicit event output by the initial logical reasoning model. In addition, the initial implicit event output by the initial logical reasoning model is input into the initial neural network prediction model to obtain the initial credibility evaluation of the initial implicit event output by the initial neural network prediction model.

[0064] It should be noted that the initial implicit event obtained by the initial logical inference model and the initial credibility evaluation of the initial implicit event obtained by the initial neural network model can provide start-up data for subsequent model training. Step S2 is the same as step S3 except that the input does not include implicit events. In addition, it should be noted that since a large amount of implicit event data can be generated based on the initial logical inference model, most of which is invalid data, in order to avoid a serious burden on the evaluation of the artificial neural network model, it is necessary to screen it moderately to obtain supervised implicit events.

[0065] Step S3, based on the initial credibility evaluation, screening the supervised implicit events from the initial implicit events; inputting the sample real events and the supervised implicit events into the initial logical inference model to obtain the time sequence logical rules and the updated implicit events, and calculating the expected value of the supervised implicit events by using the time sequence logical rules.

[0066] Specifically, the initial implicit events can be screened by the initial credibility evaluation, and the initial implicit events with an initial credibility evaluation greater than a preset evaluation threshold are screened as supervised implicit events. Then, the sample real events and the supervised implicit events can be used as training data of the initial logical inference model, and the sample real events and the supervised implicit events are input into the initial logical inference model to obtain the time sequence logical rules. Then, the updated implicit events corresponding to the sample real events can be generated by the time sequence logical rules, and the expected value of the supervised implicit events can be calculated by the time sequence logical rules.

[0067] It should be noted that the time sequence logical rules can be considered as a training result of the initial logical inference model based on the sample real events and the supervised implicit events as training data. Among them, the rule weight corresponding to the time sequence logical rules can be regarded as a model parameter of the logical inference model which is continuously optimized in the training process.

[0068] Here, the supervised implicit event refers to an implicit event with a higher credibility evaluation output by the initial neural network model. It should be noted that the credibility evaluation based on the initial neural network output can be regarded as an evaluation of the inference result of the initial logical inference model, which tells the logical inference model which implicit data is more likely to conform to the actual situation and which may have deviations, so as to provide additional supervision information for the logical inference model and improve the learning effect of the logical inference model.

[0069] That is, the initial logical inference model can optimize and adjust the model parameters according to the scoring information provided by the initial artificial neural network model. For example, if it is found that the scores of the inferred implicit events according to a certain rule are generally low, it means that this rule may not be suitable for the actual data, and the rule weight corresponding to the temporal logic rule can be reduced; on the contrary, if the scores of the inferred implicit events of some rules are high, the rule weight corresponding to the temporal logic rule can be increased. Thus, the training process of the initial logical inference model can be regarded as a process of learning rule weights. By continuously learning rule weights, the implicit data generated based on the temporal logic rule is more consistent with the evaluation results of the artificial neural network model, thereby improving the learning effect and inference accuracy based on the temporal logic rule.

[0070] Step S4, based on the expected value of the supervised implicit event, the augmented implicit event is selected from the supervised implicit event; the sample real event, the augmented implicit event and the updated implicit event are input into the initial neural network prediction model to obtain the updated credibility evaluation of the updated implicit event.

[0071] Specifically, the expected value of the supervised implicit event can be calculated by the temporal logic rule output by the initial logical inference model. It should be noted that the expected value of the supervised implicit event is calculated based on the temporal logic rule here, and the expected value here can be used to reflect the scoring of the credibility of the temporal logic rule to the supervised implicit event. Then, the supervised implicit event higher than the preset expected threshold is selected as the augmented implicit event. The augmented implicit event here refers to an event for providing potential missing event information to the initial neural network for improving the learning and utilization of the initial neural network prediction model to the implicit logic rule.

[0072] Then, the sample real event and the augmented implicit event can be used as the training data of the initial neural network prediction model to train the initial neural network prediction model to adjust the model parameters of the initial neural network prediction model. Then, the credibility of the updated implicit event can be evaluated by the trained neural network prediction model to obtain the updated credibility evaluation of the updated implicit event. In detail, the sample real event and the augmented implicit event can be input into the initial neural network prediction model, and the missing event information is provided to the initial neural network prediction model through the augmented implicit event, thereby realizing the parameter optimization of the artificial neural network model to obtain the trained neural network prediction model. Then, the updated implicit event is input into the trained neural network prediction model to obtain the updated credibility evaluation of the updated implicit event output by the trained neural network prediction model.

[0073] Step S5, repeating step S3 and step S4 with the updated trustworthiness evaluation as the initial trustworthiness evaluation of the next iteration and the updated implicit events as the initial implicit events of the next iteration until the number of iterations meets a preset iteration condition, and taking the logic reasoning model and the neural network prediction model obtained in the last iteration as the time-series knowledge graph prediction model.

[0074] Specifically, the updated trustworthiness evaluation of the current iteration can be taken as the initial trustworthiness evaluation of the next iteration, and the updated implicit events can be taken as the initial implicit events of the next iteration. Thus, in the next iteration, step S3 and step S4 are repeated until the number of iterations meets a preset iteration condition, and the logic reasoning model and the neural network prediction model obtained in the last iteration are taken as the time-series knowledge graph prediction model. The preset iteration condition can be a threshold of the number of iterations or the model parameters of the time-series knowledge graph prediction model approaching convergence. It can be understood that the logic reasoning model obtained in the last iteration actually refers to the rule weight of the time-series logic rule obtained in the last iteration. It can be understood that the rule weight can be regarded as the model parameter of the logic reasoning model.

[0075] It should be noted that the dynamic evolution law discovered by the logic reasoning model is used to search for implicit events, and the neural network prediction model can effectively evaluate the trustworthiness of the implicit events. Based on the variational EM algorithm (Expectation-Maximization Algorithm), the logic reasoning model can strengthen the understanding of the dynamic logic rules and improve the ability to search for implicit events by absorbing the evaluation information of the implicit events, and can filter out reliable extended implicit events after updating the expected value of the implicit events used by the model using the uncertainty information in the dynamic logic rules; the neural network prediction model can use these reliable extended implicit events to optimize the learned embedded feature representation, thereby improving the accuracy of its evaluation of the implicit events. Through such iterative cycles and limited collaborative enhancement training, the prediction effect of the time-series knowledge graph can be significantly improved.

[0076] The method provided by the embodiment of the application improves the learning effect of the logical inference model by using the implicit data mining capability of the logical inference model constructed based on the time sequence logic rules, taking the neural network prediction model with the feature expression capability advantage as a link, scoring the credibility of the implicit data, and providing additional supervision information for the logical inference model, thereby improving the learning effect of the logical inference model. In turn, the logical inference model provides more reliable potential missing extended implicit events for the artificial neural network prediction model by using the optimized model parameters, thereby realizing the parameter optimization of the artificial neural network prediction model. After a limited number of repeated iterations, the final time sequence knowledge graph prediction model reaches an optimal state, and compared with the method of predicting by a single logical inference model or a neural network prediction model, the accuracy and effectiveness of the time sequence knowledge graph prediction can be significantly improved.

[0077] According to any of the above embodiments, the time sequence logic rules include candidate time sequence logic rules and rule weights of the candidate time sequence logic rules.

[0078] In step S3, the sample real events and the supervised implicit events are input into the initial logical inference model to obtain time sequence logic rules and updated implicit events, including:

[0079] Based on the sample real events and the supervised implicit events, a time sequence knowledge base is constructed.

[0080] Based on a random walk algorithm, candidate time sequence logic rules are determined from the time sequence knowledge base.

[0081] Based on the initial logical inference model, the correlation degrees between the sample real events and the supervised implicit events and the candidate time sequence logic rules and the self credibility evaluation of the sample real events and the supervised implicit events are calculated to obtain rule weights of the candidate time sequence logic rules.

[0082] Based on the candidate time sequence logic rules and the rule weights, the updated implicit events are determined.

[0083] The initial logical inference model is constructed based on a Markov logic network.

[0084] Specifically, entities, relationships, and corresponding time information can be extracted from the sample real events and the supervised implicit events, and a time sequence knowledge base is constructed based on the extracted information. Then, a random walk algorithm can be used to find a path with a length of l In the path, the time does not decrease. If an edge in the time sequence knowledge base can connect the start and end of the path and the time of the edge is greater than the end time in the path, a closed path is obtained, which reveals a possible time sequence logic rule, and candidate time sequence logic rules can be obtained.

[0085] In one embodiment, using the dataset ICEWS14 as an example, l When we choose {1,2,3} and the number of random walks is 200, we get 26,585 candidate temporal logic rules. The specific number will vary depending on the random seed used in the actual runtime. Then, we can perform preliminary screening based on the support ratio of the generated temporal logic rules. When the minimum threshold is set to 0.1, we get 7,582 candidate temporal logic rules. Each temporal logic rule consists of a rule body and a rule header. The rule body describes the conditions that trigger the rule, while the rule header refers to the result generated after the conditions in the rule body are met.

[0086] The determination of any candidate sequential logic rule can be expressed by the following formula:

[0087]

[0088]

[0089] In the formula, Represents any candidate sequential logic rule, where, The initial entity representing the initial logical rule. This indicates the relationship between the starting entity and the last entity in the rule header; Represents the last entity in the initial logical rule; This indicates the time information corresponding to the last entity; Indicates the first Time information corresponding to each entity; Indicates the length of the candidate sequential logic rule. Indicates the entity sequence number on the path that constitutes the candidate sequential logic rule; The first one constitutes the candidate sequential logic rule. One entity; Representing entities and entity The relationship between them; Indicates the first One entity; Indicates the first The time information corresponding to each entity.

[0090] It should be noted that all candidate temporal logic rules can also be obtained by traversing the temporal knowledge base. However, due to the massive scale of temporal knowledge bases built on the real world, the traversal method has low efficiency and practicality in obtaining candidate logic rules. The random walk algorithm, on the other hand, can effectively reduce computational complexity while ensuring a sufficient number of rules are obtained.

[0091] Furthermore, after obtaining the candidate temporal logic rules, the candidate temporal logic rules, sample real events, and supervision implicit events can be input into the initial logic reasoning model. The initial logic reasoning model here can be any type of temporal logic reasoning model; this application preferably uses a Markov logic network for construction.

[0092] It should be noted that Markov logic networks are a product of combining first-order predicate logic and probabilistic graphical models. First-order predicate logic can be used to effectively express various types of rules; probabilistic graphical models have the ability to handle rule uncertainty. Markov logic networks combine the two, making them suitable for expressing complex knowledge while handling its uncertainty, thus providing an effective method for rule selection. By introducing temporal logic rules, Markov logic networks can satisfy corresponding time constraints to obtain the temporal logic rules output by the initial logical reasoning model and their rule weights.

[0093] The rule weights of the temporal logic rules can be determined by the correlation between the sample real events and the supervised implicit events and the candidate temporal logic rules, as well as the inherent credibility of the sample real events and the supervised implicit events. The inherent credibility of the sample real events can be considered as 1, and the inherent credibility of the supervised implicit events can be obtained based on the credibility evaluation of the output of the initial neural network prediction model, i.e., a score within the range of [0,1]. After training, the authenticity of the test real events can be evaluated by using the correlation between the test real events and the output temporal logic rules, as well as the rule weights of the temporal logic rules. To fully utilize the computer's hardware performance, it is recommended to use a programming language such as C++ or Java, which has high code execution efficiency and can fully utilize the computer's multi-core capabilities, to implement this module's functionality.

[0094] The method provided in this invention constructs an initial logical reasoning model using a Markov logic network. Furthermore, a random walk algorithm is used to determine candidate temporal logical rules from a temporal knowledge base. Based on the initial logical reasoning model, the correlation between sample real events and supervised implicit events and the candidate temporal logical rules is calculated, along with the self-credibility evaluation of the sample real events and supervised implicit events, to obtain the rule weights of the candidate temporal logical rules, thus achieving efficient and effective generation of temporal logical rules.

[0095] To further improve the effectiveness of temporal logic rules, based on any of the above embodiments, a temporal knowledge base is constructed based on the sample real events and the supervision implicit events, including:

[0096] Trustworthy implicit events are obtained by filtering the aforementioned implicit events;

[0097] Based on the extracted entity, relationship, and time information from the real events and trusted implicit events in the samples, the time-series knowledge base is constructed.

[0098] Specifically, firstly, credible latent events can be selected from supervised latent events based on a higher credibility evaluation threshold. For example, supervised latent events that exceed the credibility evaluation threshold can be considered credible latent events. It is understandable that the credibility of these credible latent events is higher than the credibility of the remaining latent events in the supervised latent events.

[0099] Then, based on the entity, relation, and time information extracted from the real events and credible implicit events in the samples, a time-series knowledge base can be constructed. Any knowledge in the time-series knowledge base can be represented by a quadruple (...). ).

[0100] The method provided in this invention subdivides a more reliable subset of trusted implicit events from the monitored implicit events, treats them as missing real event data, and participates in the path construction when temporal logic rules are associated with data, so as to further improve the effectiveness of temporal logic rules.

[0101] Based on any of the above embodiments, determining the updated implicit event based on the candidate timing logic rules and the rule weights includes:

[0102] Search the temporal knowledge base to obtain non-closed paths that only support the rule bodies in the candidate temporal logic rules;

[0103] The head entity, timing logic rule head, and path tail entity of the non-closed path are selected as candidate static links.

[0104] Candidate timing logic rules that support the same candidate static link are merged to obtain the support rule set for the candidate static link.

[0105] Combining a preset time window, and based on the distance between the earliest time in each candidate static link corresponding to the support rule set and each candidate time of the candidate static link, as well as the rule weight of each candidate temporal logic rule in the support rule set, the support evaluation of the candidate static link occurring at each candidate time is calculated.

[0106] Based on the support evaluation, the candidate static links corresponding to each candidate time are sorted, and a preset proportion of candidate times and the candidate static links corresponding to the preset proportion of candidate times are selected to form the update implicit event.

[0107] Specifically, for each candidate temporal logic rule, a path matching its rule body (i.e., the sequence of entities and relations) can be searched in the temporal knowledge base. If the entities and relations of a path completely match the rule body but cannot match the temporal logic rule header of the candidate rule, this path is considered an open path for that candidate temporal logic rule. It can be understood that multiple open paths can be found for a single candidate temporal logic rule. Using the same method, all open paths corresponding to candidate temporal logic rules are searched.

[0108] Then, the head entity and tail entity of the non-closed path, along with the corresponding temporal logic rule header of the candidate temporal logic rule, can be considered as candidate static links. These candidate static links can be considered as implicit events that may occur within a given time window.

[0109] Furthermore, candidate temporal logic rules supporting the same candidate static link can be merged to obtain a set of supporting rules, thereby achieving deduplication of candidate static links. It should be noted that, based on the open-world assumption, the updated implicit event may be a real event that was not collected into the knowledge base due to reasons such as non-publication, statistical omission, or abnormal loss. The number and credibility of rules supporting an updated implicit event reflect the reliability of this implicit event. Then, path aggregation is performed on the non-closed paths corresponding to each candidate temporal logic rule in the set of supporting rules to calculate the support evaluation of the candidate static link occurring at each candidate time.

[0110] It should be noted that after determining the head entity, the timing logic rule head, and the path tail entity based on the non-closed path as candidate static links, according to the constraints... , It is the maximum time in the path. The range of values ​​is Therefore, for a single candidate static link, it is impossible to determine an accurate time, requiring a reasonable algorithm to select an appropriate time. Thus, a preset time window can be selected within a time distance. This time distance can be determined based on the minimum and maximum times on an open path.

[0111] In detail, by combining a preset time window, and based on the distance between the earliest time in each candidate static link corresponding to the support rule set and each candidate time of the candidate static link, as well as the rule weights of each candidate temporal logic rule in the support rule set, the support evaluation of the candidate static link at each candidate time can be calculated. The support evaluation of any candidate static link at any candidate time can be calculated using the following formula, as shown below:

[0112]

[0113] In the formula, This represents the support evaluation of any candidate static link occurring at any candidate time. This represents the set of supporting rules corresponding to the candidate static link. Candidate sequential logic rules in; Represents the rule weights of candidate sequential logic rules; This indicates the currently selected time, i.e., the time when the candidate event may occur; Indicates the size of the time window; This represents the minimum time along the path. This indicates the maximum time along the path.

[0114] It should be noted that the generation scale of latent events is enormous, and most of them are not valuable for exploitation. Based on support evaluation, the candidate static links corresponding to each candidate time are sorted, and a preset proportion of candidate times and their corresponding candidate static links are selected to form updated latent events. Here, the preset proportion can be set to 10 to 50 times the amount of real event data used in the sample. Taking the ICEWS14 dataset as an example, there are tens of millions of candidate events, and only 2,000,000 need to be selected based on their scores.

[0115] Based on any of the above embodiments, in step S3, based on the initial credibility evaluation, the supervised implicit events are screened from the initial implicit events, including:

[0116] Determine the minimum threshold and maximum quantity limit for the indicator;

[0117] From the initial implicit events, implicit events with an initial credibility evaluation greater than the minimum threshold of the index are selected as candidate implicit events;

[0118] If the number of candidate implicit events exceeds the maximum limit, the candidate implicit event with the maximum limit is selected as the supervised implicit event.

[0119] Specifically, this can be achieved by pre-setting a minimum threshold and a maximum number of indicators. Then, the initial implicit events can be sorted in reverse order of their initial credibility rating. Implicit events with an initial credibility rating greater than the minimum threshold are selected as candidate implicit events. For example, implicit events below the minimum threshold can be filtered out to obtain candidate implicit events.

[0120] It should be noted that the number of candidate latent events after screening may still be very large. To improve training efficiency, if the number of candidate latent events exceeds the maximum limit, the candidate latent events with the maximum limit can be selected as supervision latent events. For example, candidate latent events with low initial confidence ratings can be filtered out to retain those with high initial confidence ratings that also meet the maximum limit. In other words, if the number of candidate latent events does not exceed the maximum limit, all candidate latent events can be used as supervision latent events.

[0121] Similarly, in step S4, to filter out extended latent events from supervised latent events based on the expected value of supervised latent events, the same method described above can be used. By determining the minimum threshold and maximum upper limit of the index used to filter the expected value, extended latent events can be filtered out from supervised latent events.

[0122] In one embodiment, the minimum threshold of the indicator and maximum quantity limit R and N represent real numbers. First, select the content to be screened whose evaluation metrics are lower than [a certain threshold]. Delete the entries, and then sort the remaining entries in reverse order according to the evaluation indicators. The evaluation indicator for screening implicit event data containing credibility evaluation is the evaluation value given by the initial neural network prediction model in the previous step, and the evaluation indicator for screening implicit event data based on the credibility expectation value is the expectation value given by the temporal logic rule; if the number of remaining entries is greater than Then at most the top will be retained. Data items;

[0123] This includes implicit event data for supervision, which includes credibility evaluation. We need to further divide the data into a subset (trustworthy implicit events). Set minimum thresholds for them respectively. and and maximum quantity limit and ;in and Additionally, for implicit event data based on expected values... Each only requires a minimum threshold. and maximum quantity limit And there are . The value can be determined by referring to the number of real events in the sample used. , Taking the ICEWS14 dataset as an example, we can take... The number of real data points used for model training is 72,826; we take that number. And round down as ,Right now Correspondingly, .

[0124] Based on any of the above embodiments, the time-series knowledge graph prediction model is obtained, and then includes:

[0125] Obtain real test events;

[0126] The real test events are input into the temporal knowledge graph prediction model to obtain the logical reasoning prediction results output by the logical reasoning model and the neural network prediction results output by the neural network prediction model.

[0127] Based on the prediction weights, the logical reasoning prediction results and the neural network prediction results are weighted and calculated to obtain a comprehensive prediction result.

[0128] Specifically, a test set obtained by partitioning the initial real events can be used as test real events to test the trained temporal knowledge graph model. The testing process includes: first, inputting the test real events into the temporal knowledge graph prediction model, that is, inputting the test real events into the logical rule reasoning model and the neural network prediction model in the temporal knowledge graph prediction model respectively, and obtaining the logical reasoning prediction results output by the logical reasoning model and the neural network prediction results output by the neural network prediction model respectively.

[0129] Then, by obtaining the prediction weights corresponding to the logical reasoning prediction results and the neural network prediction results, the logical reasoning prediction results and the neural network prediction results can be weighted and calculated, and the event with the highest score obtained from the calculation can be used as the comprehensive prediction result.

[0130] Here, the comprehensive prediction result can be calculated using the following formula, as shown below:

[0131]

[0132] In the formula, This indicates the overall forecast results; The prediction weights represent the prediction results of logical reasoning. This represents the result of logical reasoning and prediction. The prediction weights represent the prediction results of the neural network. This represents the prediction result of the neural network.

[0133] In one embodiment, taking the ICEWS14 dataset as an example, the prediction weights can be determined in the following segmented manner:

[0134]

[0135] It should be noted that the prediction weights can be selected in a stepped manner, and the segmentation method can be adjusted according to different datasets to obtain the optimal results.

[0136] It is understandable that the time-series knowledge graph prediction model trained through the above collaborative methods can improve the prediction performance of the single logical rule reasoning model and the neural network prediction model, thereby significantly improving the accuracy and effectiveness of the final comprehensive prediction results.

[0137] In one embodiment, the neural network prediction result based on the output of the neural network prediction model can be achieved through the following steps: Figure 2 This is a schematic diagram illustrating the prediction process of the neural network prediction model provided by this invention, as shown below. Figure 2 As shown, the method includes:

[0138] For request events That is, based on entities e and relationships r and physical entities e Corresponding time of occurrence Making predictions and entities e Related entities "Among them, with Related events form a sequence , It can be expressed as ,in It can be either a head entity or a tail entity; This is used to limit the number of adjacent events. Therefore, this can be achieved by semantically encoding each related event entity of the request event and adding special tokens such as... and Post-encoding into semantic embedding and position embedding For example, regarding entity 1, relation 1, and... Semantic embedding for encoding ( , , , ) and location embedding ( , , , The two are concatenated and alternately input into the Transformer-based Core Unit to synthesize a triplet embedding. ,include Then, through a multilayer perceptron-based core unit, the final unified embedded representation is obtained. Then, the unified embedding representation is output through a fully connected layer to obtain the neural network prediction result. Taking the ICEWS14 dataset as an example, the embedding representation length can be set to 320, and the maximum length of the event sequence can be limited to 50.

[0139] During the training of the initial neural network prediction model, the optimizer used was Adamax, the learning rate was 0.01, and a warmup mechanism was adopted with a warmup ratio of 0.1. The activation function was Gelu, and the loss function was KL divergence. The number of training epochs can be set according to the accuracy requirements and can be any integer between [50, 1000]. Here, we choose two values, {100, 300}, which can meet the experimental requirements under two accuracy settings.

[0140] Figure 3 This is a schematic diagram of the Transformer unit of the neural network prediction model provided by the present invention, as shown below. Figure 3 As shown, this module includes:

[0141] Artificial neural network models contain multiple such core units, each consisting of alternating multi-head attention layers, add and normalization layers, and feed forward layers. The multi-head attention layers and feed forward layers both lead to a layer normalization operation with residual connections; the feed forward layer consists of two layers with GeLU non-linear activation functions.

[0142] It should be noted that, as an advanced artificial neural network structure, Transformer can effectively learn and understand the semantic structure and temporal information in the subgraph composed of the above event sequences using the attention mechanism, which is crucial for forming the final unified embedding representation.

[0143] Figure 4 This is a schematic diagram of the structure of the multilayer perceptron mixer for the neural network prediction model provided by the present invention, as shown below. Figure 4 As shown:

[0144] The neural network prediction model contains multiple such core units, whose input is a two-dimensional truth matrix M∈R^((1+k)×d) formed by k+1 embedding representations. Each core unit includes two hybrid layers: a Channel MLP and a Patch MLP, which are respectively preceded by a Layer Normalization operation and a Transposition operation. The Channel MLP takes a column of M as input, aiming to promote information interaction across event embeddings along the same feature dimension; the Patch MLP operates on the rows of M, aiming to promote information interaction between different feature dimensions within the same event embedding.

[0145] Artificial neural network models can be implemented using the PyTorch framework, which provides rich basic implementations such as tensor processing, data loading, artificial neural network modules, optimizers, and loss functions, which can improve the efficiency of model building and testing. By working with CUDA (Compute Unified Device Architecture) technology, it can make full use of the GPU stream processors and support multi-GPU environments, which can meet the needs of neural network models that require massive floating-point operations.

[0146] The time-series knowledge graph prediction method provided in this invention involves a large number of data preprocessing, post-processing, and module interaction operations, requiring an effective means to organize these complex data operations and heterogeneous models. In a Unix environment, shell scripts are feature-rich and easy to use, and can be used to organize, orchestrate, and debug the entire task framework; while Python scripts can flexibly implement various types of data processing.

[0147] Based on any of the above embodiments Figure 5 This is a schematic diagram of the training device for the time-series knowledge graph prediction model provided by the present invention, as shown below. Figure 5 As shown, the device includes:

[0148] Acquisition unit 510 acquires sample real events, initial logical reasoning model, and initial neural network prediction model;

[0149] The startup unit 520 inputs the sample real events into the initial logical reasoning model to obtain the output initial implicit events; it then inputs the initial implicit events into the initial neural network prediction model to obtain the initial credibility evaluation of the output initial implicit events.

[0150] The logical reasoning model training unit 530, based on the initial credibility evaluation, selects supervised implicit events from the initial implicit events; inputs the sample real events and the supervised implicit events into the initial logical reasoning model to obtain temporal logic rules and update implicit events, and uses the temporal logic rules to calculate the expected value for the supervised implicit events;

[0151] The neural network training unit 540, based on the expected value of the supervised hidden events, selects expanded hidden events from the supervised hidden events; inputs the sample real events, the expanded hidden events, and the updated hidden events into the initial neural network prediction model to obtain the update credibility evaluation of the updated hidden events;

[0152] Iteration unit 550 uses the updated credibility evaluation as the initial credibility evaluation for the next round, and the updated implicit event as the initial implicit event for the next round. It repeatedly executes the logical reasoning model training unit and the neural network training unit until the number of iterations meets the preset loop condition. The logical reasoning model and neural network prediction model obtained in the last round are used as the time-series knowledge graph prediction model.

[0153] The apparatus provided in this invention utilizes the implicit data mining capabilities of a logical reasoning model built based on temporal logic rules. Using this as a link, a neural network prediction model with superior feature representation capabilities provides additional supervisory information to the logical reasoning model by evaluating and scoring the credibility of the implicit data, thereby improving the learning effect of the logical reasoning model. Conversely, the logical reasoning model uses optimized model parameters to provide more reliable extended implicit events indicating potential missing information to the artificial neural network prediction model, thus optimizing the parameters of the artificial neural network prediction model. After a finite number of iterations, the final temporal knowledge graph prediction model reaches an optimal state. Compared to methods using a single logical reasoning model or neural network prediction model, this significantly improves the accuracy and effectiveness of temporal knowledge graph prediction.

[0154] Based on any of the above embodiments, the timing logic rule includes candidate timing logic rules and rule weights of the candidate timing logic rules;

[0155] The logical reasoning model training unit is specifically used for:

[0156] Based on the real events of the samples and the implicit events of the supervision, a time-series knowledge base is constructed;

[0157] Candidate temporal logic rules are determined from the temporal knowledge base based on a random walk algorithm.

[0158] Based on the initial logical reasoning model, the correlation degree between the sample real event and the supervised implicit event and the candidate temporal logic rule is calculated, as well as the self-credibility evaluation of the sample real event and the supervised implicit event, to obtain the rule weight of the candidate temporal logic rule;

[0159] The updated implicit event is determined based on the candidate time-series logic rules and the rule weights;

[0160] The initial logical reasoning model is constructed based on a Markov logic network.

[0161] Based on any of the above embodiments, the logical reasoning model training unit is further specifically used for:

[0162] Trustworthy implicit events are obtained by filtering the aforementioned implicit events;

[0163] Based on the extracted entity, relationship, and time information from the real events and trusted implicit events in the samples, the time-series knowledge base is constructed.

[0164] Based on any of the above embodiments, the logical reasoning model training unit is further specifically used for:

[0165] Search the temporal knowledge base to obtain non-closed paths that only support the rule bodies in the candidate temporal logic rules;

[0166] The head entity, timing logic rule head, and path tail entity of the non-closed path are selected as candidate static links.

[0167] Candidate timing logic rules that support the same candidate static link are merged to obtain the support rule set for the candidate static link.

[0168] Combining a preset time window, and based on the distance between the earliest time in each candidate static link corresponding to the support rule set and each candidate time of the candidate static link, as well as the rule weight of each candidate temporal logic rule in the support rule set, the support evaluation of the candidate static link occurring at each candidate time is calculated.

[0169] Based on the support evaluation, the candidate static links corresponding to each candidate time are sorted, and a preset proportion of candidate times and the candidate static links corresponding to the preset proportion of candidate times are selected to form the update implicit event.

[0170] Based on any of the above embodiments, the logical reasoning model training unit is further specifically used for:

[0171] Determine the minimum threshold and maximum quantity limit for the indicator;

[0172] From the initial implicit events, implicit events with an initial credibility evaluation greater than the minimum threshold of the index are selected as candidate implicit events;

[0173] If the number of candidate implicit events exceeds the maximum limit, the candidate implicit event with the maximum limit is selected as the supervised implicit event.

[0174] Based on any of the above embodiments, an iteration unit is included after the testing unit, and the testing unit is specifically used for:

[0175] Obtain real test events;

[0176] The real test events are input into the temporal knowledge graph prediction model to obtain the logical reasoning prediction results output by the logical reasoning model and the neural network prediction results output by the neural network prediction model.

[0177] Based on the prediction weights, the logical reasoning prediction results and the neural network prediction results are weighted and calculated to obtain a comprehensive prediction result.

[0178] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a training method for a time-series knowledge graph prediction model. This method includes: step S1, acquiring sample real events, an initial logical reasoning model, and an initial neural network prediction model; step S2, inputting the sample real events into the initial logical reasoning model to obtain the output initial implicit events; inputting the initial implicit events into the initial neural network prediction model to obtain an initial credibility evaluation of the output initial implicit events; step S3, based on the initial credibility evaluation, filtering out supervised implicit events from the initial implicit events; inputting the sample real events and the supervised implicit events into the initial logical reasoning model to obtain time-series logical rules and updated implicit events. Step S3 involves calculating the expected value of the supervised implicit event using the temporal logic rules; Step S4 involves selecting expanded implicit events from the supervised implicit events based on their expected values; the sample real events, the expanded implicit events, and the updated implicit events are input into the initial neural network prediction model to obtain the updated credibility evaluation of the updated implicit events; Step S5 involves using the updated credibility evaluation as the initial credibility evaluation for the next round, using the updated implicit events as the initial implicit events for the next round, and repeating steps S3 and S4 until the number of iterations meets the preset iteration condition. The logical reasoning model and neural network prediction model obtained in the last round are then used as the temporal knowledge graph prediction model.

[0179] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0180] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the training method of the time-series knowledge graph prediction model provided by the above methods. The method includes: step S1, acquiring sample real events, an initial logical reasoning model, and an initial neural network prediction model; step S2, inputting the sample real events into the initial logical reasoning model to obtain the output initial implicit events; inputting the initial implicit events into the initial neural network prediction model to obtain the initial credibility evaluation of the output initial implicit events; step S3, based on the initial credibility evaluation, filtering out supervised implicit events from the initial implicit events; and combining the sample real events and the supervised implicit events... The implicit events are input into the initial logical reasoning model to obtain temporal logic rules and updated implicit events, and the expected value of the supervised implicit events is calculated using the temporal logic rules; Step S4: Based on the expected value of the supervised implicit events, expanded implicit events are selected from the supervised implicit events; The sample real events, the expanded implicit events, and the updated implicit events are input into the initial neural network prediction model to obtain the updated credibility evaluation of the updated implicit events; Step S5: The updated credibility evaluation is used as the initial credibility evaluation for the next round, and the updated implicit events are used as the initial implicit events for the next round. Steps S3 and S4 are repeated until the number of iterations meets the preset iteration condition. The logical reasoning model and neural network prediction model obtained in the last round are used as the temporal knowledge graph prediction model.

[0181] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a training method for the time-series knowledge graph prediction model provided by the methods described above. This method includes: step S1, acquiring sample real events, an initial logical reasoning model, and an initial neural network prediction model; step S2, inputting the sample real events into the initial logical reasoning model to obtain output initial implicit events; inputting the initial implicit events into the initial neural network prediction model to obtain an initial credibility evaluation of the output initial implicit events; step S3, based on the initial credibility evaluation, filtering out supervised implicit events from the initial implicit events; inputting the sample real events and the supervised implicit events into the initial logical reasoning model. The model obtains temporal logic rules and updated implicit events, and calculates the expected value of the supervised implicit events using the temporal logic rules; Step S4, based on the expected value of the supervised implicit events, selects expanded implicit events from the supervised implicit events; inputs the sample real events, the expanded implicit events, and the updated implicit events into the initial neural network prediction model to obtain the updated credibility evaluation of the updated implicit events; Step S5, uses the updated credibility evaluation as the initial credibility evaluation for the next round, uses the updated implicit events as the initial implicit events for the next round, and repeats steps S3 and S4 until the number of iterations meets the preset iteration condition, and uses the logical reasoning model and neural network prediction model obtained in the last round as the temporal knowledge graph prediction model.

[0182] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0183] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0184] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An event prediction method based on a temporal knowledge graph prediction model, characterized in that, include: Step S1: Obtain sample real events, an initial logical reasoning model, and an initial neural network prediction model; the sample real events include digital news. Step S2: Input the sample real events into the initial logical reasoning model to obtain the output initial implicit events; The initial implicit event is input into the initial neural network prediction model to obtain the initial credibility evaluation of the initial implicit event. Step S3: Based on the initial credibility evaluation, select supervised implicit events from the initial implicit events; The sample real events and the supervised implicit events are input into the initial logical reasoning model to obtain the temporal logic rules and update the implicit events, and the expected value of the supervised implicit events is calculated using the temporal logic rules. Step S4: Based on the expected value of the supervised implicit event, select the expanded implicit event from the supervised implicit event; The sample real events, the expanded latent events, and the updated latent events are input into the initial neural network prediction model to obtain the update credibility evaluation of the updated latent events; Step S5: Use the updated credibility evaluation as the initial credibility evaluation for the next round, and use the updated implicit event as the initial implicit event for the next round. Repeat steps S3 and S4 until the number of iterations meets the preset iteration condition. Use the logical reasoning model and neural network prediction model obtained in the last round as the time-series knowledge graph prediction model. After obtaining the time-series knowledge graph prediction model, the following steps are included: Obtain real test events; The real test events are input into the temporal knowledge graph prediction model to obtain the logical reasoning prediction results output by the logical reasoning model and the neural network prediction results output by the neural network prediction model. Based on the prediction weights, the logical reasoning prediction results and the neural network prediction results are weighted and calculated to obtain a comprehensive prediction result.

2. The event prediction method based on a time-series knowledge graph prediction model according to claim 1, characterized in that, The temporal logic rules include candidate temporal logic rules and the rule weights of the candidate temporal logic rules; The step of inputting the sample real events and the supervised implicit events into the initial logical reasoning model to obtain the temporal logical rules and update the implicit events includes: Based on the real events of the samples and the implicit events of the supervision, a time-series knowledge base is constructed; Candidate temporal logic rules are determined from the temporal knowledge base based on a random walk algorithm. Based on the initial logical reasoning model, the correlation degree between the sample real event and the supervised implicit event and the candidate temporal logic rule is calculated, as well as the self-credibility evaluation of the sample real event and the supervised implicit event, to obtain the rule weight of the candidate temporal logic rule; The updated implicit event is determined based on the candidate time-series logic rules and the rule weights; The initial logical reasoning model is constructed based on a Markov logic network.

3. The event prediction method based on a time-series knowledge graph prediction model according to claim 2, characterized in that, The construction of a time-series knowledge base based on the sample real events and the supervised implicit events includes: Trustworthy implicit events are obtained by filtering the aforementioned implicit events; Based on the extracted entity, relationship, and time information from the real events and trusted implicit events in the samples, the time-series knowledge base is constructed.

4. The event prediction method based on a time-series knowledge graph prediction model according to claim 2, characterized in that, The step of determining the updated implicit event based on the candidate time-series logic rules and the rule weights includes: Search the temporal knowledge base to obtain non-closed paths that only support the rule bodies in the candidate temporal logic rules; The head entity, timing logic rule head, and path tail entity of the non-closed path are selected as candidate static links. Candidate timing logic rules that support the same candidate static link are merged to obtain the support rule set for the candidate static link. Combining a preset time window, and based on the distance between the earliest time in each candidate static link corresponding to the support rule set and each candidate time of the candidate static link, as well as the rule weight of each candidate temporal logic rule in the support rule set, the support evaluation of the candidate static link occurring at each candidate time is calculated. Based on the support evaluation, the candidate static links corresponding to each candidate time are sorted, and a preset proportion of candidate times and the candidate static links corresponding to the preset proportion of candidate times are selected to form the update implicit event.

5. The event prediction method based on a temporal knowledge graph prediction model according to any one of claims 1 to 4, characterized in that, The process of selecting supervised latent events from the initial latent events based on the initial credibility evaluation includes: Determine the minimum threshold and maximum quantity limit for the indicator; From the initial implicit events, implicit events with an initial credibility evaluation greater than the minimum threshold of the index are selected as candidate implicit events; If the number of candidate implicit events exceeds the maximum limit, the candidate implicit event with the maximum limit is selected as the supervised implicit event.

6. An event prediction device based on a temporal knowledge graph prediction model, characterized in that, include: The acquisition unit acquires real events from samples, the initial logical reasoning model, and the initial neural network prediction model. The sample real-world events include digital news; The startup unit inputs the sample real events into the initial logical reasoning model to obtain the output initial implicit events; The initial implicit event is input into the initial neural network prediction model to obtain the initial credibility evaluation of the initial implicit event. The logical reasoning model training unit, based on the initial credibility evaluation, selects supervised implicit events from the initial implicit events; The sample real events and the supervised implicit events are input into the initial logical reasoning model to obtain the temporal logic rules and update the implicit events, and the expected value of the supervised implicit events is calculated using the temporal logic rules. The neural network training unit selects extended latent events from the supervised latent events based on the expected value of the supervised latent events; The sample real events, the expanded latent events, and the updated latent events are input into the initial neural network prediction model to obtain the update credibility evaluation of the updated latent events; The iterative unit takes the updated credibility evaluation as the initial credibility evaluation for the next round, takes the updated implicit event as the initial implicit event for the next round, and repeatedly executes the logical reasoning model training unit and the neural network training unit until the number of iterations meets the preset iteration condition. The logical reasoning model and neural network prediction model obtained in the last round are used as the time-series knowledge graph prediction model. After obtaining the time-series knowledge graph prediction model, the following steps are included: Obtain real test events; The real test events are input into the temporal knowledge graph prediction model to obtain the logical reasoning prediction results output by the logical reasoning model and the neural network prediction results output by the neural network prediction model. Based on the prediction weights, the logical reasoning prediction results and the neural network prediction results are weighted and calculated to obtain a comprehensive prediction result.

7. An electronic device comprising 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 the event prediction method based on the temporal knowledge graph prediction model as described in any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the event prediction method based on the temporal knowledge graph prediction model as described in any one of claims 1 to 5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the event prediction method based on the temporal knowledge graph prediction model as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Complex network link prediction method and system based on logical reasoning and graph convolution

    CN113190688A

  • Time sequence knowledge graph reasoning method and system based on Markov logic network

    CN117273143A