Uncertain knowledge graph reasoning method based on semi-supervised confidence distribution learning

By converting triple confidence into a confidence distribution and using CDL-RL and PCDG to generate pseudo-labeled data for iterative optimization, the problem of unbalanced confidence distribution in uncertain knowledge graphs is solved, achieving higher-quality knowledge graph embedding and completion.

CN120104810BActive Publication Date: 2025-10-24SOUTHEAST UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510270084.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-10-24
Estimated Expiration
2045-03-07

AI Technical Summary

Technical Problem

Existing knowledge graph embedding learning methods for uncertainties cannot effectively fit low-confidence samples when dealing with imbalanced triple confidence distributions, resulting in decreased embedding quality and ineffective knowledge graph completion.

Method used

A semi-supervised confidence distribution learning method is adopted to transform triple confidence into a confidence distribution. Pseudo-labeled data is generated through CDL-RL and PCDG. Meta-self-training is used to iteratively optimize the model and generate high-quality pseudo-confidence labels, thereby improving the model's prediction ability on low-confidence samples.

Benefits of technology

It effectively solves the problem of unbalanced confidence distribution, improves the embedding quality of uncertain knowledge graphs, achieves more accurate confidence prediction and link prediction, and enhances the knowledge graph completion effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104810B_ABST
    Figure CN120104810B_ABST
Patent Text Reader

Abstract

The application discloses an uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning, comprising the following steps: converting the triple confidence in the uncertainty knowledge graph training data into a confidence distribution; simultaneously learning the embedding of the uncertainty knowledge graph on the labeled data and the pseudo-labeled data generated by a pseudo-labeled data generator by using a relation learner based on confidence distribution learning; generating high-quality pseudo-confidence distribution labels for unlabeled data by using the pseudo-labeled data generator; iteratively training the relation learner based on confidence distribution learning and the pseudo-labeled data generator by using meta-self-training until the two converge; and inputting the data to be completed into the trained relation learner based on confidence distribution learning to perform reasoning, thereby achieving the completion of the uncertainty knowledge graph. The application can capture the supervision information of a small number of confidence or unseen confidence in the labeled data and is suitable for the scene where the triple confidence distribution of the uncertainty knowledge graph is unbalanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of uncertain knowledge graph reasoning, and particularly relates to an uncertain knowledge graph reasoning method based on semi-supervised confidence distribution learning. BACKGROUND

[0002] A knowledge graph (KG) is a multi-relation graph that describes knowledge using triples, each triple is represented in the form of (subject, predicate, object), for example (Michael Jordan, Nationality, U.S.). An uncertain knowledge graph (UKG) is a knowledge graph in which each triple is associated with a confidence score, which represents the likelihood that the triple is true. Such a setting is beneficial for more accurate knowledge representation and reasoning in the real world. An uncertain knowledge graph can be formally represented as a set of quadruples: G={(h,r,t,s)|h,t∈ε, s∈[0,1]},where ε and respectively represent the set of entities and relations, and s is the confidence score used to describe the uncertainty of the triple. Typical representatives of uncertain knowledge graphs include NELL, ConceptNet, etc.

[0003] Knowledge graphs in the real world are incomplete, because new knowledge is constantly being generated over time, and uncertain knowledge graphs are no exception. Therefore, many uncertain knowledge graph reasoning methods based on uncertain knowledge graph embedding learning have been proposed to perform confidence prediction and link prediction to achieve uncertain knowledge graph completion, including UKGE, PASSLEAF, UKGsE, BEUrRE, etc. Uncertain knowledge graph embedding learning aims to learn representations of entities and relations in a low-dimensional space, and to preserve the graph structure and confidence information in the low-dimensional representation. However, the above methods ignore the fact that the confidence distribution of most uncertain knowledge graphs is extremely imbalanced, i.e., only high-confidence triples are retained. For example, NELL only contains triples with a confidence score greater than 0.9. Learning from such imbalanced data will result in embedding-based uncertain knowledge graph reasoning methods that cannot fit the model to relatively low-confidence samples, thereby reducing the quality of the generated uncertain knowledge graph embeddings.

[0004] To solve this problem, the present application proposes an uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning. In the uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning, the confidence of each triple is converted into a confidence distribution. This method can make full use of the supervised information of a small number of confidence or unseen confidence in the data, and generate reliable confidence for unlabeled data (triples without confidence scores) to expand the training data, so as to solve the problem of unbalanced triple confidence distribution in the learning process. SUMMARY

