Training method and device of time sequence knowledge graph prediction model

By combining iterative training of logical reasoning models and neural network models, the shortcomings of a single technical approach in TKG prediction are overcome, and the accuracy and effectiveness of prediction are improved.

CN120911570AActive Publication Date: 2025-11-07INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511396370.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2025-11-07
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

The synergistic enhancement of logical reasoning models and neural network models has been achieved, significantly improving the accuracy and effectiveness of time-series knowledge graph prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120911570A_ABST
    Figure CN120911570A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information, and provides a method and a device for training a time sequence knowledge graph prediction model, which are characterized in that a neural network prediction model with characteristic expression ability advantages is utilized by utilizing the implicit data mining ability of a logical reasoning model based on a time sequence logic rule and taking the implicit data mining ability as a link, so that the time sequence knowledge graph prediction model is obtained. Additional supervision information is provided for the logical reasoning model by evaluating and scoring the credibility of the implicit data, so that the learning effect of the logical reasoning model is improved; and on the contrary, the logical reasoning model provides more reliable potentially missing extended implicit events for the neural network prediction model by using the optimized model parameters, so that parameter optimization of the neural network prediction model is realized. After finite times of repeated iteration, the final time sequence knowledge graph prediction model can reach an optimal state, and compared with a method for performing prediction by using a single logical reasoning model or a neural network prediction model, the accuracy and effectiveness of time sequence knowledge graph prediction can be remarkably 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, and 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: Step S1, obtaining a sample real event, an initial logical reasoning model and an initial neural network prediction model; 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; Step S3, based on the initial credibility evaluation, screening supervision implicit events from the initial implicit events; inputting the sample real events and the supervision implicit events into the initial logical inference model to obtain a time sequence logic rule and an updated implicit event, and calculating an expected value of the supervision implicit event by using the time sequence logic rule; 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 events, 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; 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.

[0007] According to the method provided by the application, The time sequence logic rule comprises a candidate time sequence logic rule and a rule weight of the candidate time sequence logic rule. The inputting the sample real events and the supervision implicit events into the initial logical inference model to obtain a time sequence logic rule and an updated implicit event comprises: Based on the sample real events and the supervision implicit events, a time sequence knowledge base is constructed. Based on a random walk algorithm, a candidate time sequence logic rule is determined from the time sequence knowledge base. Based on the initial logical inference model, the correlation degrees between the sample real events and the supervision implicit events and the candidate time sequence logic rule and the self credibility evaluation of the sample real events and the supervision implicit events are calculated to obtain the rule weight of the candidate time sequence logic rule. Based on the candidate time sequence logic rule and the rule weight, the updated implicit event is determined. The initial logical inference model is constructed based on a Markov logic network.

[0008] According to the method provided by the application, the method for training the time sequence knowledge graph prediction model comprises the following steps: From the supervision implicit events, a credible implicit event is screened. Based on the extracted entities, relationships and time information in the sample real events and the credible implicit events, the time sequence knowledge base is constructed.

[0009] The training method of the time sequence knowledge graph prediction model provided by the application comprises the following steps: Searching for a non-closed path supporting only a rule body in the candidate time sequence logic rule from the time sequence knowledge base; Taking the head entity, the time sequence logic rule head and the path tail entity of the non-closed path as a candidate static link; Merging candidate time sequence logic rules supporting the same candidate static link to obtain a support rule set of the candidate static link; Combining a preset time window, calculating a support degree evaluation of the candidate static link occurring at each candidate time based on a distance between an earliest time in each candidate static link corresponding to the support rule set and each candidate time of the candidate static link and a rule weight of each candidate time sequence logic rule in the support rule set; Based on the support degree evaluation, sorting the candidate static link corresponding to each candidate time, selecting a preset proportion of candidate times and the candidate static link corresponding to the preset proportion of candidate times to form the updated implicit event.

[0010] The training method of the time sequence knowledge graph prediction model provided by the application comprises the following steps: Determining an index minimum threshold and a maximum number upper limit; Selecting an implicit event with an initial credibility evaluation greater than the index minimum threshold from the initial implicit event as a candidate implicit event; In the case that the number of candidate implicit events exceeds the maximum number upper limit, selecting the maximum number upper limit of candidate implicit events as the supervised implicit event.

[0011] The training method of the time sequence knowledge graph prediction model provided by the application comprises the following steps: Obtaining a test real event; Inputting the test real event into the time sequence knowledge graph prediction model to obtain a logic reasoning prediction result output by the logic reasoning model and a neural network prediction result output by the neural network prediction model; Based on a prediction weight, performing weighted calculation on the logic reasoning prediction result and the neural network prediction result to obtain a comprehensive prediction result.

[0012] The application further provides a training device of a time sequence knowledge graph prediction model, comprising: an acquisition unit, which acquires a sample real event, an initial logical inference model and an initial neural network prediction model; a starting unit, which inputs the sample real event into the initial logical inference model to obtain an output initial implied event, and inputs the initial implied event into the initial neural network prediction model to obtain an initial credibility evaluation of the initial implied event; a logical inference model training unit, which filters a supervised implied event from the initial implied event based on the initial credibility evaluation, inputs the sample real event and the supervised implied event into the initial logical inference model to obtain a time sequence logical rule and an updated implied event, and calculates an expected value for the supervised implied event by using the time sequence logical rule; a neural network training unit, which filters an expanded implied event from the supervised implied event based on the expected value of the supervised implied event, and inputs the sample real event, the expanded implied event and the updated implied event into the initial neural network prediction model to obtain an updated credibility evaluation of the updated implied event; an iteration unit, which repeats execution of the logical inference model training unit and the neural network training unit by taking the updated credibility evaluation as the initial credibility evaluation of the next round and taking the updated implied event as the initial implied event of the next round until a preset loop condition is met, and takes a logical inference model and a neural network prediction model obtained in the last round as a time sequence knowledge graph prediction model.

