Active link prediction method based on knowledge rule guidance

By using knowledge rules to guide sample selection and model training in the active link prediction task, and combining information entropy and rule uncertainty, the process of knowledge graph completion is optimized, and the problems of slow convergence speed and high training cost in the existing technology are solved. , achieving a more efficient link prediction effect.

CN118569371APending Publication Date: 2024-08-30SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410727316.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The existing active link prediction task has slow convergence speed and high training cost in the knowledge graph, and does not effectively utilize the logical rule information in the knowledge graph, which limits the link prediction effect.

Method used

Adopt an active link prediction method based on knowledge rule guidance, guide sample selection and model training through logical rules, combine information entropy uncertainty and rule uncertainty, screen high-quality training samples and update the rule set, optimizing the training process of the link prediction model .

Benefits of technology

It improves the accuracy and efficiency of link prediction, makes full use of the rule information in the knowledge graph, provides more reliable data protection and inference basis, and improves the performance of knowledge graph completion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569371A
    Figure CN118569371A
Patent Text Reader

Abstract

The invention relates to an active link prediction method based on knowledge rule guidance, belongs to the field of link prediction, and guides two links of sample selection and model training through logic rules. In a sample selection link, a rule-based uncertainty sampling method is adopted, and information entropy uncertainty is combined, so that high-quality training samples rich in rule information and semantic information are screened out. In a model training link, rules and semantic information in a training set are fully utilized by utilizing rule information, so that a link prediction effect is improved. Comprising the steps of obtaining and processing knowledge graph data, obtaining an initial training set and a rule set, training a link prediction model, calculating information entropy uncertainty and rule uncertainty of an unlabeled sample, selecting a high-uncertainty sample for manual labeling by combining the information entropy uncertainty and the rule uncertainty, and finally updating the training set and the rule set. According to the method, mutual forward promotion of a sample selection link and a model training link can be realized, and an excellent prediction effect is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an active link prediction method based on knowledge rule guidance, belonging to the technical field of link prediction. Background Art

[0002] Knowledge graphs represent the relationships between entities in the real world in a structured form. Due to their ability to effectively manage and apply massive, heterogeneous data, they have been increasingly widely used in intelligent search, deep question-answering, and other vertical industry fields in recent years. However, knowledge graphs usually have integrity issues, which means that they can only describe some facts and knowledge in the real world, limiting the performance and practicality of related applications. Knowledge graph completion aims to obtain new knowledge through reasoning and prediction based on existing facts in the knowledge graph, and is an effective means to solve the integrity problem. Knowledge graph completion can be converted into a link prediction task: since a piece of knowledge is represented by a fact triple (head entity, relationship, tail entity) in the knowledge graph, and link prediction can complete the missing elements in the triple, this task can achieve the purpose of completing new knowledge.

[0003] However, the link prediction task needs to deal with a large amount of knowledge stored in the knowledge graph, and there is no lack of knowledge with low probability of validity or unreasonable knowledge, which leads to the problem of slow convergence and high training cost in the usual link prediction task. Some scholars use active learning (also known as query learning) to deal with link prediction tasks, that is, active link prediction, which has alleviated the above problems to a large extent. The existing active link prediction mainly obtains candidate samples through uncertainty sampling based on information entropy. Although it does have better performance and can screen out samples with a large degree of uncertainty for the current model, it is highly dependent on the model and the distribution of the selected sample set is poorly representative, which limits the final link prediction effect.

[0004] There are a large number of logical rules in the knowledge graph, which can formally describe the laws and patterns of facts. For example, "If A is the capital of B, it can be inferred that A is in B" is a very simple rule. These rules contain a lot of semantic and structural information, and have played a valuable role in the field of traditional link prediction, but have not been effectively and explicitly used in the field of active link prediction. Summary of the invention

[0005] In response to the above problems, the present invention provides an active link prediction method based on knowledge rule guidance, which uses logical rules to guide the sample selection and model training stages of active learning at the same time. Through the present invention, high-quality training sets containing rich rules and semantic information and of great value to the model can be gradually expanded, and a high-precision link prediction model that fully fits the sample and rule information can be obtained, providing reliable data guarantee and inference basis for other upper-layer applications based on knowledge graphs.

