Reptile-based Meta-Learning Open World Knowledge Graph Completion Method

Through the Reptile-based meta-learning method, using Bi-LSTM and CNN to generate entity and relationship embedding representations, the problem of insufficient samples under long-tail distribution of the knowledge graph completion model is solved, and rapid adaptation to new tasks and efficient link establishment are achieved.

CN116756337BActive Publication Date: 2025-07-18JILIN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310721070.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-19
Publication Date
2025-07-18
Estimated Expiration
2043-06-19

AI Technical Summary

Technical Problem

The lack of sufficient samples in the long-tail distribution phenomenon of existing knowledge graph completion models makes it difficult to perform the task of small-sample knowledge graph completion, and existing methods fail to make full use of the semantic information of entities and relationships, especially in the open world, to process new invisible entities.

Method used

Using a Reptile-based meta-learning method, the model is quickly updated to adapt to new tasks by dividing the open knowledge graph into a meta-training set, a meta-verification set and a meta-test set, and using Bi-LSTM and CNN models to generate embedded representations of entities and relationships.

Benefits of technology

It improves the generalization ability of the model under the long-tail distribution, can effectively establish a link between visible entities and invisible entities, solves the problem of few samples, and improves the efficiency and accuracy of knowledge graph completion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116756337B_ABST
    Figure CN116756337B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of knowledge graph completion, specifically a meta-learning open-world knowledge graph completion method based on Reptile. The method includes: S1. Obtain the open knowledge graph to be completed and the text descriptions of the entities and relationships therein; S2. Divide the open knowledge graph to be completed into a meta-training set, a meta-validation set, and a meta-test set according to different task relationships in proportion; S3. Obtain a few-shot open-world knowledge graph completion model through training for several batches; S4. Quickly update the parameters of the few-shot open-world knowledge graph completion model obtained in step S3 through a small number of samples of task relationships to obtain a model that can adapt to new tasks; S5. Use the few-shot open-world knowledge graph completion model obtained in step S4 to complete the meta-test task. The present invention can establish links between visible entities and visible entities, and between invisible entities and visible entities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of knowledge graph completion, and specifically to a meta-learning open-world knowledge graph completion method based on Reptile. Background Art

[0002] Knowledge is the cognition of the world by humans and also the summary of the empirical laws by humans. Artificial intelligence is a field of exploration by humans combining knowledge and the way of thinking about problems. Through the exploration of the field of artificial intelligence, Internet applications such as Google Search Engine, Baidu Search Engine, and recommendation systems have emerged and provided services for humans. A knowledge graph is a large-scale knowledge base that integrates multi-source data from the network and other multiple knowledge bases, expressing the knowledge in the real world in a structured manner, mainly composed of entities and relationships between entities. Among them, entities represent objects or abstract concepts in the real world, and relationships represent the connections or attributes between entities. The proposal of the concept of the knowledge graph has promoted the development of search engines and attracted extensive attention from scholars at home and abroad. The knowledge graph completion task is an extremely important direction in the field of knowledge graphs. Currently, it is mainly divided into a closed-world knowledge graph completion task and an open-world knowledge graph completion task.

[0003] In the field of closed-world knowledge graph completion, the GMatching model proposed by Xiong et al. proposes a neighbor encoder that aggregates single-hop neighbor information to enrich entity representations, and then uses a long short-term memory network (LSTM) to design a matching processor to match the feature representations of entity pairs obtained by the neighbor encoder, and finally outputs a similarity score. Chen et al. proposed the MetaR model that designs a relation meta-learner and an embedding learner. The relation meta-learner mainly learns relation metas from entity embeddings and relation embeddings in a small number of sample triples, and the embedding learner realizes the optimization and rapid update of relation metas by calculating gradient metas. The existing knowledge graphs are automatically constructed by heuristic algorithms extracting information from a large number of different types, which results in a large amount of incorrect knowledge in the knowledge graphs. To address the above problems, the REFORM model proposed by Wang et al. includes three parts: a neighbor encoder, a cross-relation aggregator, and an error mitigator. The neighbor encoder selects reliable neighbors through an attention mechanism, then uses the cross-relation aggregator to capture the correlation between relationships in the sample tasks, and finally uses a GCN-based error mitigator to reduce the impact of incorrect triples in the prediction phase.