[0013] The application further provides an electronic device, which comprises 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.

[0014] The application further provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program implements the training method of the time sequence knowledge graph prediction model according to any one of the above when executed by a processor.

[0015] The application further provides a computer program product, which comprises a computer program, and the computer program implements the training method of the time sequence knowledge graph prediction model according to any one of the above when executed by a processor.

[0016] The application provides a training method and device of a time sequence knowledge graph prediction model. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0018] Figure 1 FIG. 1 is a flowchart of the training method of the time sequence knowledge graph prediction model provided by the present application; Figure 2 FIG. 2 is a flowchart of the prediction of the neural network prediction model provided by the present application; Figure 3 FIG. 3 is a structural diagram of the Transformer unit of the neural network prediction model provided by the present application; Figure 4 FIG. 4 is a structural diagram of the multi-layer perceptron mixer of the neural network prediction model provided by the present application; Figure 5 FIG. 5 is a structural diagram of the training device of the time sequence knowledge graph prediction model provided by the present application; Figure 6 FIG. 6 is a structural diagram of the electronic device provided by the present application. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solutions and advantages of the present application more clear, the technical solutions in the present application will be clearly and completely described below in combination with the drawings in the present application. Obviously, the described embodiments are some 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 belong to the scope of protection of the present application.

[0020] To solve the above problems, the application provides a training method of a time sequence knowledge graph prediction model to significantly improve the time sequence knowledge graph prediction effect. Figure 1 The flowchart of the training method of the time sequence knowledge graph prediction model provided by the application is shown in FIG. 1. Figure 1 The method comprises the following steps. Step S1, obtaining sample real events, an initial logical reasoning model and an initial neural network prediction model.

[0021] Specifically, a time sequence knowledge base composed of historical events occurring in a certain field in a certain period can be used as sample real events to train the initial logical reasoning model and the initial neural network prediction model. For example, the actually available data sets include 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 vocabulary and GeoNames geographic database, etc.

[0022] It should be noted that the original data in the data set needs to be preprocessed, and the entities, relationships and time are grouped and specifically coded using non-negative integers. The coding can be performed using a programming language such as Python or by using 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 testing sets, and the number of events in each set is 72826, 8941 and 8963 respectively. Since the initial logical reasoning model does not need to be validated 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 periodically validate the training effect during training.

[0023] 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.

[0024] The initial logical reasoning model refers to a model framework constructed based on domain knowledge and a small number of known logical relationships, which is used to perform logical reasoning according to 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 the features of the input events to realize future event prediction.

[0025] Step S2, inputting the sample real event into the initial logical inference model to obtain an output initial implied event; and inputting the initial implied event into the initial neural network prediction model to obtain an output initial credibility evaluation of the initial implied event.

[0026] Here, the initial implied event refers to a potential event generated by the initial logical inference model based on the sample real event. The initial credibility evaluation refers to a numerical value output by the initial neural network prediction model based on an evaluation of the possibility of occurrence of the initial implied event. It can be understood that the higher the credibility evaluation of the implied event, the greater the possibility of the event actually occurring; the lower the credibility evaluation of the implied event, the smaller the possibility of the event actually occurring.

[0027] Specifically, the sample real event can be input into the initial logical inference model to obtain an initial implied event output by the initial logical inference model. In addition, the initial implied event output by the initial logical inference model can be input into the initial neural network prediction model to obtain an initial credibility evaluation of the initial implied event output by the initial neural network prediction model.

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

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

[0030] Specifically, the initial implied event can be screened based on the initial credibility evaluation, and the initial implied event with an initial credibility evaluation greater than a preset evaluation threshold can be screened as a supervised implied event. Then, the sample real event and the supervised implied event can be used as training data for the initial logical inference model, and the sample real event and the supervised implied event can be input into the initial logical inference model to obtain a time sequence logical rule. Then, the updated implied event corresponding to the sample real event can be generated based on the time sequence logical rule, and the expected value for the supervised implied event can be calculated based on the time sequence logical rule.

[0031] It should be noted that the temporal logic rule here can be considered as a training result obtained by training the initial logic reasoning model based on the sample real event and the supervised implied event as training data. The rule weight corresponding to the temporal logic rule can be considered as a model parameter of the logic reasoning model which is continuously optimized in the training process.

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

[0033] That is, the initial logic reasoning 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 implied events reasoned according to a certain rule generally have a lower score, it means that this rule may not be suitable for actual data, and the rule weight corresponding to the temporal logic rule can be reduced. Conversely, if the implied events reasoned by some rules have a higher score, the rule weight corresponding to the temporal logic rule can be increased. Thus, the training process of the initial logic reasoning model can be regarded as a process of learning rule weights. By continuously learning rule weights, the implied data generated based on the temporal logic rule is more consistent with the evaluation result of the artificial neural network model, thereby improving the learning effect and reasoning accuracy based on the temporal logic rule.

[0034] Step S4, based on the expected value of the supervised implied event, filtering the augmented implied event from the supervised implied event; inputting the sample real event, the augmented implied event and the updated implied event into the initial neural network prediction model to obtain an updated confidence evaluation of the updated implied event.

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