[0005] Technical problem: The present application provides an uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning, which can solve the problem of uncertainty knowledge graph completion in the unbalanced scene of real-world uncertainty knowledge graph triple confidence distribution.

[0006] Technical solution: The uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning of the present application contains two key modules: a confidence distribution learning-based relational learner (CDL-RL) and a pseudo-labeled data generator (PCDG). This method first converts all the confidence of the labeled data (i.e. triples with confidence) in the training set into confidence distribution. Then CDL-RL uses labeled data and pseudo-labeled data generated by PCDG to learn the embedding of uncertainty knowledge graph. PCDG generates high-quality pseudo-confidence labels for unlabeled data, thereby obtaining pseudo-labeled data, and CDL-RL utilizes these pseudo-labeled data in an iterative manner and further improves its performance. CDL-RL and PCDG have the same structure, but the training process is different. CDL-RL optimizes by minimizing the loss of labeled data and pseudo-labeled data in confidence prediction and link prediction, while PCDG takes the performance of CDL-RL after using the pseudo-labeled data generated by PCDG as its meta-learning target. The uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning performs meta-self-training by iteratively training CDL-RL and PCDG.

[0007] The uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning proposed by the present application comprises the following steps:

[0008] S1, converting all the triple confidence in the uncertainty knowledge graph training data into confidence distribution.

[0009] S2, learning the embedding of the uncertain knowledge graph on both the labeled data and the pseudo-labeled data generated by the PCDG simultaneously using the CDL-RL.

[0010] S3, generating high-quality pseudo-confidence labels for the unlabeled data using the PCDG.

[0011] S4, iteratively training the CDL-RL and the PCDG using meta-self-training until convergence.

[0012] S5, inputting the data to be completed into the trained CDL-RL for reasoning to realize confidence prediction and link prediction.

[0013] In the uncertain knowledge graph reasoning method based on semi-supervised confidence distribution learning, in step S1, the confidence distribution is defined as a discrete distribution. Since the interval of the confidence is [0, 1], the granularity of the label set of the confidence is directly set to The ordered confidence label set is For a given four tuple (h, r, t, s) in the uncertain knowledge graph, the confidence distribution of (h, r, t) is defined as Wherein s i ∈ [0, 1] is the confidence label of (h, r, t). The confidence distribution of the application is generated by a Gaussian distribution , wherein σ is the standard deviation, and s is the mean, so s has the highest description degree. Therefore, in this step, each piece of knowledge in the uncertain knowledge graph can be represented as a four tuple (h, r, t, s), wherein is the confidence distribution.

[0014] In the uncertain knowledge graph reasoning method based on semi-supervised confidence distribution learning, in step S2, the CDL-RL is used to learn the embedding of the entities and the relationships in the uncertain knowledge graph. The input of the CDL-RL is the four tuple l = (h, r, t, s) obtained in step S1. The CDL-RL has three learning objectives: 1) minimizing the difference between the predicted confidence distribution and the true confidence distribution; 2) minimizing the difference between the predicted confidence and the true confidence; and 3) accurately predicting the tail entity given the head entity and the tail entity. The first two objectives are used to complete the confidence prediction, and the last objective is used for link prediction. Specifically, given a three tuple (h, r, t), the embedding of h, r and t is concatenated and input into a double-layer fully connected neural network, and the network outputs an n+1 dimensional vector. Then, the Softmax function is applied as the activation function. The predicted confidence distribution of the three tuple (h, r, t) can be calculated by the following formula:

[0015]

[0016] where || represents the connection between the embeddings, FCN1 is a function that converts the connection between the embeddings into an n+1 dimensional vector using a fully connected network, and Softmax(·) is an activation function that maps the n+1 dimensional vector into an n+1 dimensional probability distribution.

[0017] The present application uses Kullback-Leibler divergence (KL divergence) to measure the similarity between the predicted distribution and the real confidence distribution, and takes it as one of the optimization objectives of the uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning, assuming that l i is the i-th quadruple in the training data, then this part of the loss function is defined as:

[0018]

[0019] where s i and represent the real confidence distribution and the predicted confidence distribution of l i , respectively, s i a and represent the a-th element in the real confidence distribution and the predicted confidence distribution, respectively, represents the training set.

[0020] In order to further improve the accuracy of confidence prediction, the present application calculates the mean square error (MSE) loss function between the expectation of the predicted confidence distribution and the real confidence for each quadruple, and the calculation method is as follows:

[0021]

[0022] where s i is the real confidence of l i , and is the expectation of the predicted confidence distribution , the present application takes this expectation as the predicted confidence of l i .