[0004] In the field of open-world knowledge graph completion, the TCVAE model proposed by Wang et al. includes a description encoder, a triple generator, and a meta-learner. The description encoder uses the text descriptions of entities and relationships to generate embedding representations, and proposes relationship-based entity features to assist in learning the representations of entity embeddings. The triple generator is used to generate artificial imitation triple data of the triple embeddings generated by the description encoder, and these triple data are used as real data for data augmentation. The meta-learner is used to optimize the model so that the model can better adapt to new entities and relationships. Mirtaheri et al. believe that new relationships may appear in the knowledge graph over time, so they designed a link prediction model for temporal knowledge graphs, which adopts a self-attention mechanism to effectively encode the temporal domain information between entities.

[0005] Currently, most embedding-based knowledge graph completion models require a large number of triples for training, but the long-tail distribution phenomenon in the knowledge graph does not provide enough samples. This link prediction task caused by the long-tail distribution phenomenon is also known as the few-shot knowledge graph completion task. Using the meta-learning method is one of the important means to solve the few-shot problem. In recent years, some researchers have tried to apply meta-learning to the few-shot knowledge graph completion task. The core idea of meta-learning is to let the machine learn to learn, and to accelerate network training by optimizing the model's parameters or learning algorithms. Currently, the following disadvantages exist in using the meta-learning method:

[0006] On the one hand, in the closed-world knowledge graph completion method, only long-tail relationships are considered, and it is defaulted that entities have a certain number of neighbors, and the local neighbor structure of entities is used to learn the embedding representations of entities; on the other hand, in the open-world knowledge graph completion method, the method proposed by Wang et al. considers both long-tail entities and long-tail relationships, but the CNN used in its description encoder can only capture local features of text descriptions, and does not make good use of the context features of entity and relationship descriptions, while other methods only consider long-tail relationships or long-tail entities in the knowledge graph. Therefore, in view of the above situation, there is an urgent need to develop a Reptile-based meta-learning open-world knowledge graph completion method to overcome the deficiencies in current practical applications. Summary of the Invention

[0007] The purpose of the present invention is to provide a Reptile-based meta-learning open-world knowledge graph completion method to solve the problems raised in the above background technology.

[0008] To achieve the above purpose, the present invention provides the following technical solutions:

[0009] A Reptile-based meta-learning open-world knowledge graph completion method, the method includes:

[0010] S1. Obtain the open knowledge graph to be completed and the text descriptions of the entities and relationships therein;

[0011] S2. Divide the open knowledge graph to be completed into a meta-training set, a meta-validation set, and a meta-test set according to different task relationships and in proportion;

[0012] S3. Obtain a few-shot open-world knowledge graph completion model through several batches of training;

[0013] S4. Quickly update the parameters of the few-shot open-world knowledge graph completion model obtained in step S3 through a small number of samples of task relationships to obtain a model that can adapt to new tasks;

[0014] S5. Use the few-shot open-world knowledge graph completion model obtained in step S4 to complete the meta-test task.

[0015] As a further solution of the present invention: In step S2, the data sets divided in proportion form a triple set. During the training process, the validation process, or the test process, select a triple set of a task relationship as the meta-training task, the meta-validation task, or the meta-test task.

[0016] As a further solution of the present invention: The meta-training task, the meta-validation task, and the meta-test task respectively correspond to the meta-training stage, the meta-validation stage, and the meta-test stage;

[0017] Among them, during the meta-training stage, a few-shot open-world knowledge graph completion model is obtained through several batches of training.

[0018] As a further solution of the present invention: According to the Reptile method, the meta-test stage includes a training stage and a test stage. Among them, in the training stage of the meta-test stage, a small number of samples of task relationships are used to quickly update the model parameters to quickly adapt to new tasks.

[0019] As a further solution of the present invention: The specific steps of dividing the data set are as follows:

[0020] (1) For the data set D, divide the triples in the data set into different tasks D r ={(h i , r, t i )|(h i , r, t i ) ∈ F};

[0021] (2) Further divide all tasks into a meta-training set T train , a meta-validation set T val , and a meta-test set T test .

[0022] As a further solution of the present invention: the meta-test set T test each task D test in is divided into a reference set S test and a query set Q test , the reference set is denoted as S test ={(h i , r test , t i )|(h i , r test , t i )∈F}, S test is a sample set used to quickly update the model parameters, and the size of the reference set is uniformly K;

[0023] Each missing triple (h, r,?) is defined as a query triple, then the query set Q test ={(h i , r test ,?)};