[0036] Then, the sample real events and the augmented implicit events can be taken as training data of the initial neural network prediction model, and the initial neural network prediction model can be trained to adjust the model parameters of the initial neural network prediction model. Then, the updated implicit events can be evaluated for credibility by the trained neural network prediction model to obtain updated credibility evaluations of the updated implicit events. In detail, the sample real events and the augmented implicit events can be input into the initial neural network prediction model, and the augmented implicit events can provide the missing event information for the initial neural network prediction model, so as to realize the optimization of the parameters of the artificial neural network model to obtain the trained neural network prediction model. Then, the updated implicit events are input into the trained neural network prediction model to obtain the updated credibility evaluations of the updated implicit events output by the trained neural network prediction model.

[0037] In step S5, the updated credibility evaluations are taken as the initial credibility evaluations of the next round, and the updated implicit events are taken as the initial implicit events of the next round, and steps S3 and S4 are repeatedly executed until the number of cycles meets a preset cycle condition. The logical reasoning model and the neural network prediction model obtained in the last round are taken as the time sequence knowledge graph prediction model.

[0038] Specifically, the updated credibility evaluations of the current iteration round can be taken as the initial credibility evaluations of the next round, and the updated implicit events can be taken as the initial implicit events of the next round. Thus, in the next round, steps S3 and S4 are repeatedly executed until the number of cycles meets a preset cycle condition. The logical reasoning model and the neural network prediction model obtained in the last round are taken as the time sequence knowledge graph prediction model. The preset cycle condition here can be a cycle number threshold, or the model parameters of the time sequence knowledge graph prediction model can be close to convergence. It can be understood that the logical reasoning model obtained in the last round actually refers to the rule weight of the time sequence logical rule obtained in the last round. It can be understood that the rule weight here can be regarded as the model parameter of the logical reasoning model.

[0039] It should be noted that the dynamic evolution law of the logical reasoning model is used to search for the implicit event, and the neural network prediction model can effectively evaluate the credibility of the implicit event. Based on the variational EM algorithm (Expectation-Maximization Algorithm), the logical reasoning model can strengthen the understanding of the dynamic logical rules and improve the ability to search for implicit events by absorbing the evaluation information of the implicit event, and after updating the expected value of the implicit event used by the model using the uncertainty information in the dynamic logical rules, reliable extended implicit events are selected; the neural network prediction model can use these reliable extended implicit events to optimize the learned embedded feature representation, thereby improving the accuracy of the evaluation of the implicit event. Through the above iterative cycle, the effect of the time sequence knowledge graph prediction can be significantly improved through a limited number of collaborative enhancement training.

[0040] The method provided by the embodiment of the application can improve the learning effect of the logical reasoning model by using the implicit data mining capability of the logical reasoning model constructed based on the time sequence logical rules, taking the neural network prediction model with the advantage of feature expression as a link, and providing additional supervision information for the logical reasoning model through the credibility evaluation score of the implicit data, thereby improving the learning effect of the logical reasoning model. In turn, the logical reasoning model can provide 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 can reach an optimal state, and compared with the method of using a single logical reasoning model or neural network prediction model for prediction, the accuracy and effectiveness of the time sequence knowledge graph prediction can be significantly improved.

[0041] According to any of the above embodiments, the time sequence logical rules include candidate time sequence logical rules and rule weights of the candidate time sequence logical rules. In step S3, the sample real event and the supervised implicit event are input into the initial logical reasoning model to obtain time sequence logical rules and updated implicit events, including: Based on the sample real event and the supervised implicit event, a time sequence knowledge base is constructed. Based on a random walk algorithm, candidate time sequence logical rules are determined from the time sequence knowledge base. Based on the initial logical reasoning model, the correlation degrees between the sample real event and the supervised implicit event and the candidate time sequence logical rules and the self-credibility evaluation of the sample real event and the supervised implicit event are calculated to obtain rule weights of the candidate time sequence logical rules. Based on the candidate time sequence logical rules and the rule weights, the updated implicit events are determined. The initial logical reasoning model is constructed based on a Markov logic network.

[0042] Specifically, entity, relation, and corresponding time information can be extracted from real events and supervised latent events. This extracted information is then used to construct a time-series knowledge base. Then, a random walk algorithm can be used to find a time-series knowledge base with a length of... l Furthermore, if a path that satisfies the condition of no time reduction exists, and if there is an edge in the temporal knowledge base that can connect the beginning and end of the path, and its time is greater than the end time in the path, such a closed path reveals a possible temporal logic rule, and thus a candidate temporal logic rule can be obtained.

[0043] 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.

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

[0045]

[0046] 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 entity; represent the time information corresponding to the entity.

[0047] It should be noted that all candidate temporal logic rules can also be obtained by traversing the temporal knowledge base. However, due to the large size of the temporal knowledge base constructed based on the real world, the efficiency and practicability of the method based on traversal to obtain candidate logic rules is low. Based on the random walk algorithm, the operation complexity can be effectively reduced under the premise of ensuring a sufficient number of rules.

[0048] Further, after obtaining the candidate temporal logic rules, the candidate temporal logic rules, sample real events and supervised implicit events can be input into the initial logic reasoning model. The initial logic reasoning model here can be any kind of temporal logic reasoning model, and the application is preferably based on Markov logic network.

