Single-sample knowledge graph completion method based on path enhancement and entity metric collaboration
Patent Information
- Application Number
- CN202311681708.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-08
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-12-08
AI Technical Summary
然后,为了解决稀疏知识图谱下路径推理困难的问题,我们提出了一种匹配处理器,它主要利用预训练向量所具有的语意信息对路径扩展实体进行匹配从而协助推理模型进行路径推理,可以有效提高推理模型命中率,同时提高了补全结果的可解释性
[0013] The beneficial effects of this invention are as follows: Experiments on the NELL-One and FB15K237-One datasets show that the proposed method significantly outperforms existing state-of-the-art baseline methods. This demonstrates the excellent performance of this method in the field of few-sample knowledge graph completion. More importantly, this method can provide the reasoning path of the results through the reasoning model, greatly improving the interpretability of the completion results.
Smart Images

Figure CN117689015B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of knowledge graph completion application. It is an interpretable completion method in single-sample scenarios, specifically a single-sample knowledge graph completion method based on path enhancement and entity measurement collaboration. Background Technology
[0002] With the development of the internet and the arrival of the big data era, the surge in data volume has become the norm. While massive amounts of data have brought convenience to our lives, extracting key information from this vast amount of data has become a new challenge. Knowledge graphs represent entities and relationships in real life as triples (h, r, t), describing various entities and concepts existing in the real world through these triples. Knowledge graphs describe the relationships between data in a very intuitive way, and the graph structure facilitates computer processing. Currently, many knowledge graphs, such as NELL, FB15K237, and Wiki, are being applied in practical applications such as intelligent question answering and recommendation systems. Knowledge graphs play a very important role in these fields. However, most knowledge graphs suffer from high incompleteness, which greatly affects their application. In recent years, numerous completion algorithms have been proposed to supplement the missing information in knowledge graphs.
[0003] Firstly, embedding-based methods, such as the TransE model proposed by BORDES A in "Translating Embeddings for Modeling Multi-relational Data," the TransR model proposed by LIN YK in "Learning Entity and Relation Embeddings for Knowledge Graph Completion," and the RotatE model proposed by SUN Z in "RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space," have achieved good results in the field of knowledge graph completion. These methods map entities and relations to a low-dimensional vector space. However, they require sufficient training data of triples for all query relations. Statistically, most relations in knowledge graphs have long-tail characteristics, meaning that the triple occupancy rate of most relations is very low. Furthermore, with the rapid emergence and expansion of knowledge, a large number of new entities and relations are introduced into the knowledge graph. These entities and relations appear infrequently and belong to the long-tail relation category. In long-tail tasks, embedding-based models struggle to achieve good completion results. To effectively address the knowledge graph completion problem in small-sample scenarios, metric-based models have been proposed, such as GMatching proposed by XIONG W in *One-Shot Relational Learning for Knowledge Graphs*, FAAN proposed by SHENG J in *Adaptive Attentional Network for Few-Shot Knowledge Graph Completion*, and FSRL proposed by ZHANG C in *Few-Shot Knowledge Graph Completion*. These models mostly filter true tail entities from the candidate set by obtaining matching scores between support entity pairs and query entity pairs. They enhance the representation of support entity pairs by embedding neighboring entities and improve embedding performance through static or dynamic attention modules. These methods achieve good results, but neglect model interpretability, making it difficult to provide the reasoning logic for the completion results. To improve interpretability, path-interaction-based algorithms have been proposed, such as DeepPath proposed by XIONG W in *DeepPath: A Reinforcement Learning Method for Knowledge Graph Reasoning*.DeepPath treats reasoning as a decision-making process, enabling agents to interact with the knowledge graph environment and make decisions about their current actions. It also assigns a reward function to each decision, incentivizing the agent to find the most informative path. Meilicke C's AnyBuRL, proposed in *Anytime Bottom-Up Rule Learning for Knowledge Graph Completion*, is a method for mining logical rules in knowledge graphs. It utilizes multiple relations and their inverse relations within the knowledge graph as the reasoning logic for a single relation, assigning a confidence score to each logical rule. Bai Y's Squire, proposed in *SQUIRE: A Sequence-to-sequence Framework for Multi-hop Knowledge Graph Reasoning*, uses Transformer for path reasoning and AnyBuRL for path enhancement. These path-interaction-based methods significantly enhance interpretability; however, they require a large number of triples to support the model in finding path information during training, leading to a significant drop in performance on small datasets. The p-int model proposed by XU J in *P-INT: A Path-based Interaction Model for Few-shot Knowledge Graph Completion* extracts a support set subgraph using BFS and then expands the query subgraph by calculating the path interactions between the query set and the support set, while also adding path weights. This model applies path reasoning to small samples, improving the interpretability of reasoning in the small-sample domain and achieving good results. However, this model struggles with path-sparse triples. When the head and tail entities of a query triple are separated in the knowledge graph, i.e., there is no complete path connection between the head and tail entities in the knowledge graph, the model fails. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a single-sample knowledge graph completion method based on path enhancement and entity metric collaboration. By introducing the inference model into the completion process, the overall completion effect and interpretability of the model are improved. Specifically, we first extract entity concepts along the reasoning path of the query triples through the entity concept module to enhance the relevance of neighbor aggregation, while simultaneously aggregating path information. Then, we integrate path information into entity aggregation to improve the matching degree of related entity pairs. Next, to address the difficulty of path reasoning in sparse knowledge graphs, we propose a matching processor that primarily utilizes the semantic information of pre-trained vectors to match path-extended entities, thereby assisting the inference model in path reasoning. This effectively improves the hit rate of the inference model and enhances the interpretability of the completion results. Finally, we use contrastive learning to strengthen the pre-trained vectors, enriching their representation. The final score ranking of the query triples is obtained by comprehensively considering the results of the inference model and the metric model. Through the collaborative work of path interaction and entity metric models, the interpretability of the model is improved while simultaneously enhancing the completion quality.
[0005] The technical solution of the present invention:
[0006] A single-sample knowledge graph completion method based on path enhancement and entity metric collaboration includes:
[0007] (1) Use TransE to pre-train the entities and relations of the knowledge graph.
[0008] (2) A meta-learning training strategy is adopted to divide the task relations. Specifically, for each task relation r, we have a meta-training set D. r ={S r Q r}. |S r |=1, that is, S r It consists of single-sample supporting entity pairs. The query entity pair Q under this task relation is... r ={(h q ,t q )} is the query entity header h q and real tail entity t q The query entity pairs constituted. The relation R is divided into R... background R meta-train R meta-validation R meta-tes Correspondingly, their triples constitute the background knowledge graph G. background Meta-training set D meta-train Meta-verification set D meta-validati Heyuan test set D meta-tes The background knowledge graph will remove the triples corresponding to these small sample relationships, meaning that the intersection between these sets is empty.
[0009] (3) Find supporting entity pair paths, extract path entity concepts, and use entity concepts to filter neighbor entity pairs.
[0010] (4) Find the path between the head entity and different candidate tail entities, and use the GRU model to obtain the path vector, and incorporate it into the neighbor aggregation process.
[0011] (5) Use the LSTM model to match the aggregate vector between the support entity pair and the query entity pair, and give a score. Based on the score, determine the authenticity of the current query set.
[0012] (6) Train the inference model using support set path information to enable it to learn the inference rules for the current task relationships. A matching processor is used to match the candidate set of the query subgraph by considering the semantic information h+r≈t of the TransE pre-trained vectors, solving the problem of inference interruption caused by path sparsity and improving the hit rate of the inference model, i.e., the ratio of inferences to true tail entities. Simultaneously, the addition of the inference model provides a basis for measuring the model's results, improving the model's interpretability.
[0013] The beneficial effects of this invention are as follows: Experiments on the NELL-One and FB15K237-One datasets show that the proposed method significantly outperforms existing state-of-the-art baseline methods. This demonstrates the excellent performance of this method in the field of few-sample knowledge graph completion. More importantly, this method can provide the reasoning path of the results through the reasoning model, greatly improving the interpretability of the completion results. Attached Figure Description
[0014] Figure 1 The flowchart for the operation of the measurement model includes an entity concept filtering module, a path information aggregation module, and a triplet matching module.
[0015] Figure 2 This is a flowchart of the inference model's operation. Detailed Implementation
[0016] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings and technical solutions.
[0017] The main module flowchart of the present invention is shown below. Figure 1 , Figure 2 As shown:
[0018] This invention comprises five components: a contrastive learning enhancement module, a path reasoning module, an entity concept filtering module, a path information aggregation module, and a triple matching module.
[0019] Step 1: Contrastive learning enhancement mainly includes: pre-training vectors representing entities and relations in the knowledge graph, and using contrastive loss to enhance the pre-trained vector representations.
[0020] Step 1.1: Pre-training
[0021] The TransE model is used to pre-train the triples. Pre-training is the process of mapping the entity relations of the triples to a low-dimensional vector space. More specifically, TransE ensures that the triples (h, r, t) of the knowledge graph satisfy:
[0022] h+r≈t
[0023] Where h represents the head entity, r represents the relation, and t represents the tail entity; TransE views the relation as a transition from head to tail, with the aim of training the vector representation of the head entity plus the vector representation of the relation to approximate the vector representation of the tail entity.
[0024] TransE's scoring function:
[0025]
[0026] Step 1.2: Contrastive learning reinforcement:
[0027] To obtain more semantically meaningful pre-trained vectors in sparse knowledge graphs, inspired by KGE-CL, we utilize contrastive learning to enhance the representation of TransE pre-trained vectors. While preserving the h+r≈t relation of TransE itself, we construct positive instances for entity-relation pairs sharing the same entity and entities sharing the same entity-relation, and then calculate the contrastive loss between the original instance and the positive instance. Here, the original instance refers to the triple currently existing in the knowledge graph, and the positive instance refers to the entity and relation that share the same information as the original instance. Through contrastive learning, we finally obtain a more effective entity-relation vector representation, which is used as the pre-training input for our designed single-sample completion model.
[0028] For example, (Messi, plays for, Barcelona), (Suarez, plays for, Barcelona). Entities "Messi" and "Suarez" have the same relational entity pair (plays for, Barcelona), therefore their entity embeddings should be similar. The contrastive loss formula is as follows, where P(i) is the positive instance, N(i) is the negative sample, |P(i)| represents the number of positive instances, and z i This is the vector representation of the original instance. z is the vector representation of a positive instance. j The vector representation of negative instances, τ is a hyperparameter that can be dynamically adjusted during training, as described in the following formula:
[0029]
[0030] Step 2: The path reasoning module mainly includes: supporting path search for entity pairs, learning path rules by the Transformer model, and path entity expansion.
[0031] Step 2.1: Support path search for entity pairs
[0032] In the single-sample knowledge graph completion task, a triple (h, r, t) is selected from the triples in the knowledge graph as the support set. For a given support entity pair (h, t), we traverse the knowledge graph to find the path (h, r1, e1, r2, e2, ... r) between the head and tail entities. n Let r, e, and t be the path, defined as support_path. Here, r and e represent the relations and entities appearing in the path, respectively, and the subscript represents the number of the current inference step. Due to the vast size of the knowledge graph, to save runtime, we select paths within 4 steps as the training data for the inference model. The path finding algorithm uses Breadth-First Search (BFS).
[0033] Step 2.2: Transformer Model Learning Path Rules
[0034] Path reasoning is a query entity h given a relation r. q It is inferred that the entity t contains a real tail. q The query subgraph, i.e., by expanding the multi-hop neighbors of the query entity, obtains the reasoning path from the head entity to the tail entity. For the single-sample knowledge graph completion task, we extract a triple (h, r) from the training data. q ,t) are used as supporting triples, and the rest are used as query triples, where h is the header entity, r q This represents the current query relationship, also known as the current query task, where t is the tail entity. In step 2.1, we have already obtained the path information support_path between the supporting entity pair (h, t), from the inference path (h, r1, e1, r2, e2, ... r n Extract the relation path (r1, r2, ... r) from the given information. n We construct the model input (r) as training data. q ,r i<t The input is given to the Transformer inference model, where r... q This is the current query relation task. i<t This represents the path information preceding the current inference step. For example, if t = 3, meaning we are performing the 3rd inference step, our input is (r q (r1, r2). Then we obtain a path vector v through the model. encode Then, we calculate the path vector v.encode The vector of the current knowledge graph relation set emb rel ∈R N*d The similarity is calculated as follows: N is the total number of relations in the knowledge graph, and d is the embedding dimension of the vector, where d = 100. Cosine similarity is used. Then, Softmax is used to normalize the similarity score to obtain the probability of each action in the current step. The path relation set v = {r t |r t ∈support_path}. We invert and sum the probabilities corresponding to the support set path at each step as the loss function. As the loss function decreases, the probability score of the support set path increases, and our model learns the support set path information better. The specific formula is as follows, where R... background The background knowledge graph represents the set of all relations, Embedding represents the pre-trained vectors using entity relations, T represents the inference path length, and emb represents the set of all relations. e and emb r These represent entity and relation vectors in a knowledge graph, respectively.
[0035] v encode =MLP(Transformer(r q ,r i<t ))
[0036] emb rel =Embedding(rel)rel∈R background
[0037] p(r t |r q ,r i<t =Softmax(similar(v) encode ,emb rel ))
[0038]
[0039] Step 2.3: Path entity expansion:
[0040] In the current reasoning state (e t-1 ,r t Under ) where e0 = h q Searching for e t As an extension of the current step; the first consideration is the knowledge graph related to (e t-1 ,r t Directly connected entities are e t The set of e, where e t-1 For the entity in the (t-1)th step of reasoning, r tTo prevent interruption of the reasoning process, a matching strategy is proposed using the semantic information of pre-trained vectors. Specifically, we first extract entity concepts along the support set path, restricting the extended entities to certain entity concepts, thereby obtaining an extended entity candidate set C from the knowledge graph. query Secondly, the pre-trained vectors of the TransE model ensure that the vectors of the head entity, relation, and tail entity have a vector relationship of h+r≈t; this vector relationship is used to evaluate the candidate set C of the query subgraph. query Perform the matching; specifically as follows: First, obtain C query e t-1 Current relation r t The vector representation of V query , Then, calculate and The cosine similarity is calculated, and then the result is normalized using softmax. To ensure that candidate entities have the same probability distribution in both cases, five entities are selected as the reference set in both cases, denoted as C. ref The specific formula is as follows, where ⊙ represents cosine similarity and G represents background knowledge graph.
[0041]
[0042] V query =Embedding(e i )e i ∈C query
[0043]
[0044]
[0045]
[0046] Next, we obtain the entity set C. ref The vector representation of C, and then we take its mean and C query Calculate the similarity between entity vectors in the dataset and extract the Top 10. n The entity becomes the next extended entity, where n=10. The formula is as follows, where e i The vector of the entity, v ref Representing reference set C ref The vector representation of v query Represents query set C query The vector representation of prob t-1 Prob represents the probability of the previous reasoning step.t This represents the probability of the current reasoning step.
[0047] v e =Embedding(e i )e i ∈C ref
[0048]
[0049] c query =Embedding(e i )e i ∈C query
[0050]
[0051] Step 3: Entity Concept Filtering Module
[0052] The specific steps include extracting entity concepts along the path (h,t) supporting entity pairs, filtering a set of entity candidates from the knowledge graph using these entity concepts, and then intersecting the entity candidate set with the neighbor entities of the current head entity h during the neighbor aggregation process to select high-quality neighbor entities for aggregation.
[0053] In step 2.1, we obtain the path information (h,r1,e1,r2,e2,...r) between supporting entity pairs (h,t). n Based on the semantic concepts of entities (e1, e2, ..., t) along the path, a concept set is constructed. These concepts are the entity concepts that we consider relevant to the current inference relation r. The entity set ε includes the concepts... Extract the entities to form the candidate set C of neighboring entities. nei h has neighbor pairs {(r,t)|(h,r,t)∈G} forming a neighbor set N. h G represents the background knowledge graph. We take C. nei With N h The intersection of the entity parts is obtained as {(r,t)|(r,t)∈N}. h ,t∈C nei}, denoted as N c |N c |for N c The number of entity pairs in the set. We aggregate multiple neighbor entity pairs of an entity through a fully connected network, Agg. e ∈R d The formula is as follows.
[0054] C nei =filter(support_path)
[0055] N c =INTERSECT(C nei N h )
[0056] emb r =Embedding(r),emb t =Embedding(t)(r,t)∈N c
[0057]
[0058] Step 4: Path Information Aggregation Module
[0059] Given an entity pair (h,t), in step 3, we have filtered out high-quality neighbor entity concepts and obtained the high-quality neighbor entities of the current entity pair (h,t) based on these entity concepts. To improve the accuracy of model matching, we consider the path information of the query entity pair when performing entity pair aggregation. First, we use a path search algorithm to find the path between entity pairs (h,t), where the path of the support set entity pair can be directly obtained using the support set path rule support_path from step 2. For the query entity pair (h,t) q We need to use a pathfinding algorithm to find h and entities t with different tails. q The path between them is then determined. A GRU network is used to obtain the vector representation of the path, which is then incorporated into the entity aggregation process. We believe that query triples with similar paths to the supporting triples are more likely to be correct samples. Incorporating inference path information into the entity pair aggregation process can enhance the matching degree between supporting entities and correct query entity pairs. This is done after obtaining the neighbor aggregation vector Agg for the entity pair (h,t). h ∈R d Agg t ∈R d The path vector emb path ∈R d After representation, the vector we concatenate The input is fed into a multilayer perceptron network to obtain the aggregated representation of the current entity pair. The specific formula is as follows:
[0060] emb r =Embedding(r)emb e =Embedding(e)
[0061]
[0062]
[0063] Step 5: Triple Matching Module. This part mainly performs a matching metric between the aggregated support set entity pair vector and the query set entity pair vector. The goal is to select the correct tail entity from the candidate set for completion. The specific steps are as follows:
[0064] We use f e Obtain supporting entity pairs (h) s ,t s ) and query set (h i ,t ij Aggregate vector, denoted as f ref f query The Matcher matching processor uses LSTM and cosine similarity to calculate f. ref f query The matching score is used. The hinge loss function is used. The evaluation metrics are MRR and Hits@k. MRR is the average of the inverse rankings of the real tail entities. Hits@k represents the percentage of real entities ranked in the top k. The specific formula is as follows: where f ref Indicates support for entity pairs (h) s ,t s The aggregate vector of f) query Represents the query set (h) i ,t ij The aggregate vector of h′. k+1 ,c k+1 It records the hidden state (short-term strong memory) and cell state (long-term memory) of the LSTM, and is the standard output of the LSTM network. k+1 This represents the similarity score between the supporting entity pair and the query entity pair. + The score represents the score for correctly querying entity pairs. - This represents the score for erroneous query entity pairs. `margin` is a hyperparameter used to measure the score. + With score - The differences between them.
[0065]
[0066] h k+1 =h′ k+1 +f query
[0067]
[0068] Loss = max(0, margin + score) - -score + )
[0069] The method of this invention was extensively tested on two real-world datasets, NELL-One and FB15k237-One. Model performance was evaluated using two widely used evaluation metrics: MRR and Hits@k. Tables 1 and 2 show the experimental results of our model on NELL-One and FB15k237-One, respectively, comparing it with GMTatching, MetaR, FSRL, FAAN, and CIAN. The model with the best performance in MRR was selected as the optimal model. On NELL-One, our model outperformed GMTatching by 7.1%, FSRL by 10.7%, FAAN by 6.6%, MetaR by 2.9%, and CIAN by 2.4%. On FB15k237-One, our model outperformed GMTatching by 17.2%, FSRL by 11.6%, FAAN by 12.4%, MetaR by 18.6%, and CIAN by 8.7%. Bold results represent the best performance, and underlined results represent the second best performance.
[0070] Table 1. Single-sample experimental results on the NELL-One dataset.
[0071]
[0072] Table 2 shows the single-sample experimental results on the FB15k237-One dataset.
[0073]
Claims
1. A single-sample knowledge graph completion method based on path enhancement and entity metric collaboration, characterized in that, This single-sample knowledge graph completion method combines entity concept features with entity pair path information to implement an entity measurement model. Furthermore, it integrates a path reasoning method, i.e., a reasoning model, to form the single-sample completion model. Through the collaborative work of the reasoning model and the entity measurement model, the accuracy of knowledge graph completion in single-sample scenarios is improved, while also enhancing the interpretability of the completion results. The reasoning model includes a contrastive learning enhancement module, a path reasoning module, an entity concept filtering module, a path information aggregation module, and a triplet matching module. The specific steps are as follows: Step 1: The contrastive learning enhancement module includes pre-training, contrastive learning enhancement, and single-sample task partitioning; Step 1.1: Pre-training The TransE model is used to pre-train the triples of the knowledge graph. Pre-training is the process of mapping the entity relations of the triples in the knowledge graph to a low-dimensional vector space. The TransE model enables the triples of the knowledge graph to... satisfy: Where h represents the head entity, r represents the relation, and t represents the tail entity; the TransE model regards the relation as a transition from the head entity to the tail entity, and aims to train the vector representation of the head entity plus the vector representation of the relation to approximate the vector representation of the tail entity. The scoring function of the TransE model: Step 1.2: Contrastive Learning Reinforcement Contrastive learning is used to enhance the representation of pre-trained vectors of the TransE model while preserving the TransE model itself. Simultaneously, positive instances are constructed for entity-relation pairs that share the same entity and entities that share the same entity-relation. Then, the contrastive loss between the original instance and the positive instance is calculated. The original instance refers to the triple currently existing in the knowledge graph, and the positive instance refers to the entity and relation that share the same information as the original instance. Through contrastive learning, a more effective entity-relation vector representation is finally obtained and used as the pre-training input for the single-sample completion model. The formula for comparative loss is as follows: in, As a positive example, , Indicates the number of positive instances. This is the vector representation of the original instance. A vector representation of a positive instance. A vector representation of a negative instance. It is a hyperparameter that is dynamically adjusted during training; Step 1.3: Single-sample task partitioning A meta-learning training strategy is adopted to partition task relations; specifically, for each task relation r, there is a meta-training set. = { , }; =1, that is It consists of single-sample supporting entity pairs; the query entity pairs under this task relation ={( , )} is composed of the query entity header and real tail entity The query entity pairs constituted; the relation R is divided into... , , , Correspondingly, their triples constitute the background knowledge graph. Meta-training set Meta-verification set Heyuan Test Set The knowledge graph will remove the triples corresponding to these single-sample relationships, meaning that the intersection between these sets will be empty. Step 2: The path reasoning module includes support for path search of entity pairs, learning path rules by the Transformer model, and path entity expansion; Step 2.1: Support path search for entity pairs In the single-sample knowledge graph completion task, a triple is selected from the triples in the knowledge graph. As a support set; for a given pair of supporting entities Traverse the knowledge graph to find the path between the head and tail entities. Defined as Where r and e represent the relationships and entities that appear in the path, respectively, and the subscript represents the number of the current inference step; select paths within 4 steps as training data for the inference model; use the Breadth-First Search (BFS) algorithm as the path finding algorithm; Step 2.2: Transformer Model Learning Path Rules Path reasoning is a query entity for a given relation r. Inferred to contain real tail entities The query subgraph, i.e., by expanding the multi-hop neighbors of the query entity, obtains the reasoning path from the head entity to the tail entity; for the single-sample knowledge graph completion task, a triple is extracted from the training data. As supporting triples, the rest are used as query triples, among which The current query relationship is the current query task; in step 2.1, the supporting entity pairs have already been obtained. Path information between From the reasoning path Extract the relationship path separately As training data, construct the model input. The input is given to the Transformer model, where This represents the path information preceding the current inference step, obtained as a path vector through the Transformer model. Then calculate the path vector. Vector of relation set with current knowledge graph similarity, This represents the set of all relation vectors in the current knowledge graph, where N is the total number of relations in the knowledge graph, d is the embedding dimension of the vectors, and d=100; then, Softmax is used to normalize the similarity scores to obtain the probability of each action in the current step. Use cosine similarity; define the set of path relationships. = The loss function is obtained by inverting and summing the probabilities corresponding to each support set path at each step; the specific formula is as follows: in, This represents the set of all relations in the background knowledge graph. This represents the pre-trained vectors using entity relationships, and T represents the inference path length; Step 2.3: Path Entity Expansion In the current reasoning state ( Below, among them = Search As an extension of the current step, the first consideration is the knowledge graph and... Directly connected entities as The set of, where For the entity in the (t-1)th step of reasoning, For the relationship in step t of the reasoning, a matching strategy is proposed using the semantic information of pre-trained vectors to prevent interruption of the reasoning process. Specifically, firstly, entity concepts on the support set path are extracted, and the extended entities are restricted to certain entity concepts. Thus, a candidate set of extended entities can be obtained from the knowledge graph. Secondly, the pre-trained vectors of the TransE model enable the head entity, relation, and tail entity vectors to have... Vector relationships; using such vector relationships to expand the entity candidate set. Perform the matching; specifically as follows: First obtain , Current Relationship vector representation , , Then, calculate and The cosine similarity is calculated, and then the result is normalized using softmax. To ensure that candidate entities have the same probability distribution in both cases, five entities are selected as the reference set in both cases, denoted as . The specific formula is as follows, where, Represents cosine similarity. Represents a background knowledge graph; = ( ) ( ) ( ) (( ) ) Next, obtain the entity set. The vector representation of is then taken, and its mean is... Calculate the similarity between entity vectors in the dataset and extract the relevant data. The entity is used as the next extended entity, and n=10 is used to obtain the next extended entity. The formula is as follows: in express Vector representation of entities , Representation of reference set The vector representation of , Represents query set The vector representation of , This represents the probability of the previous reasoning step. Indicates the probability of the current reasoning step; Step 3: Entity concept filtering module Includes extracting supporting entity pairs The entity concepts along the path are used to filter a set of entity candidates from the knowledge graph. During the neighbor aggregation process, the intersection of the entity candidate set with the neighbor entities of the current head entity h is calculated, and high-quality neighbor entities are selected for aggregation. Based on the supporting entity pairs obtained in step 2.1... Path information between Based on the path information, the entity The semantic concepts constitute a set of entity concepts. These concepts are entity concepts considered relevant to the current inference relation r; utilizing concept sets Extract the set of entities corresponding to the entity concepts from the entire knowledge graph to form the candidate set of neighbor entities. ; There are neighbor entities Forming a neighbor set G represents knowledge graph; take The intersection of the two entities is obtained. , recorded as ; for The number of entity pairs in the set; aggregating multiple neighboring entity pairs of an entity through a fully connected network. The formula is as follows: Step 4: Path Information Aggregation Module First, entity pairs are found using a path search algorithm. The paths between them, where the paths supporting set entity pairs directly utilize the set path rules from step 2. That's it; for the query entity pair Use path search algorithm to find With different tail entities The path between them is determined; then, a GRU network is used to obtain the vector representation of the path, which is incorporated into the entity aggregation process; inference path information is considered in the entity pair aggregation process to enhance the matching degree between the supporting entity pairs and the correct query entity pair samples; after obtaining the entity pairs... Neighbor aggregation vector , Vector of the path After representation, the concatenated vector [ ] The input is fed into a multilayer perceptron network to obtain the aggregated representation of the current entity pair; the specific formula is as follows: and These represent entity and relation vectors in a knowledge graph, respectively. Step 5: The triplet matching module mainly performs a matching metric between the aggregated support set entity pair vector and the query set entity pair vector. The goal is to select the correct tail entity from the candidate set for completion. The specific steps are as follows: use Obtain supporting entity pairs ( , ) and query set ( , Aggregate vector, denoted as The Matcher processor uses LSTM and cosine similarity calculation. The matching score; the hinge loss function is used; the evaluation metric is... and , It is the average of the inverse rankings of the real tail entities. This represents the percentage of real entities ranked in the top k; the specific formula is as follows: in, Indicates support for entity pairs ( , The aggregate vector of ) Represents the query set ( , The aggregate vector of ); It records the short-term strong memory and long-term memory of LSTM, and is the standard output of LSTM network; It supports similarity scores between entity pairs and query entity pairs. It is the score for correctly querying entity pairs. It is the score for erroneous query entity pairs; It is a hyperparameter used to measure and The differences between them.