[0023] Combining and , the loss function of the confidence prediction task is obtained

[0024]

[0025] where w1 and w2 are weighting factors for adjusting the proportion of and .

[0026] To enable the semi-supervised confidence distribution learning based uncertain knowledge graph reasoning method to solve the link prediction problem, the ranking of possible tail entities under a given query (h, r,?) needs to be accurately evaluated.

[0027] The present application designs an edge-based ranking loss function to optimize the performance of the method on the link prediction task. Here, another double-layer fully connected neural network is used to calculate the ranking score of a triple, which is different from the fully connected neural network used for confidence prediction in that the output of this fully connected neural network is a scalar rather than a vector, and the scalar is normalized using the Sigmoid activation function. The ranking score of a triple is calculated as follows:

[0028]

[0029] wherein is the predicted triple ranking score, FCN2 is a function that uses a fully connected network to convert the connection between embeddings into a scalar, Sigmoid(·) is an activation function that maps the scalar to a probability in the range of 0 to 1. The edge-based ranking loss function used to optimize link prediction is to increase the difference in ranking scores between positive and negative samples, so that the ranking score of the positive sample is higher than that of the negative sample. Given a positive sample, the present application generates multiple negative samples by replacing the head or tail entity of the positive sample with a randomly selected entity. This edge-based ranking loss function is defined as:

[0030]

[0031] wherein and are the ranking scores of the positive and negative samples, respectively, is the set of negative samples, [x] + = max[0, x] is the standard hinge loss, and γ is the edge size.

[0032] When the confidence prediction loss and the link prediction loss are used simultaneously, the proportion of the two tasks in the training process needs to be balanced to avoid one task dominating the training. The present application uses an uncertainty weight to dynamically adjust the proportion of each task in the training process. The loss function of the kth task is adjusted as follows:

[0033]

[0034] wherein λ k is the noise parameter of the kth task, can dynamically adjust the weight of the kth task, so that the task with higher uncertainty has lower confidence, and logλ kis a regularization term that prevents the loss from being excessively reduced due to the increase of k , is the loss function of the k-th task. The loss function of CDL-RL is calculated in the following way:

[0035]

[0036] where λ1 and λ2 are the noise parameters of confidence prediction and link prediction respectively, and θ represents the parameters of CDL-RL. It should be noted that when When both the labeled data and the pseudo-labeled data of PCDG (to be described in detail in steps S3 and S4) are used, the loss function of confidence prediction is redefined as:

[0037]

[0038] where is the labeled data set, is the pseudo-labeled data set, s j and represent the pseudo-labeled confidence distribution and the predicted confidence distribution of the j-th pseudo-labeled quadruple in the pseudo-labeled data set, w p is the weight of the pseudo-labeled data, s j b and represent the b-th element in the pseudo-confidence distribution and the corresponding predicted confidence distribution, respectively.

[0039] In the uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning of the present application, in step S3, PCDG is used to generate high-quality pseudo-confidence labels for unlabeled data, thereby obtaining pseudo-labeled data. PCDG is based on the idea of meta-learning, which solves the error accumulation problem in traditional self-training methods. The structure of PCDG is the same as that of CDL-RL, and its parameters are denoted as η. In the training process, PCDG first generates pseudo-confidence distributions for unlabeled data. These pseudo-labeled data contain gradient information of PCDG, so that PCDG can be optimized. These pseudo-labeled data are denoted as The performance of CDL-RL after performing a gradient descent step on the labeled data and is then evaluated to check whether CDL-RL has been better trained. The smaller the loss of CDL-RL, the better its performance. Therefore, the training objective of PCDG is to minimize the loss of CDL-RL after one update, and the training objective of PCDG can be represented as:

[0040]

[0041] where is the loss of CDL-RL when its parameters are θ+ the loss on the loss on + is the CDL-RL loss on the loss on the loss on

[0042]

[0043] where a is the learning rate, the loss on the loss on the loss on

[0044]