[0006] The technical solution of the present invention is as follows:

[0007] An active link prediction method based on knowledge rule guidance includes the following steps:

[0008] Step 1: Obtain an incomplete knowledge graph that needs to be completed through link prediction;

[0009] Step 2: Reprocess the data representation format of the target knowledge graph and convert the knowledge in the target knowledge graph into triples (head entity, relationship, tail entity); at the same time, divide all the knowledge into unlabeled sample sets G unlabeled , validation set G valid and the test set G test ;

[0010] Step 3: Obtain the training set G for the initial stage of active learning train and the rule set R train , and are ready to start active learning;

[0011] Step 4: Use the training set and the rule set to train the link prediction model M and update the parameter θ of the link prediction model. At the same time, determine whether the current link prediction model M has converged. If so, end the entire process. If not, continue to step 5.

[0012] In step 4, there is no special restriction on the type of link prediction model, which can be a deep learning model or a general shallow model, but it is required that the model M must use both the training set and the rule set to update the relevant parameters during training.

[0013] The prediction model M is preferably a deep learning model ConvE and a shallow model KALE.

[0014] Step 5: Calculate the information entropy uncertainty of each sample in the unlabeled sample set

[0015] Step 6: Calculate the rule uncertainty ω(h,r,t) of each sample in the unlabeled sample set;

[0016] Step 7: Combine the information entropy uncertainty and rule uncertainty to obtain the final uncertainty size τ(h,r,t) of the unlabeled sample;

[0017] Step 8: Select some unlabeled samples with the largest uncertainty size τ(h,r,t) for manual labeling to supplement the training set, and then use the updated training set to update the rule set. At the same time, determine whether the current training set size has reached the upper limit. If so, end the entire process. If not, return to step 4.

[0018] The present invention aims to optimize the link prediction effect in the knowledge graph, and guides the two major links of sample selection and model training through logical rules. In the sample selection link, a rule-based uncertainty sampling method is adopted, combined with information entropy uncertainty, to screen out high-quality training samples rich in rule information and semantic information. In the model training link, rule information is used to make full use of the rules and semantic information in the training set, thereby improving the link prediction effect. The specific process includes acquiring and processing knowledge graph data, obtaining an initial training set and a rule set, training a link prediction model, and calculating the information entropy uncertainty and rule uncertainty of unlabeled samples, combining the two to select high-uncertainty samples for manual labeling, and finally updating the training set and rule set. This method can achieve mutual positive promotion of the sample selection link and the model training link, and achieve excellent prediction results.

[0019] Preferably, the knowledge graph in step 1 can be obtained by directly downloading from a public website or constructing it according to relevant information sources. The knowledge graph in step 1 can be a general knowledge graph or a domain knowledge graph; and due to the characteristic of active learning to process large amounts of data, there is no specific restriction on the size of the knowledge graph.

[0020] Preferably, in step 2, a triple in the form of RDF (Resource Description Framework), i.e., head entity, relationship, tail entity, or subject, predicate, object, which are derived from different understandings but have the same form) is used to describe a single piece of knowledge. unlabeled , validation set G valid and the test set G test All are in the form of triplets.

[0021] It is worth noting that there are only two types of labels for a single sample (i.e., a triple): positive label and negative label, where a positive label indicates that the knowledge represented by the current sample is reasonable and has a high probability of being established, and a negative label means the opposite of a positive label. At the same time, since the link prediction model only accepts positive label samples, in the manual labeling stage of active learning, the present invention adds the labeled positive label samples to the training set, and directly filters out the negative label samples.

[0022] Preferably, in step 3, the initial training set G train By using the unlabeled sample set G unlabeledThe initial rule set R train Obtained by extracting rules from the training set;

[0023] Rule extraction is achieved through AMIE (Association Rule Mining in Incomplete Knowledge Base). First, the head coverage and PCA confidence are calculated, and the rules whose head coverage and PCA confidence are lower than the specified threshold are filtered out.

[0024] Preferably, the calculation formula for the head coverage is as follows:

[0025]