[0049] It should be noted that Markov logic network is a combination of first-order predicate logic and probabilistic graphical model. First-order predicate logic can be used to effectively express various types of rules; probabilistic graphical model has the ability to handle rule uncertainty. Markov logic network combines the two, so that it can be used to express complex knowledge and handle uncertainty, and is an effective method for rule screening. By introducing temporal logic rules, Markov logic network can meet the corresponding time constraints to obtain the temporal logic rules output by the initial logic reasoning model and the rule weights of the temporal logic rules.

[0050] The rule weight of the temporal logic rule can be determined by the correlation between the sample real event and the supervised implicit event and the candidate temporal logic rule, and the self-confidence of the sample real event and the supervised implicit event. The self-confidence of the sample real event can be considered as 1, and the self-confidence of the supervised implicit event can be the confidence evaluation based on the output of the initial neural network prediction model, i.e. the score provided in the range of [0, 1]. After training, the association between the test real event and the output temporal logic rule and the rule weight of the temporal logic rule can be used to evaluate the authenticity of the test real event. In order to fully utilize the hardware performance of the computer, it is recommended to use a programming language such as C++ or Java with high code running efficiency and full use of computer multi-core conditions to realize the function of this module.

[0051] The method provided by the embodiment of the application obtains an initial logic reasoning model through a Markov logic network. In addition, a candidate time sequence logic rule is determined from a time sequence knowledge base through a random walk algorithm. Based on the initial logic reasoning model, the correlation degrees between sample real events and supervised implied events and the candidate time sequence logic rule and the self credibility evaluation of the sample real events and the supervised implied events are calculated to obtain a rule weight of the candidate time sequence logic rule, so that efficient and effective generation of the time sequence logic rule is realized.

[0052] In order to further improve the effectiveness of the time sequence logic rule, based on any one of the above embodiments, a time sequence knowledge base is constructed based on the sample real event and the supervised implied event, including: The credible implied event is screened from the supervised implied event; Based on the entities, relationships and time information in the extracted sample real event and the credible implied event, the time sequence knowledge base is constructed.

[0053] Specifically, first, the credible implied event can be screened from the supervised implied event based on a higher credibility evaluation threshold. For example, the supervised implied event higher than the credibility evaluation threshold can be regarded as the credible implied event. It can be understood that the credibility of the credible implied event is higher than that of the remaining implied events in the supervised implied event.

[0054] Then, the time sequence knowledge base can be constructed according to the entities, relationships and time information in the extracted sample real event and the credible implied event. Any knowledge in the time sequence knowledge base can be represented by a four-tuple (H, R, T, E), where H represents a head entity, R represents a head relation, T represents a time sequence, and E represents a tail entity. )。

[0055] The method provided by the embodiment of the application subdivides a more reliable part of the credible implied event from the supervised implied event, regards it as the missing real event data, and participates in the path construction when the time sequence logic rule is associated with the data, so as to further improve the effectiveness of the time sequence logic rule.

[0056] Based on any one of the above embodiments, the updated implied event is determined based on the candidate time sequence logic rule and the rule weight, including: An unclosed path only supporting the rule body in the candidate time sequence logic rule is searched from the time sequence knowledge base; The head entity of the unclosed path, the time sequence logic rule head and the path tail entity are regarded as a candidate static link; The candidate time sequence logic rules supporting the same candidate static link are merged to obtain a support rule set of the candidate static link; In combination with the preset time window, a support degree evaluation of the candidate static link occurring at each candidate time is calculated based on a distance between an earliest time in each candidate static link corresponding to the support rule set and each candidate time of the candidate static link, and a rule weight of each candidate temporal logic rule in the support rule set. Based on the support degree evaluation, the candidate static link corresponding to each candidate time is sorted, a preset proportion of candidate times is selected, and the candidate static link corresponding to the preset proportion of candidate times is selected to form the updated implicit event.

[0057] Specifically, for each candidate temporal logic rule, a path matching the rule body of the candidate temporal logic rule, i.e., an entity and a relationship sequence, can be searched in the temporal knowledge base. When the entity and the relationship of the path completely match the rule body, and cannot match the temporal logic rule head of the candidate temporal logic rule, the path is taken as a non-closed path of the candidate temporal logic rule. It can be understood that for a single candidate temporal logic rule, multiple non-closed paths can be searched. Using the same method, non-closed paths corresponding to all candidate temporal logic rules are searched.

[0058] Then, the head entity of the non-closed path, the tail entity of the path, and the temporal logic rule head of the corresponding candidate temporal logic rule can be taken as a candidate static link. The candidate static link here can be considered as an implicit event that can occur in a given time window.

[0059] Further, the candidate temporal logic rules supporting the same candidate static link can be merged to obtain a support rule set, so as to realize deduplication of the candidate static link. It should be noted that based on the open world assumption, the updated implicit event can be a real event that is not collected into the knowledge base due to non-disclosure, statistical omission, abnormal loss, etc., and the number of rules supporting an updated implicit event and the credibility reflect the reliability of the implicit event. Then, the support degree evaluation of the candidate static link occurring at each candidate time is calculated by performing path aggregation on the non-closed paths corresponding to each candidate temporal logic rule in the support rule set.

[0060] It should be noted that after determining the candidate static link based on the head entity of the non-closed path, the temporal logic rule head, and the tail entity of the path, the value range of the candidate time is determined according to the constraint , is the maximum time in the path, the value range of . Thus, for a single candidate static link, an accurate time cannot be determined, and a reasonable algorithm is needed to select a suitable time. Thus, a preset time window can be selected within the time distance. The time distance can be determined based on the minimum time on the non-closed path and the maximum time on the non-closed path.