[0045] In the uncertainty knowledge graph inference method based on semi-supervised confidence distribution learning, in step S4, the specific process of meta-self-training is as follows: first, the labeled data is input into the CDL-RL, and the embedding of the uncertainty knowledge graph is learned by the CDL-RL. The CDL-RL is self-optimized by minimizing the loss on the confidence prediction and link prediction tasks using the loss function of step S2. After the entity and relationship embeddings are gradually stabilized, the PCDG is trained to generate high-quality pseudo-confidence labels for unlabeled data. The PCDG is self-optimized by the loss of the CDL-RL on the labeled data and the pseudo-labeled data after performing a gradient descent step. After training the PCDG for a period of time, a filtering strategy is applied to the pseudo-labeled data generated by the PCDG. In the labeled data, the original confidence of each triple should be in the leading position in the converted confidence distribution. Therefore, in the pseudo-labeled data, if the highest description degree of a pseudo-confidence label is greater than a fixed threshold, the corresponding pseudo-confidence distribution is considered to be high-quality, and the pseudo-labeled data is selected to train the CDL-RL, while the other pseudo-labeled data is removed. Subsequently, the selected pseudo-labeled data is input into the CDL-RL to enhance its training process. Then the CDL-RL and the PCDG repeatedly optimize the above process and each other, that is, the PCDG provides pseudo-labeled data for the CDL-RL, and the CDL-RL provides meta-learning goals for the PCDG. This iterative training process is the complete meta-self-training. The CDL-RL and the PCDG are continuously optimized until convergence.

[0046] In the uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning, after the training of the model is completed through the steps S1-S4, the data to be completed is transmitted into the trained CDL-RL for reasoning, and the prediction confidence and ranking score can be obtained. According to the prediction confidence and the ranking score, the confidence prediction task and the link prediction task can be realized. For the confidence prediction task, the given triple is transmitted into the CDL-RL, and the prediction confidence output by the CDL-RL is directly used as the result of the confidence prediction. For the link prediction task, for the given head entity and relation, all entities in the uncertainty knowledge graph are used as candidate tail entities to form candidate triples with the given head entity and relation. For each candidate triple, the ranking score of the candidate triple is calculated by using the CDL-RL, and the candidate triple with a high ranking score is the possible correct completion item.

[0047] An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method when executing the program.

[0048] A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the method.

[0049] Compared with the prior art, the advantages of the present application are as follows.

[0050] 1. The uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning proposed in the present application applies meta-self-training to generate reliable confidence for unlabeled data in uncertainty knowledge graph embedding learning, fully utilizes unlabeled data to expand the training data, and solves the problem of unbalanced confidence distribution.

[0051] 2. The present application proposes a new confidence distribution learning strategy, which converts triple confidence into confidence distribution, which is conducive to capturing the supervision information of a small number of confidence or unseen confidence in the labeled data.

[0052] 3. The method has been successfully applied to the uncertain knowledge graph dataset CN15k and NL27k. In the confidence prediction scenario, the method is trained on the training set, and the mean square error (MSE) is used as an evaluation index to measure the effect of the method on the test set. The results show that the mean square error reaches 0.037 on the CN15k dataset and 0.012 on the NL27k dataset, indicating that the method has significant effect in the confidence prediction scenario. At the same time, in the link prediction scenario, the method is trained on the training set, and the weighted average reciprocal rank (WMRR) is used as an evaluation index to measure the effect of the method on the test set. The results show that the weighted average reciprocal rank reaches 0.207 on the CN15k dataset and 0.731 on the NL27k dataset, indicating that the method has significant effect in the link prediction scenario. The indicators of the method on different tasks of the two datasets are better than those of other uncertain knowledge graph reasoning methods. In summary, the method can effectively learn the embedding of the uncertain knowledge graph and perform uncertain knowledge graph reasoning, and thus realize the completion of the uncertain knowledge graph. BRIEF DESCRIPTION OF DRAWINGS

[0053] Figure 1 is the overall framework diagram of the present application.

[0054] Figure 2 is the specific structure diagram of CDL-RL and PCDG of the present application. DETAILED DESCRIPTION

[0055] The present application will be further illustrated below in conjunction with the drawings and specific embodiments, and it should be understood that the following specific embodiments are only used to illustrate the present application and not to limit the scope of the present application.

[0056] Example 1

[0057] An uncertain knowledge graph reasoning method based on semi-supervised confidence distribution learning, as shown in Figure 1 , includes the following steps:

[0058] Step S1: Convert all triple confidence in the given uncertain knowledge graph training data into confidence distribution. In this embodiment, the confidence distribution is defined as a discrete distribution. In this embodiment, the granularity of the confidence label set is set to The ordered confidence label set is For a given quadruple (h, r, t, s) in the uncertain knowledge graph, the confidence distribution of (h, r, t) is defined as where s i ∈ [0, 1] is the confidence label of the description degree of (h, r, t). In this embodiment, the Gaussian distribution a confidence distribution is generated, where σ is the standard deviation and s is the mean, so s has the highest degree of description. In this step, each piece of knowledge in the uncertainty knowledge graph z is represented as a four-tuple (h, r, t, s), where is the confidence distribution, and the embodiment sets n to 100, so there are 101 confidence labels in total.