[0026] Where K represents the current knowledge base, which contains all currently known knowledge triples. Represents a rule, r(x,y) is the head atom, B is the body atom, support() indicates that the rule is satisfied A set of triples, (x, y) represents the combination of the head entity x and the tail entity y of any triple;

[0027] The head coverage rate means the ratio of the number of correct instances that can be inferred by the current rule to the total number of instances of the head atom in K, which expresses the coverage ability of the rule in the current knowledge base;

[0028] The calculation formula of PCA confidence is as follows:

[0029]

[0030] The PCA confidence describes the credibility of the rule. In its calculation formula, the numerator is the number of correct instances that can be inferred from the current rule, and the denominator is the total number of instances of the head atom, including known correct instances in K and counterexamples generated based on partial complete hypotheses, where r(x,y′) represents a counterexample triple constructed based on the triple r(x,y) using tail entity replacement, and y′ represents any other tail entity different from the tail entity y.

[0031] Preferably, the specified threshold for head coverage is 0.5, and the specified threshold for PCA confidence is 0.5.

[0032] Preferably, in step 5, the information entropy uncertainty of the sample is calculated according to the Shannon information entropy formula The formula is as follows:

[0033]

[0034] Among them, p(y=i|(h,r,t),G train) refers to the possibility that the current sample (h, r, t) label is i (i belongs to 1 or 0). This value is usually obtained by the link prediction model M, and the way to obtain this value varies greatly depending on the link prediction model M.

[0035] When the link prediction model M is a deep learning model, the neural network is viewed from a Bayesian perspective, and Monte Carlo Drop is applied during the model prediction process to obtain the model's estimated value of the probability of sample label establishment. The average size of this estimated value is taken as the actual probability size of the sample label establishment. The principle is:

[0036]

[0037] in Represents the parameters of the current deep learning model, Indicated by the parameter The probability that the label of the sample (h, r, t) is i under the determined current model; Represents the posterior of the model parameters relative to the true The variational distribution that minimizes the KL divergence (considering that the variational distribution is not easy to calculate directly in practical applications, it can be calculated by sampling method Approximate value of ); T represents the maximum number of sampling times, which is generally set to 100; Indicates from The model parameters obtained by multiple sampling are used to approximate the model parameters; Indicated by the parameter The probability that the label of a sample (h, r, t) is i under a certain model; the formula estimates the true probability through variational inference and Monte Carlo Drop to obtain the approximate value of the probability of each label being true;

[0038] When the link prediction model M is a shallow model, a truth mapping function is added to the output of the shallow model to artificially convert the output of the shallow model into the probability of the sample label being established:

[0039] p(y=i|(h,r,t),G train )=If θ ((h,r,t)) /

[0040] where f θ ((h,r,t)) represents the sample processing process of the shallow model, and I() represents the true value mapping function, which is responsible for mapping the original output result to the real number domain between [0,1] to make it the probability of the sample label being true.

[0041] Preferably, in step 6, the formula for calculating the rule uncertainty ω(h,r,t) is:

[0042]

[0043] where p(y=1|(h,r,t),G train ) represents the probability of the current sample being established, which provides relevant information of the model for the formula, R train represents the rule set, ρ(R|G train ) represents the confidence of rule R, It represents the change in the confidence of rule R before and after (h, r, t) is added to the training set. The calculation formula is:

[0044]

[0045] The present invention quantifies the impact of samples on rules by calculating the change in confidence of rules before and after samples are added to the training set, and thereby obtains the main components of the uncertainty of the assumed rules. In addition, the present invention uses confidence to weight different rules, which shifts the focus to high-confidence, high-quality rules, making the evaluation results more reasonable.

[0046] Preferably, in step 7, normalization is first performed, and the formula is as follows:

[0047]

[0048] Where X max and X min They refer to the maximum and minimum values ​​of the information entropy uncertainty or rule uncertainty of each sample in the unlabeled sample set, X and X norm They refer to the information entropy uncertainty or rule uncertainty values ​​before and after normalization of each sample, respectively;

[0049] Then the final uncertainty size τ(h,r,t) is calculated:

[0050]

[0051] Among them, α is a balance factor, which is used to balance the influence between information entropy and rule uncertainty, and the value of α is 0.5.