[0061] In detail, the support degree evaluation of the candidate static link occurring at each candidate time can be calculated based on the distance between the earliest time in each candidate static link corresponding to the preset time window and each candidate time of the candidate static link, and the rule weight of each candidate timing logic rule in the support rule set. The support degree evaluation of any candidate static link occurring at any candidate time can be calculated by the following formula, as shown in the following formula:

[0062] In the formula, represents the support degree evaluation of any candidate static link occurring at any candidate time; represents the candidate timing logic rule corresponding to the support rule set of the candidate static link represents the rule weight of the candidate timing logic rule; represents the currently selected time, i.e., the possible occurrence time of the candidate event; represents the size of the time window; represents the minimum time on the path, represents the maximum time on the path.

[0063] It should be noted that the generation scale of the implicit event is very large, most of which do not have utilization value. Based on the support degree evaluation, the candidate static links corresponding to each candidate time are sorted, and a preset proportion of candidate times and candidate static links corresponding to the preset proportion of candidate times are selected to form an updated implicit event. Here, the preset proportion can be set to 10-50 times the amount of sample real event data. Taking the data set ICEWS14 as an example, there are tens of millions of candidate events, and only 2,000,000 of them need to be taken according to the score size.

[0064] Based on any of the above embodiments, in step S3, the supervision implicit event is filtered from the initial implicit event based on the initial credibility evaluation, including: determining an index minimum threshold and a maximum number upper limit; selecting an implicit event with an initial credibility evaluation greater than the index minimum threshold from the initial implicit event as a candidate implicit event; if the number of events of the candidate implicit event exceeds the maximum number upper limit, selecting the maximum number upper limit of the candidate implicit event as the supervision implicit event.

[0065] ​Specifically, the minimum threshold and the maximum upper limit of the index can be preset. Then, the initial implicit events can be ranked in descending order according to the initial credibility evaluation, and the implicit events with the initial credibility evaluation greater than the minimum threshold are selected as candidate implicit events. For example, the implicit events lower than the minimum threshold can be filtered to obtain the candidate implicit events.

[0066] It should be noted that the number of the candidate implicit events after screening can still be large, and in order to improve the training efficiency, the candidate implicit events can be selected as the supervised implicit events when the number of the candidate implicit events exceeds the maximum upper limit. For example, the candidate implicit events with low initial credibility evaluation can be filtered to retain the candidate implicit events with high initial credibility evaluation and meeting the maximum upper limit. It can be understood that when the number of the candidate implicit events does not exceed the maximum upper limit, all the candidate implicit events can be selected as the supervised implicit events.

[0067] Similarly, for step S4, the augmented implicit events can be selected from the supervised implicit events based on the expected value of the supervised implicit events, and the same method as described above can be used to select the augmented implicit events from the supervised implicit events by determining the minimum threshold and the maximum upper limit of the index for screening the expected value.

[0068] In an embodiment, the minimum threshold of the index and the maximum upper limit , R and N represent real numbers. First, the entries in the content to be screened whose evaluation index is lower than are deleted, and then the remaining entries are ranked in descending order of the evaluation index. The screening evaluation index of the implicit event data containing the credibility evaluation is the evaluation value given by the initial neural network prediction model in the previous step, and the screening evaluation index of the implicit event data based on the credibility expectation value is the expected value given by the time sequence logic rule. If the number of the remaining entries is greater than , at most entries at the top are retained; wherein the supervised implicit event data containing the credibility evaluation need to be divided into a subset (credible implicit events) , and the minimum threshold and and the maximum number limit and are set for them respectively; wherein and . In addition, for the implicit event data based on the expected value , only one minimum threshold and one maximum number limit , and has . The value of can refer to the number of real events of the used sample , . Taking the ICEWS14 dataset as an example, can be taken ; the number of real data train part used for model training is 72826, and the square root of the number is taken and rounded as , that is ; accordingly, .

[0069] Based on any of the above embodiments, the time sequence knowledge graph prediction model is obtained, and then includes: obtaining a test real event; inputting the test real event into the time sequence knowledge graph prediction model to obtain a logical reasoning prediction result output by the logical reasoning model and a neural network prediction result output by the neural network prediction model; based on the prediction weight, performing weighted calculation on the logical reasoning prediction result and the neural network prediction result to obtain a comprehensive prediction result.

[0070] Specifically, the test set obtained by dividing the initial real event can be taken as the test real event for testing the trained time sequence knowledge graph model. The testing process includes: first, inputting the test real event into the time sequence knowledge graph prediction model, i.e. inputting the test real event into the logical rule reasoning model and the neural network prediction model in the time sequence knowledge graph prediction model respectively, to obtain a logical reasoning prediction result output by the logical reasoning model and a neural network prediction result output by the neural network prediction model respectively.

[0071] Then, the prediction weight corresponding to the logical reasoning prediction result and the neural network prediction result can be obtained, and the logical reasoning prediction result and the neural network prediction result are weighted calculated, and the event with the highest score calculated is taken as the comprehensive prediction result.

[0072] Here, the calculation of the comprehensive prediction result can be realized by the following formula, as shown in the following formula:

[0073] In the formula, denotes the comprehensive prediction result; denotes the prediction weight of the logical reasoning prediction result; denotes the logical reasoning prediction result; denotes the prediction weight of the neural network prediction result; denotes the neural network prediction result.

[0074] In an embodiment, taking the ICEWS14 dataset as an example, the prediction weight can be segmented as follows:

[0075] It should be noted that the prediction weight can be segmented in a stepwise manner, and the segmentation manner can be adjusted according to different datasets used to obtain the optimal result.