[0024] The meta-validation set T val ={S val , Q val}.

[0025] As a further solution of the present invention: the meta-training set T train is not divided into a reference set and a query set. During the meta-training process, it is limited that each task relationship has K sample triples, and the model is trained through K samples.

[0026] As a further solution of the present invention: in the training stages of the meta-training phase and the meta-test phase, the scoring function of TransE is used to score the positive and negative example triples. The TransE scoring function is as follows:

[0027] score(h, t)=||e h +e r -e t ||;

[0028] where, e h is the head entity embedding; e t is the tail entity embedding; e r is the relationship embedding.

[0029] As a further solution of the present invention: in the training stages of the meta-training phase and the meta-test phase, the hinge loss function is used to define the loss function of the model:

[0030] L=[γ + score(h, t)-score(h, t′)] + ;

[0031] Among them, score(h,t) and score(h,t′) are the matching scores of the positive example triple and the negative example triple respectively, and the negative example triple is obtained by randomly replacing the tail entity of the positive example triple; γ is a margin hyperparameter greater than 0, which is used to distinguish the margin between positive and negative triples; [x] + = max{0, x} represents the standard hinge loss function.

[0032] As a further solution of the present invention: the embedding representations of the head entity, tail entity and relationship are generated by combining the Bi-LSTM and CNN models.

[0033] Compared with the prior art, the beneficial effects of the present invention are:

[0034] Traditional open-world knowledge graph completion models are trained under the condition of sufficient relation samples. When the number of relation samples is set to K, these models cannot fully learn the semantic information of entities and relations. However, the present invention can effectively solve the problem of few training samples by designing the Reptile meta-learning method. Compared with the closed-world knowledge graph completion models based on meta-learning, since these models mainly consider the local neighborhood information of visible entities and visible entities, they cannot handle the situation where new invisible entities appear. By setting tasks based on the Reptile meta-learning method, the dataset has the following characteristics:

[0035] (1) The tasks between the meta-training set, meta-validation set and meta-test set are completely non-overlapping. After the model is trained using the meta-training set, it processes new tasks on the meta-test set and meta-validation set, making the model have good generalization ability;

[0036] (2) Since the rarer the long-tail relationship appears, the entities involved also show a long-tail distribution. The present invention constructs the dataset through task relationships. The entities in the meta-test set and meta-validation set only appear several times or zero times in the meta-training set. Similarly, the entities in the query set of the meta-test set also only appear several times or zero times in the reference set. Therefore, the dataset constructed based on the Reptile meta-learning method meets the purpose of the present invention that the model can establish links between visible entities and visible entities, invisible entities and visible entities. Description of the Drawings

[0037] Figure 1 It is a flowchart of the meta-learning open-world knowledge graph completion method based on Reptile in an embodiment of the present invention.

[0038] Figure 2 It is a structural diagram of the Bi-LSTM network in an embodiment of the present invention.

[0039] Figure 3 It is a structural diagram of the CNN network in an embodiment of the present invention.

[0040] Figure 4 This is an example diagram of context encoding in an embodiment of the present invention.

[0041] Figure 5 This is an example diagram of feature extraction in an embodiment of the present invention. Detailed implementation manners

[0042] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0043] The following will describe the specific implementation of the present invention in detail in conjunction with specific embodiments.

[0044] Please refer to Figures 1 - 3 , the meta-learning open-world knowledge graph completion method based on Reptile provided by the embodiment of the present invention, the meta-learning open-world knowledge graph completion method based on Reptile includes:

[0045] 1. Obtain a data set, where the data set is an open-world knowledge graph to be completed and text descriptions of related entities and relationships;

[0046] 2. Divide the open knowledge graph to be completed into a meta-training set, a meta-validation set, and a meta-test set according to different task relationships in proportion. During the training process, the validation process, or the test process, select a triple set of a task relationship as the meta-training task, the meta-validation task, or the meta-test task;

[0047] 3. During the meta-training process, obtain a few-shot open-world knowledge graph completion model after several batches of training;

[0048] 4. Both the meta-validation phase and the meta-test phase include two parts. Taking the meta-test phase as an example, it includes a training phase and a test phase. In the training phase of the meta-test phase, the parameters of the few-shot open-world knowledge graph completion model obtained in step 3 are quickly updated through a small number of samples of the task relationship to obtain a model that can adapt to new tasks;

[0049] 5. Also taking the test phase of the meta-test phase as an example, use the few-shot open-world knowledge graph completion model obtained in step 4 to complete the meta-test task.