[0052] Preferably, in step 8, candidate samples (h, r, t) are obtained according to the acquisition function * , the training set and rule set will be updated after manual annotation, and the acquisition function is:

[0053]

[0054] The number of training samples added each time in the sample selection phase depends on the size of the entire unlabeled sample set. If the size of the training set reaches the specified number or the link prediction model has converged, the active link prediction process can be terminated.

[0055] The main feature of the present invention is to use the logical rules in the knowledge graph to guide the two major links of sample selection and model training of active link prediction, so as to achieve better link prediction effect.

[0056] In the sample selection link, the present invention proposes a rule-based uncertainty sampling method, which performs sampling based on the following assumptions: if a sample can have a greater impact on the rule, it contains more rule information, that is, it has a greater rule uncertainty. Therefore, the impact of the sample to be evaluated (fact triplet) on the existing rule set is quantitatively described through relevant formulas, and is used as a key factor in determining the size of rule uncertainty. In this way, the rule-based uncertainty sampling algorithm can effectively evaluate and screen out samples with large rule uncertainty, that is, samples rich in rule information. At the same time, in order to better utilize model information, it is proposed to combine uncertainty sampling based on information entropy and uncertainty sampling based on rules, and the two jointly select the final candidate samples to obtain high-quality training samples that contain rich rules and semantic information and are of great value to the model.

[0057] In the model training stage, the present invention proposes and confirms the importance of explicitly utilizing rule information in the training algorithm under the rule-based active link prediction framework. In this way, the rich rules and semantic information in the training set can be fully utilized, and the sample selection stage and the model training stage can promote each other positively, thereby achieving a better active link prediction effect.

[0058] For any details not provided in the present invention, please refer to the prior art.

[0059] The beneficial effects of the present invention are:

[0060] In response to the problem that the link prediction task in the context of active learning does not effectively utilize the rule information in the knowledge graph, the present invention proposes a rule-based active link prediction framework, which uses logical rules to simultaneously guide the sample selection and model training stages of active learning, thereby achieving the purpose of making full use of rule information and improving the link prediction effect, with excellent performance and practical feasibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The drawings in the specification, which constitute a part of the present application, are used to provide further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.

[0062] Figure 1It is a flow chart of the active link prediction method based on knowledge rule guidance of the present invention;

[0063] Figure 2 It is a schematic diagram of the overall structure of the present invention. DETAILED DESCRIPTION

[0064] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of the present invention are clearly and completely described below in conjunction with the drawings in the implementation of this specification, but are not limited to this. Anything not fully described in the present invention shall be based on the conventional technology in the art.

[0065] Example 1

[0066] An active link prediction method based on knowledge rule guidance, such as Figure 1 As shown, the following steps are included:

[0067] Step 1: Download directly from a public website the incomplete knowledge graph that needs to be completed through link prediction;

[0068] Step 2: Reprocess the data representation format of the target knowledge graph and convert the knowledge in the target knowledge graph into triples (head entity, relationship, tail entity); at the same time, divide all the knowledge into unlabeled sample sets G unlabeled , validation set G valid and the test set G test ;

[0069] Step 3: Obtain the training set G for the initial stage of active learning train and the rule set R train , and are ready to start active learning;

[0070] The initial training set G train By using the unlabeled sample set G unlabeled The initial rule set R train Obtained by extracting rules from the training set;

[0071] Rule extraction is achieved through AMIE (Association Rule Mining in Incomplete Knowledge Base). First, the head coverage and PCA confidence are calculated, and the rules whose head coverage and PCA confidence are lower than the specified threshold are filtered out.

[0072] The calculation formula for head coverage is as follows:

[0073]

[0074] Where K represents the current knowledge base, which contains all currently known knowledge triples. Represents a rule, r(x,y) is the head atom, B is the body atom, support() indicates that the rule is satisfied A set of triples, (x, y) represents the combination of the head entity x and the tail entity y of any triple;

[0075] The head coverage rate means the ratio of the number of correct instances that can be inferred by the current rule to the total number of instances of the head atom in K, which expresses the coverage ability of the rule in the current knowledge base;