[0076] It can be understood that the time sequence knowledge graph prediction model trained by the above-mentioned collaborative method can improve the prediction effect of a single logical rule reasoning model and a neural network prediction model, so that the accuracy and effectiveness of the final comprehensive prediction result are obviously improved.

[0077] In an embodiment, the neural network prediction result output by the neural network prediction model can be realized by the following steps, Figure 2 is a flowchart of the prediction of the neural network prediction model provided by the present application, as Figure 2 shown, the method comprises: For the request event , that is, based on the entity e and the relationship r and the occurrence time e corresponding to the entity , the entity “ e ” related to the entity is predicted. Wherein, the events related to compose a sequence , which can be expressed as , wherein can be a head entity or a tail entity; is used to limit the number of adjacent events. Thus, by performing semantic coding on each related event entity of the request event, and adding some special tokens such as and , the semantic embedding and the position embedding are coded. For example, the semantic embedding ( , , , ) and the position embedding ( , , , ) of the entity 1, the relationship 1 and are coded. After splicing, they are alternately input into the Transformer-based Core Unit to synthesize a triple embedding , including ; and then through a multi-layer perception hybrid unit (MLP-based Core Unit), a final unified embedding representation is obtained . Then, the unified embedding representation is output through a fully connected layer to obtain a neural network prediction result. Taking the ICEWS14 dataset as an example, the embedding representation length can be set to 320, and the maximum length limit of the event sequence is 50.

[0078] In the training process of the initial neural network prediction model, the optimizer adopts Adamax, the learning rate is 0.01, the warmup mechanism is adopted, the warmup ratio is 0.1, the activation function adopts gelu, and the loss function uses KL divergence; wherein the training rounds can be set according to the accuracy requirement, and can be any integer between [50, 1000], here we take {100, 300} two values, which can meet the experimental requirements under two accuracy settings.

[0079] Figure 3 is a structural schematic diagram of the Transformer unit of the neural network prediction model provided by the application, as shown in Figure 3 , the module comprises: The artificial neural network model comprises a plurality of such core units, each of which is alternately composed of a multi-head attention layer, a normalization layer (Add&Norm) and a feedforward layer. The multi-head attention layer and the feedforward layer both lead to a layer normalization operation with a residual connection; the feedforward layer is composed of two layers with gelu nonlinear activation function.

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

[0081] Figure 4 is a structural schematic diagram of the multi-layer perception hybrid unit of the neural network prediction model provided by the application, as shown in Figure 4 : The neural network prediction model comprises a plurality of core units, and an input of each core unit is a two-dimensional truth value matrix M formed by k+1 embedding representations, M belongs to R^((1+k)×d). Each core unit comprises two mixed layers: a Channel MLP and a Patch MLP, and the Channel MLP and the Patch MLP are respectively provided with a layer normalization operation (Layer Norm) and a transposition operation. The Channel MLP takes a column of M as an input, and the purpose is to promote information interaction between event embedding in the same feature dimension; and the Patch MLP acts on a row of M, and the purpose is to promote information interaction between different feature dimensions in the same event embedding.

[0082] The artificial neural network model can be implemented by using a PyTorch framework, which provides rich basic implementations of tensor processing, data loading, artificial neural network modules, optimizers, loss functions and the like, and can improve the construction and test efficiency of the model; by cooperating with a CUDA (Compute Unified Device Architecture) technology, the GPU stream processor can be fully utilized, and a multi-GPU environment can be supported, so that the neural network model requirement of massive floating point operation can be met.

[0083] The time sequence knowledge graph prediction method provided by the embodiment of the application involves a large amount of data preprocessing, post-processing, module interaction and the like, and an effective means is needed to organize these complex data operations and heterogeneous models. In a Unix environment, a shell script has rich functions and is easy to use, and can be used to realize organization, arrangement and debugging of the entire task framework; and a python script can flexibly realize various data processing.

[0084] Based on any one of the above embodiments, Figure 5 is a structural schematic diagram of a training device of a time sequence knowledge graph prediction model provided by the application, as Figure 5 shown, the device comprises: An acquisition unit 510 acquires sample real events, an initial logical reasoning model and an initial neural network prediction model. A starting unit 520 inputs the sample real events into the initial logical reasoning model to obtain output initial implicit events, and inputs the initial implicit events into the initial neural network prediction model to obtain an initial credibility evaluation of the initial implicit events. The logic reasoning model training unit 530 filters supervision implicit events from the initial implicit events based on the initial credibility evaluation; inputs the sample real events and the supervision implicit events into the initial logic reasoning model to obtain a time sequence logic rule and an updated implicit event, and calculates an expected value for the supervision implicit event by using the time sequence logic rule; The neural network training unit 540 filters expansion implicit events from the supervision implicit events based on the expected value of the supervision implicit events; inputs the sample real events, the expansion implicit events and the updated implicit events into the initial neural network prediction model to obtain an updated credibility evaluation of the updated implicit events; The iteration unit 550 takes the updated credibility evaluation as the initial credibility evaluation of the next round, takes the updated implicit events as the initial implicit events of the next round, repeatedly executes the logic reasoning model training unit and the neural network training unit until the number of cycles meets a preset cycle condition, and takes the logic reasoning model and the neural network prediction model obtained in the last round as a time sequence knowledge graph prediction model.

