Knowledge graph reasoning model, system and reasoning method for Bayesian small sample learning
Through the Bayesian small sample learning method and Bayesian graph neural network, the scalability and uncertainty problems of the knowledge graph reasoning model when dealing with new entities and long-tail distributions are solved, and rapid adaptation to new entities is achieved. Dynamic knowledge reasoning.
Patent Information
- Application Number
- CN202210490127.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-04-29
AI Technical Summary
Existing knowledge graph reasoning models have poor scalability and uncertainty when dealing with emerging entities and long-tail distribution phenomena, are difficult to generalize to invisible entities, and suffer from noise and ambiguity problems.
Adopting the Bayesian inductive reasoning method based on small sample learning, by constructing a Bayesian graph neural network as a meta-learner, knowledge is inferred from the original knowledge graph to invisible entities, and the Gaussian distribution model is used to reduce uncertainty. Representing emerging entities using meta-training and support sets.
It achieves rapid adaptation and dynamic updating of the knowledge graph, and can infer new facts or emerging entities without retraining, reducing the uncertainty of the knowledge graph.
Smart Images

Figure CN114861917B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of knowledge graph reasoning models, and in particular to a knowledge graph reasoning model, system and reasoning method for Bayesian small sample learning. Background Art
[0002] Large-scale knowledge graphs, such as YAGO, NELL, and Wikidata, contain a large amount of factual knowledge. As the background of many applications, with the rapid development of knowledge graph reasoning, its wide application in recommendation systems, question answering, etc. has also attracted more and more attention. Knowledge graph reasoning aims to infer new facts from existing knowledge graphs, which are usually modeled as a link prediction problem to predict new entities or relations for a query triple.
[0003] There are many different studies that have made substantial contributions to knowledge graph reasoning. One of the most popular methods is based on knowledge graph embedding, which maps the entire knowledge graph into a multidimensional space, calculates the score of triples and predicts new triples through various vector operations. Because of its simplicity and high accuracy, the knowledge graph embedding method has received great attention, but the existing knowledge graph embedding reasoning still has certain limitations.
[0004] In fact, knowledge is not static, but dynamically develops over time. Therefore, knowledge graphs change over time as new knowledge emerges or old knowledge becomes obsolete. For example, for many years, about 200 entities appeared in DBpedia every day. Here, two challenges of knowledge graph embedding reasoning are proposed: First, poor scalability. The direct method of knowledge graph embedding method is difficult to handle newly emerging entities; because when a new entity appears, the entire model needs to be retrained from scratch. The direct method relies on the representation of entities and relations and lacks the ability to generalize to unseen entities such as induction. Second, due to the cumulative effect of time, the phenomenon of long-tail distribution is very common in knowledge graphs, and most entities have only a few triples associated with the original knowledge graph. However, the direct method assumes that each entity has sufficient training data, which leads to uncertainty at the representation level and unreliability in reasoning; and knowledge graphs are composed of crowdsourcing and intelligent extraction, and there are often some noise or ambiguity problems, which also leads to uncertainty in knowledge graphs.
[0005] For example, Chinese patent CN112084344A discloses a knowledge graph reasoning method, including: obtaining initial knowledge graph data to be completed, the initial knowledge graph data includes multiple groups of initial data groups, and the initial data groups only include head entities and entity relationships; based on the initial knowledge graph data, calling the knowledge graph reasoning model to obtain the completed target knowledge graph data, the knowledge graph reasoning model is a model pre-trained based on reinforcement learning, and each target data group in the target knowledge graph data includes head entities, entity relationships, and tail entities. The embodiment of the patent performs knowledge reasoning on the initial knowledge graph by calling the knowledge graph reasoning model trained based on reinforcement learning, without considering changes over time, and uses multiple trainings to improve the knowledge graph.
[0006] Therefore, how to efficiently process newly emerging entities in the knowledge graph and consider the uncertainty in knowledge reasoning is the core issue of the present invention.
[0007] In addition, on the one hand, there are differences in understanding among those skilled in the art; on the other hand, the applicant studied a large number of documents and patents when making the present invention, but due to space limitations, not all details and contents are listed in detail. However, this does not mean that the present invention does not have the characteristics of these prior arts. On the contrary, the present invention already has all the characteristics of the prior art, and the applicant reserves the right to add relevant prior art to the background technology. Summary of the invention
[0008] The knowledge graph reasoning model in the prior art has uncertainty, which leads to the phenomenon of long-tail distribution of training samples. The existing representation learning methods are all direct inference methods, which are difficult to extend to invisible entities. Therefore, the present invention proposes a Bayesian inductive reasoning method based on small sample learning. In order to achieve scalability, meta-learning will be used to perform inductive reasoning on invisible entities. The present invention also constructs a Bayesian graph neural network as a meta-learner to infer knowledge from the original knowledge graph to invisible entities. The trained knowledge graph reasoning model has the ability to adapt quickly and can infer new facts or emerging entities without retraining. The present invention models the uncertainty in the knowledge graph and models all entities and relationships as Gaussian distribution models. In addition, since newly emerging entities often have high uncertainty, the present invention incorporates the Bayesian graph neural network, a model that can estimate uncertainty, into the design of the meta-learner to complete the knowledge graph reasoning with uncertainty in real dynamic scenes.
[0009] In the real-world knowledge graph, a few entities have associated triples with a large number of data, while most entities have only a small number of triplets. This phenomenon of uneven distribution of the number of neighbors is called the long-tail distribution phenomenon.
[0010] In view of the shortcomings of the prior art, the present invention provides a knowledge graph reasoning method for Bayesian small sample learning, which at least includes:
[0011] A Gaussian distribution model is established based on entities and relationships in the knowledge graph to reduce the uncertainty of the knowledge graph;
[0012] Treat each entity as a task to simulate the meta-training process of newly emerged entities in the dynamic knowledge graph for task sampling;
[0013] Build a meta-learner based on graph neural network and perform random inference;
[0014] The meta-learner is trained to represent newly occurring entities using a support set.
[0015] The present invention can infer knowledge from the original knowledge graph to invisible entities. The trained knowledge graph reasoning model has the ability to adapt quickly and can infer new facts or emerging entities without retraining. In addition, since newly emerging entities often have high uncertainty, the present invention incorporates the Bayesian graph neural network, a model that can estimate uncertainty, into the meta-learner to complete the knowledge graph reasoning with uncertainty in real dynamic scenes.
[0016] Preferably, the step of establishing a Gaussian distribution model based on entities and relationships in the knowledge graph includes:
[0017] The head entity, relationship, and tail entity are represented as: μ represents the position of the entity or relationship in the vector space, ∑ represents the covariance, and its size is positively correlated with the uncertainty of the relationship or entity;
[0018] The transformation from head entity to tail entity is represented as
[0019] The scoring function is defined based on the KL divergence and is used to calculate the confidence of the triple.
[0020] By calculating the confidence of the triples, the parameters of the meta-learner can be optimized.
[0021] Preferably, the score function for calculating the reliability of the triple is:
[0022] s(e h ,r,e t )=KL(P r , P e ),
[0023] Among them, s represents the score function of the triple, e h represents the head entity, r represents the relationship, e t Represents the tail entity, Pr Represents the relationship division, P e Represents the transformation distribution.
[0024] Preferably, the step of performing task sampling by simulating the meta-training process of newly appearing entities in the dynamic knowledge graph at least includes:
[0025] The original data set is divided into at least a meta-training set containing simulated emerging entities and a meta-testing set containing real emerging entities;
[0026] sampling simulated emerging entities based on a meta-training process of the meta-training set;
[0027] Maximize the triple score of the query set based on the scoring function.
[0028] Preferably, the step of constructing a meta-learner based on a graph neural network includes at least:
[0029] Build a meta-learner based on Bayesian neural networks and relationships in knowledge graphs,
[0030] The meta-learner is expressed as:
[0031]
[0032] Among them, f(θ) represents the weight, B represents the Bayesian neural network, express------.
[0033] A Bayesian neural network is used to learn a prior distribution based on the weights f(θ) to model and reason about the uncertainty of emerging entities.
[0034] The meta-learner of our invention has the ability to use the support set to represent truly new entities without the need for fine-tuning or retraining.
[0035] Preferably, the step of training the meta-learner at least comprises:
[0036] Calculate the gradient in the loss function based on the query set and the negative query set, thereby updating and optimizing the parameters of the knowledge graph reasoning model based on the gradient descent data;
[0037] To support set S i As input, e′ i The representation of is used as the output to train the meta-learner.
[0038]
[0039] Among them, f(θ) represents the weight, S i represents the support set, e′ i Indicates a newly appeared entity.
[0040] Preferably, the step of training the meta-learner further comprises:
[0041] Minimize the KL divergence between the prior and posterior distributions:
[0042]
[0043] The objective function is expressed as:
[0044] Among them, q(θ) represents the hypothesized distribution used to fit Pr(θ), Pr(θ) represents the true distribution of the parameter, and Pr(D|θ) represents the distribution of the training data set.
[0045] The KL divergence is used as the scoring function to calculate the reliability or confidence of the knowledge graph triples. As the posterior of these Gaussian distributions converges to training, the uncertainty in the knowledge graph is reduced and fitted.
[0046] Preferably, in the meta-training set M tr New entities in , including:
[0047] The corresponding support set and
[0048] Query Set
[0049] Among them, n(e′ i ) represents the number of adjacent triples of the newly appeared entity, N represents the size of the small sample, and e′ i Indicates a newly appeared entity.
[0050] The present invention also provides a knowledge graph reasoning system for Bayesian small sample learning, comprising at least a processor, wherein the processor is configured to:
[0051] A Gaussian distribution model is established based on entities and relationships in the knowledge graph to reduce the uncertainty of the knowledge graph;
[0052] Treat each entity as a task to simulate the meta-training process of newly emerged entities in the dynamic knowledge graph for task sampling;
[0053] Build a meta-learner based on graph neural network and perform random inference;
[0054] The meta-learner is trained to represent newly occurring entities using a support set.
[0055] The present invention also provides a knowledge graph reasoning model for Bayesian small sample learning, wherein the knowledge graph reasoning model at least includes:
[0056] Building Gaussian distribution models based on entities and relationships in the knowledge graph; and
[0057] Meta-learner built on top of graph neural networks. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a logical schematic diagram of a reasoning method of a knowledge reasoning model provided by the present invention.
[0059] Reference numerals list
[0060] 1: Support set; 2: Query set; 3: First knowledge graph; 4: Second knowledge graph; 5: Meta learner; 6: Newly emerged entities. DETAILED DESCRIPTION
[0061] The following is a detailed description with reference to the accompanying drawings.
[0062] The present invention provides a knowledge graph reasoning method, system and reasoning model for Bayesian small sample learning. The present invention also provides an electronic device capable of allowing the knowledge graph reasoning method for Bayesian small sample learning of the present invention.
[0063] The electronic device in the present invention refers to an electronic device that can run the knowledge graph reasoning program of Bayesian small sample learning, such as a server, a computer, a mobile computer, a smart phone, a dedicated processor, etc.
[0064] The electronic device in the present invention includes at least a processor and a memory, wherein the processor is capable of running the encoding information of the knowledge graph reasoning method of Bayesian small sample learning, and the memory is used to store the encoding information of the knowledge graph reasoning method.
[0065] The knowledge graph reasoning system for Bayesian small sample learning in the present invention includes at least a processor, and the processor is capable of running the knowledge graph reasoning program for Bayesian small sample learning.
[0066] The processor in the present invention may also be a dedicated integrated chip, a microprocessor, or other electronic component that can run the encoded information of the knowledge graph reasoning method.
[0067] The knowledge graph reasoning system of the present invention may also include a first computing unit, a sampling computing unit and a second computing unit.
[0068] The first computing unit is a processor or a dedicated integrated chip that can establish a Gaussian distribution model based on entities and relationships in the knowledge graph.
[0069] The sampling computing unit is a processor or a dedicated integrated chip that can execute the meta-training process of simulating the newly emerged entities in the dynamic knowledge graph and perform the steps of task sampling. That is, the sampling computing unit can run the encoding information that realizes the steps of simulating the newly emerged entities in the dynamic and realizes the task sampling.
[0070] The second computing unit, also called a meta-learner, is a processor or a dedicated integrated chip that can run the representation function of the meta-learner and implement the encoded information of the reasoning process.
[0071] The first computing unit and the second computing unit establish a data transmission relationship through at least one data connection port. The first computing unit is also provided with a data input port for receiving data such as entities, relationships, and tail entities in the knowledge graph.
[0072] The sampling computing unit establishes a data transmission relationship with the first computing unit through at least one data transmission port to receive the sampling data sent by the first computing unit. The sampled data may be, for example, a newly appeared entity that appears dynamically.
[0073] The sampling calculation unit establishes a data transmission relationship with the second calculation unit through at least one data transmission port to send the Gaussian distribution model to the second calculation unit.
[0074] The knowledge graph reasoning system also includes a storage unit, which is at least used to store data, functions, output results and other information related to the knowledge graph reasoning process. The storage module is, for example, a storage medium such as RAM, ROM, disk, chip, etc. The storage unit and the first computing unit establish a data transmission relationship through at least one data transmission port, so that the first computing unit can retrieve the required Gaussian distribution model data from the storage unit. The storage unit and the second computing unit establish a data transmission relationship through at least one data transmission port, so that the first computing unit can retrieve the required meta-learner representation function, score function, loss function and objective function from the storage unit to perform meta-learner training and actual knowledge graph reasoning.
[0075] In the storage information of the storage unit, the function at least includes a Gaussian distribution model, a meta-learner representation function, a score function, a loss function, and an objective function. The data at least includes a support set, a query set, a negative query set, and parameters. The output result at least includes a newly appeared entity.
[0076] The knowledge graph reasoning method of Bayesian small sample learning in the present invention is as follows: Figure 1 As shown, the method at least includes:
[0077] S1: Establish a Gaussian distribution model based on entities and relationships in the knowledge graph to reduce the uncertainty of the knowledge graph;
[0078] S2: Treat each entity as a task to simulate the meta-training process of newly emerged entities in the dynamic knowledge graph and perform task sampling;
[0079] S3: Building a meta-learner based on graph neural network and performing random inference;
[0080] S4: Train the meta-learner to represent new entities using the support set.
[0081] The present invention provides a detailed description of each step.
[0082] Building a Gaussian distribution model based on entities and relationships in the knowledge graph means learning the entity relationship link data of the knowledge graph itself as a structural vector representation. Specifically, the entities and relationships in the knowledge graph are modeled as a representation of probability distribution, rather than a vectorized representation of a real number, to fit the uncertainty in the knowledge graph.
[0083] Assuming that each entity and relationship in the knowledge graph follows a certain Gaussian distribution, thus allowing approximate statistical uncertainty, the head entity, relationship, and tail entity are represented as: μ represents the position of an entity or relationship in the vector space, and ∑ represents the covariance, whose size is positively correlated with the uncertainty of the relationship or entity.
[0084] The transformation from head entity to tail entity is represented as At the representation level, this transformation makes the relation distribution P r and the transformation distribution P e As close as possible.
[0085] The scoring function is defined based on the KL divergence and is used to calculate the confidence of the triple.
[0086] The KL divergence is used as the scoring function to calculate the reliability or confidence of the knowledge graph triples. As the posterior of these Gaussian distributions converges to training, the uncertainty in the knowledge graph is reduced and fitted.
[0087] KL divergence (Kullback-Leibler divergence) is a measure of the asymmetry of the difference between two probability distributions P and Q.
[0088] The scoring function used to calculate the reliability of a triple is:
[0089] s(e h ,r,e t )=KL(P r , P e ),
[0090] Among them, s represents the score function of the triple, e h represents the head entity, r represents the relationship, e t Represents the tail entity, P r Represents the relationship division, P e Represents the transformation distribution.
[0091] The present invention performs task sampling by simulating the meta-training process of newly appearing entities in a dynamic knowledge graph.
[0092] like Figure 1 As shown, the observed first knowledge graph 3 is converted into a second knowledge graph 4 containing the newly appeared entities.
[0093] Task division, i.e., a meta-training process based on task sampling to simulate entities appearing in a dynamic knowledge graph. Specifically, the original dataset is divided into at least a meta-training set containing simulated newly appearing entities and a meta-test set containing real newly appearing entities.
[0094] The meta-training process based on the meta-training set samples the newly emerged entities for simulation. Figure 1 As shown in Figure 2, during the meta-training process, each training task will have some new entities e′ i Each new entity has a corresponding support set 1 and query set 2. The support set is represented as: The query set is represented as:
[0095] The support set refers to: the set of N triples associated with entity e is used as the support set, which will be used as the input of the meta-learner to obtain the embedding representation of entity e. The N triples associated with the entity will be used as the support set, and the remaining triples will all be used as the query set.
[0096] The purpose of task sampling during meta-training is to use the support set and meta-learner f θ Represents the newly appeared entity e′ i Then use the scoring function to maximize the triple score on the query set.
[0097] Represents the score function when the triple is maximized.
[0098] In the present invention, the meta-training process is part of the meta-learning framework. The meta-learning framework is divided into two parts: meta-training and meta-testing. In the meta-training process, the parameters in the meta-learner are trained and updated, wherein the meta-learner takes the support set in the meta-training process as input, outputs the representation of the node, and then updates the parameters in the meta-learner through the data in the query set.
[0099] Task sampling aims to divide the original data set into two parts: the support set and the query set. In this task, the output is first obtained by inputting the support set into the meta-learner, and then the output error is calculated through the data in the query set to complete the parameter update.
[0100] f θ The function that takes the support set as input is the meta-learner. The meta-learner is a function that takes the support set as input.
[0101] The purpose of building a meta-learner based on a graph neural network is to transfer the knowledge in the original knowledge graph to the newly emerged entities through the support set. Since the graph neural network has the ability to capture the graph structure, the present invention selects the graph neural network as the meta-learner. In the present invention, the meta-learner can aggregate the heterogeneous neighbors of the entity and output the representation of the newly emerged entity. tr The meta-learner is then studied on the meta-test set M te The trained meta-learner is evaluated and updated.
[0102] The meta-learner is the main part of the meta-learning framework, and its main function is to extract meta-knowledge. In the present invention, the meta-learner is designed based on a graph neural network. Figure 1 As shown, the meta-learner 5 takes the support set as input, outputs the embedding representation of the entity, and then calculates the error through the query set to update the parameters in the meta-learner.
[0103] However, the difference between knowledge graph and traditional graph structure is that the edges in knowledge graph represent relationships, which have the same importance as entity nodes. Due to the high uncertainty of newly emerged entities and the difference between knowledge graph and traditional graph structure, this paper introduces Bayesian neural network and relationship edges in knowledge graph into the design of graph neural network.
[0104] S31: Building meta-learners based on Bayesian neural networks and relations in knowledge graphs.
[0105] S32: The meta-learner is represented as:
[0106]
[0107] Among them, f(θ) represents the weight, B represents the Bayesian neural network, Represents the entity e′ i The number of connected relationship-entity pairs.
[0108] Typically, the transmitted information will be transformed through a linear neural network or a weight matrix in. However, since the reasoning of newly emerged entities has a high uncertainty, the present invention models and infers the uncertainty of emerging entities based on the weights f(θ) following the Bayesian neural network learning prior distribution. After the meta-learner is trained, the knowledge graph reasoning model can learn the variational approximation of the Bayesian posterior distribution. Due to the uncertainty of the weights of the Bayesian neural network, the output of the meta-learner is also a random variable, which can achieve random reasoning.
[0109] In the present invention, the meta-training set is used to train the meta-learner. After sufficient training with the meta-training set, the knowledge graph reasoning model learned by the meta-learner can solve the real new entities in the meta-test set. When the meta-learner training is completed, the meta-learner can use the support set to represent the real new entities without fine-tuning or retraining.
[0110] The steps for training a meta-learner using the meta-training set are as follows.
[0111] Each query set contains only positive triples Q i ={(e′ i ,r,e)|e∈E′}.
[0112] During the meta-training process, for the query set of updated parameters, a negative query set is constructed for the query set. The negative query set is constructed as:
[0113] The negative query set contains all wrong triplets. The query set contains all correct triplets. The purpose of constructing the negative query set is to improve the model's ability to identify negative examples in the loss function.
[0114] Specifically, one element in the correct triplet is replaced with any other element in order to enable the model to distinguish between positive and negative examples.
[0115] The query set is represented as: The N triples associated with the entity will be used as the support set, and the remaining triples will all be used as the query set. The query set is used to update the model parameters.
[0116] The principle of updating parameters of the query set is to maximize the score function of the triples in the query set, calculate the gradient in the loss function, and perform gradient descent to update the model parameters.
[0117] The loss function is expressed as:
[0118] The loss function is the basis for updating the model parameters. The purpose of updating the parameters is achieved by calculating the gradient of the loss function and performing gradient descent on the parameters.
[0119] For the newly emerged entity e′ i The meta-learner supports the query set S i As input, e′ i The representation of is taken as output. Among them, f(θ) represents the weight, S i represents the support set, e′ i Indicates a newly appeared entity.
[0120] The weights f of the meta-learner θSampling from the posterior distribution ensures uncertainty through posterior sampling and achieves random inference.
[0121] Since the posterior distribution Pr(θ|D) is difficult to solve, the present invention adopts a variational method and uses the distribution q defined by the parameter θ θ Approximating the true posterior distribution Pr(θ|D). The present invention converts the problem of finding the posterior distribution into an optimization problem of finding the optimal parameter θ by minimizing the KL divergence of the prior distribution and the posterior distribution.
[0122] The steps to minimize the KL divergence between the prior and posterior distributions are:
[0123]
[0124] The objective function is expressed as:
[0125] Among them, q(θ) represents the hypothesized distribution used to fit Pr(θ), Pr(θ) represents the true distribution of the parameter, and Pr(D|θ) represents the distribution of the training data set.
[0126] After sufficient training on the meta-training set, the learned model is able to solve for real emerging entities in the meta-test set. In the meta-test, each emerging entity also has its own support set and query set. In the case where the meta-learner is trained, the meta-learner uses its support set to represent the real emerging entities without fine-tuning or retraining.
[0127] In the meta-training set M tr New entities in , including:
[0128] The corresponding support set and
[0129] Query Set
[0130] Among them, n(e′ i ) represents the number of adjacent triples of the newly appeared entity, N represents the size of the small sample, and e′ i Indicates a newly appeared entity.
[0131] The meta-learner is trained on the meta-training set M tr After sufficient training, the learned knowledge reasoning model can solve the meta-test set M te In the meta-test, each emerging entity also has its own support set and query set. After the meta-learner is trained, it is capable of using its support set to represent the true emerging entities without fine-tuning.
[0132] The present invention also provides a knowledge graph reasoning model for Bayesian small sample learning, and the knowledge graph reasoning model at least includes:
[0133] Building Gaussian distribution models based on entities and relationships in the knowledge graph; and
[0134] Meta-learner built on top of graph neural networks.
[0135] The meta-learner is represented as:
[0136]
[0137] Among them, f(θ) represents the weight, B represents the Bayesian neural network, Represents the entity e′ i The number of connected relationship-entity pairs.
[0138] A Bayesian neural network is used to learn a prior distribution based on the weights f(θ) to model and reason about the uncertainty of emerging entities.
[0139] like Figure 1 As shown, meta-learner 5 supports the set S i As input, e′ i The representation of is used as the output to train the meta-learner.
[0140] Among them, f(θ) represents the weight, S i Denotes support set 1, e′ i Indicates the newly appeared entity 6.
[0141] The knowledge graph reasoning model also includes a loss function. In the process of training the meta-learner, the gradient in the loss function is calculated based on the query set and the negative query set, so as to update and optimize the parameters of the knowledge graph reasoning model based on the gradient descent data.
[0142] Among them, the knowledge graph reasoning model also includes the objective function:
[0143] Among them, q(θ) represents the hypothesized distribution used to fit Pr(θ), Pr(θ) represents the true distribution of the parameter, and Pr(D|θ) represents the distribution of the training data set.
[0144] The knowledge graph reasoning model of the present invention also includes a scoring function for calculating the reliability of a triple.
[0145] The implementation principle of the knowledge graph reasoning model is described as follows.
[0146] First, the entities and relations in the knowledge graph are modeled as Gaussian distributions to fit the uncertainty. This method is mainly implemented based on the meta-learning framework, including meta-training and meta-testing.
[0147] The knowledge graph reasoning model needs to go through a meta-training process. During the meta-training process, the dataset is divided into a support set and a query set. In order to learn the meta-knowledge in the dataset, the support set of a newly appeared entity is input into the meta-learner to obtain the embedding representation of the current entity. The current representation is brought into the query set to calculate the score of the triple, and the parameters of the meta-learner are gradient optimized to obtain the learned parameters.
[0148] After the meta-training process is completed, the optimized parameters are obtained, that is, the knowledge graph model can be directly deployed to the real scene, and the associated triples of the entity, that is, the support set in the meta-testing process, are input into the meta-learner to obtain the embedding representation of the newly appeared entity. Then, the reasoning task is completed based on the current embedding representation.
[0149] It should be noted that the above-mentioned specific embodiments are exemplary, and those skilled in the art can come up with various solutions inspired by the disclosure of the present invention, and these solutions also belong to the disclosure scope of the present invention and fall within the protection scope of the present invention. Those skilled in the art should understand that the present invention specification and its drawings are illustrative and do not constitute a limitation on the claims. The scope of protection of the present invention is defined by the claims and their equivalents. The present invention specification contains multiple inventive concepts, such as "preferably", "according to a preferred embodiment" or "optionally", all of which indicate that the corresponding paragraph discloses an independent concept, and the applicant reserves the right to file a divisional application based on each inventive concept.
Claims
1. A knowledge graph reasoning method for Bayesian small sample learning, characterized in that: The method at least comprises: A Gaussian distribution model is established based on entities and relationships in the knowledge graph to reduce the uncertainty of the knowledge graph; Treat each entity as a task to simulate the meta-training process of newly emerged entities in the dynamic knowledge graph and perform task sampling; Build a meta-learner based on graph neural network and perform random inference; training the meta-learner to represent new entities using a support set; The steps of establishing a Gaussian distribution model based on entities and relationships in the knowledge graph include: The head entity, relationship, and tail entity are represented as: μ represents the position of the entity or relationship in the vector space, ∑ represents the covariance, and its size is positively correlated with the uncertainty of the relationship or entity; The transformation from head entity to tail entity is represented as The score function is defined based on KL divergence and used to calculate the reliability of the triple; The steps of building a meta-learner based on a graph neural network include at least: Build a meta-learner based on Bayesian neural networks and relationships in knowledge graphs, The meta-learner is expressed as: Among them, f(θ) represents the weight, B represents the Bayesian neural network, Represents the entity e′ i The number of connected relationship-entity pairs; A Bayesian neural network is used to learn a prior distribution based on the weights f(θ) to model and reason about the uncertainty of emerging entities.
2. The knowledge graph reasoning method for Bayesian small sample learning according to claim 1 is characterized in that: The scoring function used to calculate the reliability of a triple is: s(e h ,r,e t )=KL(P r ,P e ), Among them, s represents the score function of the triple, e h represents the head entity, r represents the relationship, e t Represents the tail entity, P r Represents the relationship division, P e Represents the transformation distribution.
3. The knowledge graph reasoning method for Bayesian small sample learning according to claim 2 is characterized in that: The steps of simulating the meta-training process of newly appearing entities in the dynamic knowledge graph and performing task sampling include at least: The original data set is divided into at least a meta-training set containing simulated emerging entities and a meta-testing set containing real emerging entities; sampling simulated emerging entities based on a meta-training process of the meta-training set; Maximize the triple score of the query set based on the scoring function.
4. The knowledge graph reasoning method for Bayesian small sample learning according to any one of claims 1 to 3, characterized in that: The steps of training the meta-learner include at least: Calculate the gradient in the loss function based on the query set and the negative query set, thereby updating and optimizing the parameters of the knowledge graph reasoning model based on the gradient descent data; To support set S i As input, e′ i The representation of is used as the output to train the meta-learner. Among them, f(θ) represents the weight, S i represents the support set, e′ i Indicates a newly appeared entity.
5. The knowledge graph reasoning method for Bayesian small sample learning according to claim 4 is characterized in that: The step of training the meta-learner also includes: Minimize the KL divergence between the prior and posterior distributions: The objective function is expressed as: Among them, q(θ) represents the hypothesized distribution used to fit Pr(θ), Pr(θ) represents the true distribution of the parameter, and Pr(D|θ) represents the distribution of the training data set.
6. The knowledge graph reasoning method for Bayesian small sample learning according to claim 3 is characterized in that: In the meta-training set M tr New entities in , including: The corresponding support set and Query Set Among them, n(e′ i ) represents the number of adjacent triples of the newly appeared entity, N represents the size of the small sample, and e′ i Indicates a newly appeared entity.
7. A knowledge graph reasoning system for Bayesian small sample learning, characterized in that: At least comprising a processor, wherein the processor is configured to: A Gaussian distribution model is established based on entities and relationships in the knowledge graph to reduce the uncertainty of the knowledge graph; Treat each entity as a task to simulate the meta-training process of newly emerged entities in the dynamic knowledge graph and perform task sampling; Build a meta-learner based on graph neural network and perform random inference; training the meta-learner to represent new entities using a support set; The steps of establishing a Gaussian distribution model based on entities and relationships in the knowledge graph include: The head entity, relationship, and tail entity are represented as: μ represents the position of the entity or relationship in the vector space, ∑ represents the covariance, and its size is positively correlated with the uncertainty of the relationship or entity; The transformation from head entity to tail entity is represented as The score function is defined based on KL divergence and used to calculate the reliability of the triple; The steps of building a meta-learner based on a graph neural network include at least: Build a meta-learner based on Bayesian neural networks and relationships in knowledge graphs, The meta-learner is expressed as: Among them, f(θ) represents the weight, B represents the Bayesian neural network, Represents the entity e′ i The number of connected relationship-entity pairs; A Bayesian neural network is used to learn a prior distribution based on the weights f(θ) to model and reason about the uncertainty of emerging entities.
8. A knowledge graph inference model for Bayesian small sample learning, characterized in that: The knowledge graph reasoning model at least includes: Building Gaussian distribution models based on entities and relationships in the knowledge graph; and Meta-learner built on graph neural networks; The steps of establishing a Gaussian distribution model based on entities and relationships in the knowledge graph include: The head entity, relationship, and tail entity are represented as: μ represents the position of the entity or relationship in the vector space, ∑ represents the covariance, and its size is positively correlated with the uncertainty of the relationship or entity; The transformation from head entity to tail entity is represented as The score function is defined based on KL divergence and used to calculate the reliability of the triple; The steps of building a meta-learner based on a graph neural network include at least: Build a meta-learner based on Bayesian neural networks and relationships in knowledge graphs, The meta-learner is expressed as: Among them, f(θ) represents the weight, B represents the Bayesian neural network, Represents the entity e′ i The number of connected relationship-entity pairs; A Bayesian neural network is used to learn a prior distribution based on the weights f(θ) to model and reason about the uncertainty of emerging entities.
Citation Information
Patent Citations
Knowledge graph reasoning method and device and storage medium
CN112084344A
Knowledge reasoning method and system of knowledge graph based on meta-knowledge and medium
CN111260064A
Few-sample knowledge graph completion method based on meta-learning
CN113239131A