[0076] The calculation formula of PCA confidence is as follows:

[0077]

[0078] The PCA confidence describes the credibility of the rule. In its calculation formula, the numerator is the number of correct instances that can be inferred from the current rule, and the denominator is the total number of instances of the head atom, including known correct instances in K and counterexamples generated based on partial complete hypotheses, where r(x,y′) represents a counterexample triple constructed based on the triple r(x,y) using tail entity replacement, and y′ represents any other tail entity different from the tail entity y.

[0079] The specified threshold for head coverage is 0.5 and the specified threshold for PCA confidence is 0.5.

[0080] Step 4: Use the training set and the rule set to train the link prediction model M and update the parameter θ of the link prediction model. At the same time, determine whether the current link prediction model M has converged. If so, end the entire process. If not, continue to step 5.

[0081] Step 5: Calculate the information entropy uncertainty of each sample in the unlabeled sample set

[0082] Calculate the information entropy uncertainty of the sample according to Shannon's information entropy formula The formula is as follows:

[0083]

[0084] Among them, p(y=i|(h,r,t),G train ) refers to the possibility that the current sample (h, r, t) label is i (i belongs to 1 or 0). This value is usually obtained by the link prediction model M, and the way to obtain this value varies greatly depending on the link prediction model M.

[0085] When the link prediction model M is a deep learning model, the neural network is viewed from a Bayesian perspective, and Monte Carlo Drop is applied during the model prediction process to obtain the model's estimated value of the probability of sample label establishment. The average size of this estimated value is taken as the actual probability size of the sample label establishment. The principle is:

[0086]

[0087] in Represents the parameters of the current deep learning model, Indicated by the parameter The probability that the label of the sample (h, r, t) is i under the determined current model; Represents the posterior of the model parameters relative to the true The variational distribution that minimizes the KL divergence (considering that the variational distribution is not easy to calculate directly in practical applications, it can be calculated by sampling method Approximate value of ); T represents the maximum number of sampling times, which is generally set to 100; Indicates from The model parameters obtained by multiple sampling are used to approximate the model parameters; Indicated by the parameter The probability that the label of a sample (h, r, t) is i under a certain model; the formula estimates the true probability through variational inference and Monte Carlo Drop to obtain the approximate value of the probability of each label being true;

[0088] When the link prediction model M is a shallow model, a truth mapping function is added to the output of the shallow model to artificially convert the output of the shallow model into the probability of the sample label being established:

[0089] p(y=i|(h,r,t),G train )=If θ ((h,r,t)) /

[0090] where f θ ((h,r,t)) represents the sample processing process of the shallow model, and I() represents the true value mapping function, which is responsible for mapping the original output result to the real number domain between [0,1] to make it the probability of the sample label being true.

[0091] Step 6: Calculate the rule uncertainty ω(h,r,t) of each sample in the unlabeled sample set;

[0092] The formula for calculating rule uncertainty ω(h,r,t) is:

[0093]

[0094] where p(y=1|(h,r,t),G train ) represents the probability of the current sample being established, which provides relevant information of the model for the formula, R train represents the rule set, ρ(R|G train ) represents the confidence of rule R, It represents the change in the confidence of rule R before and after (h, r, t) is added to the training set. The calculation formula is:

[0095]

[0096] The present invention quantifies the impact of samples on rules by calculating the change in confidence of rules before and after samples are added to the training set, and thereby obtains the main components of the uncertainty of the assumed rules. In addition, the present invention uses confidence to weight different rules, which shifts the focus to high-confidence, high-quality rules, making the evaluation results more reasonable.

[0097] Step 7: Combine the information entropy uncertainty and rule uncertainty to obtain the final uncertainty size τ(h,r,t) of the unlabeled sample;

[0098] First, normalization is performed, and the formula is as follows:

[0099]

[0100] Where X max and X min They refer to the maximum and minimum values ​​of the information entropy uncertainty or rule uncertainty of each sample in the unlabeled sample set, X and X norm They refer to the information entropy uncertainty or rule uncertainty values ​​before and after normalization of each sample, respectively;

[0101] Then the final uncertainty size τ(h,r,t) is calculated:

[0102]