[0085] The device provided by the embodiment of the application improves the learning effect of the logic reasoning model by using the implicit data mining capability of the logic reasoning model constructed based on the time sequence logic rule, taking the neural network prediction model with the feature expression capability advantage as a link, scoring the credibility evaluation of the implicit data, and providing additional supervision information for the logic reasoning model. In turn, the logic reasoning model provides more reliable expansion implicit events for the artificial neural network prediction model by using the optimized model parameters, thereby optimizing the parameters 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 using a single logic reasoning model or a neural network prediction model, the accuracy and effectiveness of the time sequence knowledge graph prediction can be significantly improved.

[0086] According to any of the above embodiments, the time sequence logic rule includes a candidate time sequence logic rule and a rule weight of the candidate time sequence logic rule. The logic reasoning model training unit is specifically configured to: construct a time sequence knowledge base based on the sample real events and the supervision implicit events; determine a candidate time sequence logic rule from the time sequence knowledge base based on a random walk algorithm; calculate the rule weight of the candidate time sequence logic rule based on the initial logic reasoning model, the correlation between the sample real events and the supervision implicit events and the candidate time sequence logic rule, and the credibility evaluation of the sample real events and the supervision implicit events. determine the updated implicit event based on the candidate temporal logic rule and the rule weight; The initial logic inference model is constructed based on a Markov logic network.

[0087] Based on any of the above embodiments, the logic inference model training unit is further configured to: filtering trusted implicit events from the supervised implicit events; constructing the temporal knowledge base based on the entities, relationships and time information in the extracted sample real events and the trusted implicit events.

[0088] Based on any of the above embodiments, the logic inference model training unit is further configured to: searching for non-closed paths that only support the rule body of the candidate temporal logic rule from the temporal knowledge base; taking the head entity of the non-closed path, the head of the temporal logic rule, and the tail entity of the path as a candidate static link; merging candidate temporal logic rules that support the same candidate static link to obtain a support rule set of the candidate static link; 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 temporal logic rule in the support rule set, calculating the support degree evaluation of the candidate static link at each candidate time; based on the support degree evaluation, sorting the candidate static link corresponding to each candidate time, selecting a preset proportion of candidate time and the candidate static link corresponding to the preset proportion of candidate time, to form the updated implicit event.

[0089] Based on any of the above embodiments, the logic inference model training unit is further configured to: determine an index minimum threshold and a maximum number upper limit; selecting implicit events with an initial credibility evaluation greater than the index minimum threshold from the initial implicit events as candidate implicit events; in the case where the number of candidate implicit events exceeds the maximum number upper limit, selecting the maximum number upper limit of candidate implicit events as the supervised implicit events.

[0090] Based on any of the above embodiments, the iteration unit further comprises a test unit, and the test unit is specifically configured to: obtain test real events; input the test real event into the time sequence knowledge graph prediction model, obtain a logical reasoning prediction result output by the logical reasoning model, and a neural network prediction result output by the neural network prediction model; Based on the prediction weight, the logical reasoning prediction result and the neural network prediction result are weighted and calculated to obtain a comprehensive prediction result.

[0091] Figure 6 An example of an entity structure diagram of an electronic device is shown as Figure 6 As shown, the electronic device can include a processor (processor) 610, a communication interface (communications interface) 620, a memory (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 invoke the logical instructions in the memory 630 to execute the training method of the time sequence knowledge graph prediction model, which includes: step S1, obtaining a sample real event, an initial logical reasoning model, and an initial neural network prediction model; 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 initial credibility evaluation of the initial implicit event; step S3, based on the initial credibility evaluation, filtering a supervised implicit event from the initial implicit event; inputting the sample real event and the supervised implicit event into the initial logical reasoning model to obtain a time sequence logical rule and an updated implicit event, and calculating an expected value for the supervised implicit event using the time sequence logical rule; step S4, based on the expected value of the supervised implicit event, filtering an expanded implicit event from the supervised 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; 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 reasoning model and the neural network prediction model obtained in the last round as the time sequence knowledge graph prediction model.

[0092] Further, the logic instructions in the memory 630 described above can be implemented in the form of software functional units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0093] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program can be executed by a processor, so that the computer can execute the training method of the time sequence knowledge graph prediction model provided by the above-mentioned method. The method comprises the following steps: step S1, obtaining a sample real event, an initial logical reasoning model and an initial neural network prediction model; 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; step S3, based on the initial credibility evaluation, screening a supervised implicit event from the initial implicit event; inputting the sample real event and the supervised implicit event into the initial logical reasoning model to obtain a time sequence logical rule and an updated implicit event, and calculating an expected value for the supervised implicit event using the time sequence logical rule; step S4, based on the expected value of the supervised implicit event, screening an expanded implicit event from the supervised 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; 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 reasoning model and the neural network prediction model obtained in the last round as the time sequence knowledge graph prediction model.

[0094] In yet another aspect, the present application also provides a non-transitory computer-readable storage medium having stored thereon a computer program, which, when executed by a processor, implements a training method of a time-series knowledge graph prediction model provided by each of the above methods, the method comprising: step S1, obtaining a sample real event, an initial logical reasoning model and an initial neural network prediction model; 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 initial credibility evaluation of the output initial implicit event; step S3, based on the initial credibility evaluation, screening a supervised implicit event from the initial implicit event; inputting the sample real event and the supervised implicit event into the initial logical reasoning model to obtain a time-series logical rule and an updated implicit event, and calculating an expected value for the supervised implicit event using the time-series logical rule; step S4, based on the expected value of the supervised implicit event, screening an expanded implicit event from the supervised 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; 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 reasoning model and the neural network prediction model obtained in the last round as the time-series knowledge graph prediction model.