[0059] Step S2: Learning the embeddings of entities and relations in the uncertainty knowledge graph using CDL-RL. CDL-RL, as shown in Figure 2 , takes the four-tuple l = (h, r, t, s) obtained in step S1 as input. CDL-RL has three learning objectives: 1) to minimize the difference between the predicted confidence distribution and the true confidence distribution; 2) to minimize the difference between the predicted confidence and the true confidence; and 3) to accurately predict the tail entity given the head entity and the tail entity. The first two objectives are used for confidence prediction, and the last objective is used for link prediction. Specifically, given a triple (h, r, t), the embeddings of h, r, and t are concatenated and passed into a two-layer fully connected neural network, which outputs an n+1-dimensional vector. Then the Softmax function is applied as the activation function. The predicted confidence distribution of the triple (h, r, t) can be calculated by the following formula:

[0060]

[0061] where || represents the connection between embeddings, FCN1 is a function that uses a fully connected network to convert the connection between embeddings into an n+1-dimensional vector, and Softmax(·) is an activation function that maps the n+1-dimensional vector to an n+1-dimensional probability distribution. In this embodiment, the Kullback-Leibler divergence (KL divergence) is used to measure the similarity between the predicted distribution and the true confidence distribution, and it is used as one of the optimization objectives, assuming that l i is the i-th four-tuple of the training data, then this part of the loss function is defined as:

[0062]

[0063] where s i and represent the true confidence distribution and the predicted confidence distribution of l i , respectively, s i a and represent the a-th element in the true confidence distribution and the predicted confidence distribution, respectively, denotes the training set.

[0064] To further improve the accuracy of confidence prediction, the embodiment calculates the mean square error (MSE) loss function between the expectation of the predicted confidence distribution and the true confidence for each quadruple, which is calculated as follows:

[0065]

[0066] where s i is the true confidence of l i , and is the expectation of the predicted confidence distribution , which is taken as the predicted confidence of l i .

[0067] Combining and , the loss function of the confidence prediction task is obtained

[0068]

[0069] where w1 and w2 are weighting factors used to adjust the proportion of and .

[0070] To solve the link prediction problem, it is necessary to accurately evaluate the ranking of possible tail entities under a given query (h, r,?). The embodiment uses an edge-based ranking loss function to optimize the performance of the method on the link prediction task. First, a new double-layer fully connected neural network is used to calculate the ranking score of a triple, which is different from the fully connected neural network used for confidence prediction in that the output of this fully connected neural network is a scalar rather than a vector, and the scalar is normalized using a Sigmoid activation function. The ranking score of a triple is calculated as follows:

[0071]

[0072] where is the predicted triple ranking score, FCN2 is a function that converts the connection between embeddings into a scalar using a fully connected network, and Sigmoid(·) is an activation function that maps the scalar to a probability in the range of 0 to 1. The edge-based ranking loss function used to optimize link prediction is to increase the difference in ranking scores between positive and negative samples, so that the ranking score of the positive sample is higher than that of the negative sample. Given a positive sample, the embodiment generates multiple negative samples by replacing the head or tail entity of the positive sample with a randomly selected entity. In the embodiment, the number of negative samples corresponding to each positive sample is set to 50. The edge-based ranking loss function is defined as:

[0073]

[0074] where and are the ranking scores of positive and negative samples respectively, is the set of negative samples, [x] + = max[0, x] is the standard hinge loss, and γ is the margin size.

[0075] In training CDL-RL, the confidence prediction loss and the link prediction loss are used simultaneously. To avoid the domination of one task over the other, the uncertainty weight is used to dynamically adjust the proportion of each task during training. The loss function of the k-th task is adjusted as:

[0076]

[0077] where λk k is the noise parameter of the k-th task, can dynamically adjust the weight of the k-th task, so that the task with higher uncertainty has lower confidence, logλk k is a regularization term to prevent the loss from being excessively reduced due to the increase of λk k , is the loss function of the k-th task. The loss function of CDL-RL is calculated as:

[0078]

[0079] where λ1 and λ2 are the noise parameters of confidence prediction and link prediction respectively, and θ represents the parameters of CDL-RL. It should be noted that when the labeled data and the pseudo-labeled data of PCDG (explained in detail in steps S3 and S4) are used simultaneously, the loss function of confidence prediction is redefined as:

[0080]