[0103] Among them, α is a balance factor, which is used to balance the influence between information entropy and rule uncertainty, and the value of α is 0.5.

[0104] Step 8: Select some unlabeled samples with the largest uncertainty size τ(h,r,t) for manual labeling to supplement the training set, and obtain candidate samples (h,r,t) according to the acquisition function * , the training set and rule set will be updated after manual annotation, and the acquisition function is:

[0105]

[0106] Then use the updated training set to update the rule set, and determine whether the current training set size has reached the upper limit. If so, end the entire process, if not, return to step 4.

[0107] The number of training samples added each time in the sample selection phase depends on the size of the entire unlabeled sample set. If the size of the training set reaches the specified number or the link prediction model has converged, the active link prediction process can be terminated.

[0108] Reference Figure 2 It is possible to have a clearer understanding of the rule-based active link prediction method. In the ongoing active learning cycle, the rule set, as the source of rule information, participates in the evaluation of candidate samples together with the model information in the sample selection stage, which enables samples rich in rule information to be added to the training set; in the model training stage, it participates in the training of the link prediction model together with the training set, which in turn enables samples rich in rule information to be fully utilized, thereby improving the final link prediction effect and achieving the purpose of better knowledge graph completion.

[0109] Example 2

[0110] An active link prediction method based on knowledge rule guidance, as described in Example 1, is different in that the subgraphs FB122 and WN18 data sets of Freebase and WordNet knowledge graphs are used for verification, and the deep learning model ConvE and the shallow model KALE are used as link prediction models to participate in active learning, and the actual effect of the present invention is compared and verified. ConvE is a graph neural network model based on two-dimensional convolution operations, which is mainly used to compare and verify the effect of using the relevant formulas of the present invention in the sample selection link; and KALE is a shallow model based on the distance translation hypothesis, which can explicitly use rule information in the training process, and compare and verify the final link prediction effect. Through experiments on the FB122 and WN18 datasets, it was found that the active link prediction method guided by knowledge rules based on the deep learning model ConvE and the active link prediction method guided by knowledge rules based on KALE had improved average link prediction accuracy compared with the existing technology. Among them, for the FB122 and WN18 datasets, the link prediction method based on the deep learning model ConvE improved the average link prediction accuracy by 4.2% compared with the active link prediction method based on KALE.

[0111] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. An active link prediction method based on knowledge rule guidance, It is characterized in that The steps include: Step 1: Obtain an incomplete knowledge graph that needs to be completed through link prediction; Step 2: Reprocess the data representation format of the target knowledge graph and convert the knowledge in the target knowledge graph into triples; at the same time, divide all the knowledge into unlabeled sample sets G unlabeled , validation set G valid and the test set G test ; Step 3: Obtain the training set G for the initial stage of active learning train and the rule set R train , and are ready to start active learning; Step 4: Use the training set and the rule set to train the link prediction model M and update the parameter θ of the link prediction model. At the same time, determine whether the current link prediction model M has converged. If so, end the entire process. If not, continue to step 5. Step 5: Calculate the information entropy uncertainty of each sample in the unlabeled sample set Step 6: Calculate the rule uncertainty ω(h,r,t) of each sample in the unlabeled sample set; Step 7: Combine the information entropy uncertainty and rule uncertainty to obtain the final uncertainty size τ(h,r,t) of the unlabeled sample; Step 8: Select some unlabeled samples with the largest uncertainty size τ(h,r,t) for manual labeling to supplement the training set, and then use the updated training set to update the rule set. At the same time, determine whether the current training set size has reached the upper limit. If so, end the entire process. If not, return to step 4.

2. The active link prediction method based on knowledge rule guidance according to claim 1, It is characterized in that In step 1, it is obtained by directly downloading from a public website or constructing according to relevant information sources.

3. The active link prediction method based on knowledge rule guidance according to claim 1, It is characterized in that In step 2, we use triples in RDF form, i.e., head entity, relation, tail entity, or subject, predicate, object, and unlabeled sample set G. unlabeled , validation set G valid and the test set G test All are in the form of triplets.