[0095] The device embodiments described above are merely illustrative, wherein the units illustrated as separate components can or can not be physically separated, and the components illustrated as units can or can not be physical units, i.e., can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0096] From the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of software and necessary general hardware platforms, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0097] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features therein can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A training method for a time-series knowledge graph prediction model, characterized in that, The method comprises the following steps: Step S1, obtaining 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 initial implicit events; Step S3, based on the initial credibility evaluation, screening supervision implicit events from the initial implicit events; inputting the sample real events and the supervision implicit events into the initial logical reasoning model to obtain time sequence logical rules and updated implicit events, and calculating an expected value of the supervision implicit events by using the time sequence logical rules; Step S4, based on the expected value of the supervision implicit events, screening expansion implicit events from the supervision implicit events; inputting the sample real events, the expansion implicit events, and the updated implicit events into the initial neural network prediction model to obtain an updated credibility evaluation of the updated implicit events; Step S5, taking the updated credibility evaluation as the initial credibility evaluation of the next round, taking the updated implicit events as the initial implicit events of the next round, repeating steps S3 and S4 until the number of cycles meets a preset cycle condition, and taking the logical reasoning model and the neural network prediction model obtained in the last round as a time sequence knowledge graph prediction model. 2.The method of Claim 1, wherein, The time sequence logical rules comprise candidate time sequence logical rules and rule weights of the candidate time sequence logical rules; The inputting of the sample real events and the supervision implicit events into the initial logical reasoning model to obtain time sequence logical rules and updated implicit events comprises: constructing a time sequence knowledge base based on the sample real events and the supervision implicit events; determining candidate time sequence logical rules from the time sequence knowledge base based on a random walk algorithm; calculating, based on the initial logical reasoning model, an association degree between the sample real events and the supervision implicit events and the candidate time sequence logical rules and a self-credibility evaluation of the sample real events and the supervision implicit events, to obtain rule weights of the candidate time sequence logical rules; determining the updated implicit events based on the candidate time sequence logical rules and the rule weights; The initial logical reasoning model is constructed based on a Markov logic network. 3.The method of Claim 2, wherein, The constructing of the time sequence knowledge base based on the sample real events and the supervision implicit events comprises: screening credible implicit events from the supervision implicit events; constructing the time sequence knowledge base based on extracted entities, relationships, and time information in the sample real events and the credible implicit events. 4.The method of Claim 2, wherein, The determining of the updated implicit events based on the candidate time sequence logical rules and the rule weights comprises: searching for a non-closed path that only supports a rule body in the candidate time sequence logical rules from the time sequence knowledge base; taking a head entity, a time sequence logical rule head, and a path tail entity of the non-closed path as a candidate static link. merge candidate temporal logic rules supporting the same candidate static link to obtain a support rule set of the candidate static link; combine the preset time window, 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 temporal logic rule in the support rule set, to calculate the support degree evaluation of the candidate static link at each candidate time; based on the support degree evaluation, sort the candidate static link corresponding to each candidate time, select a preset proportion of candidate time, and the candidate static link corresponding to the preset proportion of candidate time, to form the updated implicit event. 5.The method of Claim 1-4, wherein, The supervision implicit event is filtered from the initial implicit event based on the initial credibility evaluation, which includes: determining an index minimum threshold and a maximum number upper limit; selecting an implicit event with an initial credibility evaluation greater than the index minimum threshold from the initial implicit event as a candidate implicit event; if the number of candidate implicit events exceeds the maximum number upper limit, select the maximum number upper limit of candidate implicit events as the supervision implicit event. 6.The method of Claim 1-4, wherein, obtaining the time sequence knowledge graph prediction model, which includes: obtaining a test real event; inputting the test real event into the time sequence knowledge graph prediction model to obtain a logic reasoning prediction result output by the logic reasoning model and a neural network prediction result output by the neural network prediction model; based on a prediction weight, performing weighted calculation on the logic reasoning prediction result and the neural network prediction result to obtain a comprehensive prediction result. 7.A device for training a temporal knowledge graph prediction model, characterized in that, It includes: an acquisition unit that acquires a sample real event, an initial logic reasoning model, and an initial neural network prediction model; an activation unit that inputs the sample real event into the initial logic reasoning model to obtain an initial implicit event output by the initial logic reasoning model; inputting the initial implicit event into the initial neural network prediction model to obtain an initial credibility evaluation of the initial implicit event output by the initial neural network prediction model; a logic reasoning model training unit that filters a supervision implicit event from the initial implicit event based on the initial credibility evaluation; inputting the sample real event and the supervision implicit event into the initial logic reasoning model to obtain a time sequence logic rule and an updated implicit event, and calculating an expected value for the supervision implicit event using the time sequence logic rule; a neural network training unit that filters an expanded implicit event from the supervision implicit event based on the expected value of 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; The iteration unit repeats execution of the logical inference model training unit and the neural network training unit until a preset loop condition is met, taking the updated credibility evaluation as the initial credibility evaluation of the next round and taking the updated implicit event as the initial implicit event of the next round, 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.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the training method of the time sequence knowledge graph prediction model according to any one of claims 1 to 6 when executing the computer program. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the training method of the time sequence knowledge graph prediction model according to any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the training method of the time sequence knowledge graph prediction model according to any one of claims 1 to 6. The computer program is executed by the processor to implement the training method of the time sequence knowledge graph prediction model according to any one of claims 1 to 6.

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

  • Multilingual event causality identification method and system based on meta-learning with knowledge

    US20250036969A1