[0050] In step 2, the open knowledge graph to be completed is divided into a meta-training set, a meta-validation set, and a meta-test set according to different task relationships and proportions. During the training process, validation process, or test process, a triple set of a task relationship is selected as the meta-training task, meta-validation task, or meta-test task. The specific steps for dataset division are as follows:

[0051] a) For the dataset D, the triples in the dataset are divided into different tasks D r ={(h i , r, t i ) | (h i , r, t i ) ∈ F};

[0052] b) All tasks are further divided into a meta-training set T train , a meta-validation set T val , and a meta-test set T test according to a certain proportion;

[0053] c) According to the Reptile method, the meta-test phase includes two parts: the training phase of the meta-test phase and the test phase of the meta-test phase. The training phase of the meta-test is to quickly update the model parameters using a small number of samples of the task relationship to quickly adapt to new tasks.

[0054] Therefore, each task D test in the meta-test set T test is divided into a reference set S test and a query set Q test . The reference set is represented as S test ={(h i , r test , t i ) | (h i , r test , t i ) ∈ F}, and S test is a sample set used to quickly update the model parameters, and in the present invention, the size of the reference set is unified as K, and the value of K is usually very small.

[0055] Each missing triple (h, r,?) is defined as a query triple, then the query set Q test ={(h i , r test ,?)}, similarly, the meta-validation set T val ={S val , Q val}. The meta-training set is not divided into a reference set and a query set, but only limits that each task relationship has K sample triples during the meta-training process, and these K samples are used to train the model.

[0056] In the training phases of the meta-training phase and the meta-test phase mentioned in Step 3 and Step 4, the scoring function of TransE is used to score positive and negative example triples. The TransE scoring function is as follows:

[0057] score(h,t)=||e h +e r -e t ||;

[0058] Among them, e h is the head entity embedding, e t is the tail entity embedding, and e r is the relation embedding. The goal of training the model using this scoring function is to make e h +e t ≈e r . The lower the score, the higher the rationality of the triple. In these two training phases, the hinge loss function is used to define the loss function of the model:

[0059] L=[γ+score(h,t)-score(h,t′)] + ;

[0060] Among them, score(h,t) and score(h,t′) are the matching scores of the positive example triple and the negative example triple respectively. The negative example triple is obtained by randomly replacing the tail entity of the positive example triple; γ is an interval hyperparameter greater than 0, used to distinguish the interval between positive and negative triples; [x] + =max{0,x} represents the standard hinge loss function;

[0061] The present invention uses a Bi-LSTM and CNN model to generate the embedding representations of the head and tail entities and the relation in the triple, which is called the description encoder. Taking the head entity as an example, the steps to obtain the embedding representation are as follows:

[0062] A. Obtain the text description of the head entity h, and use word embedding techniques such as Word2Vec to obtain the corresponding word embedding matrix;

[0063] B. Input the word embedding matrix obtained in Step A into the Bi-LSTM to obtain the encoding with context information;

[0064] C. Use the CNN to perform the final feature extraction on the context encoding obtained in Step B.

[0065] Taking the description encoder as an example:

[0066] Bi-LSTM can make full use of the context information of each word, capture the evolution information of the sentence over time, and thus can capture long-distance dependencies. Figure 4It shows that Bi-LSTM encodes the text description "Lily is good at playing the piano" and obtains text features with forward and backward semantic information;

[0067] Figure 5 It shows the process of the first layer of CNN extracting features from the text features output by Figure 4 Bi-LSTM in. Each convolutional kernel has a size of 3 and a stride of 1, and the number of convolutional kernels is the same as the dimension of the word vector. In this model, the number of convolutional kernels for the two one-dimensional convolutions in each convolutional block is equal to the dimension size d of the word vector. Therefore, after N layers of CNN feature extraction, the text feature vector e ∈ R d .

[0068] The CNN adopted in the present invention includes a convolutional block and a pooling strategy. First, through two one-dimensional convolution operations, the global correlation in the text description is captured based on the translation characteristics, the data after convolution is normalized, and then the data features are output through a non-linear activation function; in the N-layer CNN operation, the pooling operation in the first N - 1 layers adopts the local maximum pooling strategy to extract key information, and the last layer adopts global average pooling to collect global feature information.