[0081] where is the labeled data set, is the pseudo-labeled data set, s j and represent the pseudo-labeled confidence distribution and the predicted confidence distribution of the j-th pseudo-labeled quadruple in the pseudo-labeled data set respectively, w p is the weight of the pseudo-labeled data, s j b and represent the b-th element in the pseudo-confidence distribution and the corresponding predicted confidence distribution respectively.

[0082] Step S3: Pseudo-labeled data is generated by PCDG for unlabelled data with high quality pseudo-confidence labels. The structure of PCDG is the same as CDL-RL, and its parameters are denoted as η. In the training process of PCDG, PCDG first generates pseudo-confidence distribution for unlabelled data, and these pseudo-labeled data contain gradient information of PCDG, so that PCDG can be optimized, and these pseudo-labeled data are denoted as Note that although and are both generated by PCDG, their roles are different, is generated in the stage of training PCDG, is generated in the stage of training CDL-RL. The present embodiment then evaluates the performance of CDL-RL after performing a gradient descent step on labeled data and to check whether CDL-RL has been better trained, and the smaller the loss of CDL-RL is, the better the performance of CDL-RL is. Therefore, the training objective of PCDG is to minimize the loss of CDL-RL after updating once, and the training objective of PCDG can be expressed as:

[0083]

[0084] wherein is the loss on when the parameters of CDL-RL are θ + , θ + is the parameters of CDL-RL after performing a gradient descent process on and , and its calculation method can be expressed as:

[0085]

[0086] wherein α is a learning rate, is the loss on and when the parameters of CDL-RL are θ. Finally, the loss function of PCDG can be explicitly expressed as:

[0087]

[0088] Step S4: CDL-RL and PCDG are iteratively trained by meta-self-training until convergence. First, labeled data The input is fed into the CDL-RL, which learns the embedding of the uncertain knowledge graph using the CDL-RL. The CDL-RL optimizes itself by minimizing the loss on the confidence prediction and link prediction tasks using the loss function of step S2. After the embedding of the entities and relations gradually stabilizes, the PCDG is trained to generate high-quality pseudo-confidence labels for the unlabelled data, which is used in step S3 to train the CDL-RL on the labelled data and the pseudo-labelled data the loss after performing a gradient descent step once. After training the PCDG for a period of time, a filtering strategy is applied to the pseudo-labelled data generated by the PCDG, i.e. in the labelled data, the original confidence of each triple should be in the leading position in the converted confidence distribution, therefore, in the pseudo-labelled data, if the highest degree of a pseudo-confidence label is greater than a fixed threshold, the corresponding pseudo-confidence distribution is considered to be of high quality, and the pseudo-labelled data is selected for training the CDL-RL, while the other pseudo-labelled data is removed. Subsequently, the selected pseudo-labelled data is input into the CDL-RL to enhance its training process. After that, the CDL-RL and the PCDG repeatedly optimize each other by the above process, i.e. the PCDG provides pseudo-labelled data for the CDL-RL, and the CDL-RL provides meta-learning objectives for the PCDG, and this iterative training process is the complete meta-self-training. This embodiment subsequently optimizes the CDL-RL and the PCDG until convergence.

[0089] Algorithm 1 details the process of meta-self-training. This embodiment defines two important time points, i.e. the round T PCDG at which the training of the PCDG begins semiCDL and the round T PCDG at which the training of the CDL-RL using unlabelled data begins PCDG . This embodiment first initializes the CDL-RL (θ) and the PCDG (η), and uses the labelled data and the sampled unlabelled data as the input of the uncertain knowledge graph inference method based on semi-supervised confidence distribution learning. When the current round is less than T PCDG , this embodiment only optimizes the CDL-RL using the labelled data, which makes the embedding of the uncertain knowledge graph stable during this period, which will help this embodiment to train the PCDG. When the current round exceeds T PCDG but has not reached T semiCDL , the training of the PCDG begins, the PCDG first generates pseudo-confidence labels for the unlabelled data and inputs them into the latest updated CDL-RL together with , and further updates the parameters of the CDL-RL to obtain θ +, the PCDG will update itself using the pseudo-label data, and in this period, the PCDG will not generate directly into CDL-RL, because in the early stage of PCDG training, the quality of generated samples is not stable enough, so the process of training CDL-RL in this stage is the same as before. When the current round exceeds T semiCDL , the PCDG will update itself using the pseudo-label data, and in this period, the PCDG will not generate pseudo-label data and optimization of CDL-RL, while the optimization of PCDG is the same as before. After that, CDL-RL and PCDG will continue to train until the maximum round is reached. In the training process of this embodiment, all parameters are updated in each batch using stochastic gradient descent.