4. The active link prediction method based on knowledge rule guidance according to claim 1, It is characterized in that In step 3, the initial training set G train By using the unlabeled sample set G unlabeled The initial rule set R train Obtained by extracting rules from the training set; To implement rule extraction through AMIE, we first calculate the head coverage and PCA confidence, and filter out the rules whose head coverage and PCA confidence are lower than the specified threshold.

5. The active link prediction method based on knowledge rule guidance according to claim 4, It is characterized in that The calculation formula for head coverage is as follows: Where K represents the current knowledge base, which contains all currently known knowledge triples. Represents a rule, r(x,y) is the head atom, B is the body atom, support() indicates that the rule is satisfied A set of triples, (x, y) represents the combination of the head entity x and the tail entity y of any triple; The head coverage rate means the ratio of the number of correct instances that can be inferred by the current rule to the total number of instances of the head atom in K, which expresses the coverage ability of the rule in the current knowledge base; The calculation formula of PCA confidence is as follows: In the PCA confidence calculation formula, the numerator is the number of correct instances that can be inferred from the current rule, and the denominator is the total number of instances of the head atom, including known correct instances in K and counterexamples generated based on partially complete hypotheses, where r(x,y′) represents a counterexample triple constructed based on the triple r(x,y) using tail entity replacement, and y′ represents any other tail entity different from the tail entity y.

6. The active link prediction method based on knowledge rule guidance according to claim 5, It is characterized in that The specified threshold for head coverage is 0.5 and the specified threshold for PCA confidence is 0.

5.

7. The active link prediction method based on knowledge rule guidance according to claim 6, It is characterized in that In step 5, calculate the information entropy uncertainty The formula is as follows: Among them, p(y=i|(h,r,t),G train ) refers to the possibility that the current sample (h, r, t) is labeled i; When the link prediction model M is a deep learning model, the neural network is viewed from a Bayesian perspective, and Monte Carlo random dropout is applied during the model prediction process to obtain the model's estimated value of the probability of sample label establishment. The average size of this estimated value is taken as the actual probability size of the sample label establishment. The principle is: in Represents the parameters of the current deep learning model, Indicated by the parameter The probability that the label of the sample (h, r, t) is i under the determined current model; Represents the posterior of the model parameters relative to the true The variational distribution that minimizes the KL divergence; T represents the maximum number of sampling times; Indicates from The model parameters obtained by multiple sampling are used to approximate the model parameters; Indicated by the parameter The probability that the label of sample (h, r, t) is i under the determined model; When the link prediction model M is a shallow model, a truth mapping function is added to the output of the shallow model to artificially convert the output of the shallow model into the probability of the sample label being established: p(y=i|(h,r,t),G train )=I.f θ ((h,r,t)) / where f θ ((h,r,t)) represents the sample processing process of the shallow model, and I() represents the true value mapping function, which is responsible for mapping the original output result to the real number domain between [0,1] to make it the probability of the sample label being true.

8. The active link prediction method based on knowledge rule guidance according to claim 7, It is characterized in that In step 6, the formula for calculating the rule uncertainty ω(h,r,t) is: where p(y=1|(h,r,t),G train ) represents the probability of the current sample being established, R train represents the rule set, ρ(R|G train ) represents the confidence of rule R, It represents the change in the confidence of rule R before and after (h, r, t) is added to the training set. The calculation formula is:

9. The active link prediction method based on knowledge rule guidance according to claim 8, It is characterized in that In step 7, normalization is first performed, and the formula is as follows: Where X max and X min They refer to the maximum and minimum values ​​of the information entropy uncertainty or rule uncertainty of each sample in the unlabeled sample set, X and X norm They refer to the information entropy uncertainty or rule uncertainty values ​​before and after normalization of each sample, respectively; Then the final uncertainty size τ(h,r,t) is calculated: Among them, α is a balance factor, which is used to balance the influence between information entropy and rule uncertainty, and the value of α is 0.

5.

10. The active link prediction method based on knowledge rule guidance according to claim 9, It is characterized in that In step 8, candidate samples (h, r, t) are obtained according to the acquisition function. * , the training set and rule set will be updated after manual annotation, and the acquisition function is: If the size of the training set reaches the specified number or the link prediction model has converged, the active link prediction process ends.