[0069] In summary, traditional open-world knowledge graph completion models are trained under the condition of sufficient relation samples. When the number of relation samples is set to K, these models cannot fully learn the semantic information of entities and relations. However, the present invention can effectively solve the problem of few training samples by designing the Reptile meta-learning method. Compared with the closed-world knowledge graph completion models based on meta-learning, since these models mainly consider the visible entities and the local neighborhood information of visible entities, they cannot handle the situation where new invisible entities appear. By setting tasks based on the Reptile meta-learning method, the dataset has the following characteristics:

[0070] The tasks between the meta-training set, the meta-validation set, and the meta-test set are completely non-overlapping. After the model is trained using the meta-training set, it processes new tasks on the meta-test set and the meta-validation set, making the model have good generalization ability;

[0071] Since the rarer the long-tail relation appears, the entities involved also show a long-tail distribution. The present invention constructs the dataset through task relations. The entities in the meta-test set and the meta-validation set only appear several times or zero times in the meta-training set. Similarly, the entities in the query set of the meta-test set also only appear several times or zero times in the reference set. Therefore, the dataset constructed based on the Reptile meta-learning method meets the purpose of the present invention that the model can establish links between visible entities and visible entities, and between invisible entities and visible entities.

[0072] It should be noted that in the present invention, it should be understood that although this specification is described according to embodiments, not every embodiment only contains an independent technical solution. This narrative manner of the specification is only for clarity. Those skilled in the art should regard the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A meta - learning open - world knowledge graph completion method based on Reptile, characterized in that The method includes: S1. Obtain the open knowledge graph to be completed and the text descriptions of entities and relationships therein; S2. Divide the open knowledge graph to be completed into a meta-training set, a meta-validation set, and a meta-test set according to different task relationships in proportion; S3. Obtain a few-shot open-world knowledge graph completion model through several batches of training; S4. Quickly update the parameters of the few-shot open-world knowledge graph completion model obtained in step S3 through a small number of samples of task relationships to obtain a model that can adapt to new tasks; S5. Use the few-shot open-world knowledge graph completion model obtained in step S4 to complete the meta-test task; In step S2, the data sets divided in proportion form a triple set. During the training process, the validation process, or the testing process, select a triple set of a task relationship as the meta-training task, the meta-validation task, or the meta-test task; The meta-training task, the meta-validation task, and the meta-test task correspond to the meta-training stage, the meta-validation stage, and the meta-test stage respectively; Among them, during the meta-training stage, a few-shot open-world knowledge graph completion model is obtained through several batches of training; According to the Reptile method, the meta-test stage includes a training stage and a testing stage. Among them, in the training stage of the meta-test stage, a small number of samples of task relationships are used to quickly update the model parameters to quickly adapt to new tasks; The specific steps for dividing the data set are as follows: (1) For the dataset , divide the triples in the dataset into different tasks according to the relationship ; (2)Further divide all tasks into a meta-training set , a meta-validation set and a meta-test set ; Divide each task in the meta-test set into a reference set and a query set . The reference set is denoted as , , which is a sample set used to quickly update model parameters, and the size of the reference set is uniformly K; Define each missing triple as a query triple, then the query set ; Original validation set ; In the training stages of the meta-training stage and the meta-test stage, the scoring function of TransE is used to score positive and negative example triples. The TransE scoring function is as follows: ; Among them, is the head entity embedding; is the tail entity embedding; is the relation embedding.

2. The method for open-world knowledge graph completion based on Reptile according to claim 1, wherein, Meta-training set Without dividing the reference set and the query set, during meta-training, it is stipulated that each task relationship has K sample triples, and the model is trained with these K samples.

3. The method for open-world knowledge graph completion based on Reptile meta-learning according to claim 1, wherein In the training stages of the meta-training stage and the meta-test stage, the hinge loss function is used to define the loss function of the model; ; wherein, and are the matching scores of positive example triples and negative example triples respectively, and the negative example triples are obtained by randomly replacing the tail entity of the positive example triples; is an interval hyperparameter greater than 0, used to distinguish the interval between positive and negative triples; represents the standard hinge loss function.

4. The meta-learning open-world knowledge graph completion method based on Reptile according to claim 3, characterized in that The embedding representations of the head entity, the tail entity, and the relationship are generated by combining the Bi-LSTM and CNN models.

Citation Information

Patent Citations

  • Domain knowledge graph completion method based on meta-learning

    CN111046193A

  • Few-sample knowledge graph completion method based on meta-learning

    CN113239131A