[0090]

[0091]

[0092] Step S5: After the training of the model is completed through the steps of S1-S4, the data to be completed is input into the trained CDL-RL to obtain the prediction confidence and ranking score. According to the prediction confidence and ranking score, the confidence prediction task and the link prediction task can be completed. For the confidence prediction task, the given triple is input into CDL-RL, and the prediction confidence output by CDL-RL is directly used as the result of confidence prediction; and for the link prediction task, for a given head entity and relation, all entities in the uncertainty knowledge graph are used as candidate tail entities to form candidate triples with the given head entity and relation. For each candidate triple, the ranking score of the candidate triple is calculated using CDL-RL, and the candidate triple with a high ranking score is the possible correct completion item.

[0093] The above embodiments are only preferred embodiments of the present application, and it should be noted that for ordinary skilled persons in the art, without departing from the principles of the present application, a number of improvements and equivalent replacements can be made, and these improvements and equivalent replacements of the claims of the present application fall within the protection scope of the present application.

Claims

1. An uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning, characterized in that, The method comprises the following steps: S1, convert all the triples' confidence in the uncertain knowledge graph training data into confidence distribution, each piece of knowledge in the uncertain knowledge graph is re-represented as a quadruple (h, r, t, s), where is the confidence distribution; the confidence distribution is generated by a Gaussian distribution , where σ is the standard deviation, s is the mean, so s has the highest description degree, S2, learning embeddings of the uncertain knowledge graph on labeled data and pseudo-labeled data generated by a pseudo-labeled data generator using a confidence distribution learning-based relational learner (CDL-RL), In step S2, the embeddings of entities and relations in the uncertain knowledge graph are learned using the CDL-RL, the input of the CDL-RL is the quadruple l = (h, r, t, s) obtained in step S1, and the CDL-RL has three learning objectives: 1) minimizing the difference between the predicted confidence distribution and the true confidence distribution; 2) minimizing the difference between the predicted confidence and the true confidence; and 3) accurately predicting the tail entity given the head entity and the tail entity, wherein the first two objectives are used to complete the confidence prediction, and the last objective is used for link prediction, S3, generating high-quality pseudo-confidence distribution labels for unlabeled data using a pseudo-labeled data generator (PCDG), S4, iteratively training the CDL-RL and the PCDG using meta-self-training until they converge, S5, inputting the data to be completed into the trained CDL-RL for inference to realize confidence prediction and link prediction.

2. The uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning according to claim 1, wherein: In step S1, the confidence distribution is defined as a discrete distribution, and the granularity of the label set of the confidence is set as The ordered confidence label set is For a given quadruple (h, r, t, s) in the uncertain knowledge graph, the confidence distribution of (h, r, t) is defined as Where s i ∈ [0, 1] is the confidence label of the description degree of (h, r, t).

3. The uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning according to claim 2, characterized in that: In step S2, given a triple (h, r, t), the embeddings of h, r and t are concatenated and passed into a two-layer fully connected neural network, which outputs an n+1 dimensional vector, followed by a Softmax function as the activation function, the predicted confidence distribution of the triple (h, r, t) This is calculated by the following equation: Where || represents the connection between embeddings, FCN1 is a function that converts the connection between embeddings into an n+1-dimensional vector using a fully connected network, and Softmax(·) is an activation function that maps the n+1-dimensional vector to an n+1-dimensional probability distribution, The Kullback-Leibler divergence (KL divergence) is used to measure the similarity between the predicted distribution and the true confidence distribution, and is taken as one of the optimization objectives of the uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning, assuming that l i is the i-th four tuple in the training data, and this part of the loss function is defined as: where s i and represent the true confidence distribution and the predicted confidence distribution of l i respectively, i a and denote the a-th element in the true confidence distribution and the predicted confidence distribution respectively, denotes the training set, The mean square error (MSE) loss function between the expected prediction confidence distribution and the true confidence is calculated for each quadruple to further improve the accuracy of confidence prediction, and the calculation method is as follows: where s i is the true confidence of l i , is the expected value of the prediction confidence distribution , which is taken as the prediction confidence of l i . With In combination, the loss function for the confidence prediction task ​ where w1 and w2 are weighting factors used to adjust the proportion of and ​ The ranking score of the triple is calculated as follows: wherein is the predicted triple ranking score, FCN2 is a function that refers to using a fully connected network to convert the connection between embeddings into a scalar, Sigmoid(·) is an activation function that maps the scalar to a probability in the range of 0 to 1, given a positive sample, multiple negative samples are generated by replacing the head or tail entity of the positive sample with a randomly selected entity, and this loss function is defined as: where and are the ranking scores of positive and negative samples, respectively, is the set of negative samples, [x] + = max[0, x] is the standard hinge loss, and γ is the margin size. Concurrent use of confidence prediction loss and link prediction loss When training, the proportion of the two tasks in the training process needs to be balanced to avoid one task dominating the training. An uncertainty weight is used to dynamically adjust the proportion of each task in the training process. After using the uncertainty weight, the loss function of the kth task is adjusted as: where λ k is the noise parameter of the kth task, The weight of the kth task can be dynamically adjusted, and the task with higher uncertainty has lower confidence, logλ k is a regularization term to prevent the loss from being excessively reduced due to the increase of λ k , is the loss function of the kth task, and the loss function of CDL-RL is calculated as follows: Where λ1 and λ2 are noise parameters for confidence prediction and link prediction, respectively, and θ represents the parameters of the CDL-RL, When When both the labeled data and the pseudo-labeled data of PCDG are used, the loss function of the confidence prediction is redefined as: wherein is a labeled dataset, is a pseudo-labeled dataset, s j and denote the pseudo-label confidence distribution and the predicted confidence distribution of the j-th pseudo-label quadruple of the pseudo-labeled dataset, w p is a weight for the pseudo-labeled data, s j b and denote the b-th element of the pseudo-confidence distribution and the corresponding predicted confidence distribution, respectively.

4. The uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning according to claim 3, characterized in that: In step S3, PCDG is used to generate high-quality pseudo-confidence labels for unlabelled data, the structure of PCDG is the same as CDL-RL, and the parameters of PCDG are denoted as η, in the training process, PCDG first generates pseudo-confidence distribution for unlabelled data, these pseudo-labelled data contain the gradient information of PCDG, so that PCDG can be optimized, and these pseudo-labelled data are denoted as The performance of CDL-RL on labelled data and The performance after performing a gradient descent step on the above to check whether CDL-RL has been better trained, the smaller the loss of CDL-RL, the better the performance, the training target of PCDG is to minimize the loss of CDL-RL after updating once, and the training target of PCDG is denoted as: where is the loss on when the parameters of CDL-RL are + , and + is the loss on after CDL-RL has performed one gradient descent process on , which is computed as: where a is the learning rate, is the loss on with with parameters θ, and finally, the loss function of PCDG is explicitly expressed as:

5. The uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning according to claim 4, characterized in that: In step S4, the meta-self-training is used to iteratively train the CDL-RL and the PCDG. The specific process of the meta-self-training is as follows: first, the labeled data is input into the CDL-RL, and the embedding of the uncertain knowledge graph is learned by the CDL-RL. The CDL-RL is self-optimized by minimizing the loss on the confidence prediction and link prediction tasks using the loss function of step S2. After the embedding of the entity and the relation is gradually stabilized, the PCDG is trained. The purpose is to generate high-quality pseudo-confidence labels for unlabeled data. The PCDG is self-optimized by the loss after performing a gradient descent step on the loss of step S3 on the labeled data and the pseudo-labeled data generated by the PCDG. After training the PCDG for a period of time, a screening strategy is applied to the pseudo-labeled data generated by the PCDG. Then, the selected pseudo-labeled data is input into the CDL-RL to enhance the training process of the CDL-RL. After that, the CDL-RL and the PCDG repeatedly perform the above process and optimize each other, that is, the PCDG provides pseudo-labeled data for the CDL-RL, and the CDL-RL provides a meta-learning target for the PCDG. This iterative training process is the complete meta-self-training. Then, the CDL-RL and the PCDG are continuously optimized until convergence.

6. The uncertainty knowledge graph reasoning method based on semi-supervised confidence distribution learning according to claim 5, characterized in that: In step S5, the to-be-completed triple data is input into the CDL-RL trained through steps S1-S4 for inference to obtain the predicted confidence and the ranking score, thereby realizing the confidence prediction and link prediction tasks in the uncertain knowledge graph completion task.

7. 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 method according to any one of claims 1-6 when executing the program.

8. A computer readable storage medium having stored thereon computer instructions, characterized in that: The computer instructions implement the method according to any one of claims 1-6 when executed by the processor.

Citation Information

Patent Citations

  • Knowledge representation reasoning method based on encoder and decoder architecture

    CN113836312A

  • Knowledge graph inference model, system and inference method for Bayesian small sample learning

    CN114861917A