Knowledge graph completion method based on graph neural network learning adaptive propagation
By adopting an adaptive propagation method based on graph neural network in knowledge graph completion, combined with attention mechanism and message generation mechanism, the problem of difficulty in capturing complex relationships and flexibly adjusting propagation paths in the existing technology is solved, and an efficient and accurate knowledge graph completion effect is achieved.
Patent Information
- Application Number
- CN202510233937.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-30
AI Technical Summary
The existing knowledge graph completion method is difficult to accurately capture the complex relationships between nodes, and it is difficult to flexibly adjust the information propagation path during node update, resulting in noise interference and redundant calculations during information propagation.
Adaptive propagation method based on graph neural network is adopted, and the interaction information between nodes and relationships is dynamically matched through attention mechanisms, combined with the message generation mechanism of node characteristics and relationship embedding, the message delivery semantic information between the target node and neighbor node is generated, and the appropriate propagation path is selected through the adaptive propagation path method.
It significantly improves the performance of the knowledge graph completion task, accurately captures complex relationships between nodes, optimizes the information transmission process, reduces noise interference and redundant calculations, and improves the expression ability of the graph embedded space.
Smart Images

Figure CN120069040A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graph completion, and particularly to a knowledge graph completion method based on graph neural network learning adaptive propagation. Background Art
[0002] A knowledge graph is an important data representation method, which is widely used in multiple fields such as natural language processing, intelligent recommendation, information retrieval, intelligent question answering, and semantic understanding. It constructs a graph structure through nodes (representing entities) and edges (representing relationships between entities), presenting the interconnections of various types of knowledge in the real world. The knowledge graph provides a highly structured knowledge base for computers, helping to achieve the understanding and reasoning of complex data. However, constructing a complete knowledge graph is very difficult, mainly due to two reasons. First, the construction of a knowledge graph usually relies on manual annotation or extracting knowledge from existing data, which is a high-cost process and prone to missing important information. Second, the entities and relationships in the knowledge graph are often sparse, that is, there is a large amount of missing data or incomplete information. To solve these problems, the "knowledge graph completion" method is proposed, aiming to improve the quality and comprehensiveness of the graph by inferring and supplementing the connections in the knowledge graph.
[0003] An important method of knowledge graph reasoning is knowledge graph embedding (KGE). KGE represents entities and relationships as low-dimensional embeddings to infer new knowledge. These methods are mainly divided into two categories: translation-based models and semantic matching models. However, these shallow models cannot capture the deep semantic complexity in large-scale knowledge graphs. This limitation affects the performance of link prediction. Increasing the dimension of the feature vector can improve semantic learning. When the dimension increases, overfitting often occurs in large graphs. Recent research has introduced KGE methods based on convolutional neural networks (CNNs). Examples in this regard include ConvE and InteractE. These methods can more effectively capture the complex interactions between entities and relationships. However, they mainly focus on isolated knowledge triples. These methods often ignore the neighborhood structure, which is crucial in fields such as biomedicine. Although these methods have improved the effect of knowledge graph completion to a certain extent, they still have significant limitations in capturing the complex relationships between entities in the graph and the scalability in dealing with large-scale knowledge graphs. Especially in the face of dynamic updates, complex interactions, and the rapid expansion of the graph scale, existing methods are still difficult to provide an efficient and accurate solution.
[0004] With the wide application of Graph Neural Network (GNN) in graph data processing, more and more research has begun to introduce GNN into the knowledge graph completion task. Through the message passing mechanism between nodes, GNN can aggregate the information of neighboring nodes in each layer, thereby updating the representation of each node. Compared with traditional methods, GNN can effectively capture the complex relationships between nodes and the structural information of the graph, significantly improving the effect of knowledge graph completion. Through multiple rounds of iterative message passing mechanism, GNN continuously updates the representation of nodes, enabling nodes to incorporate more information from neighboring nodes, thereby generating more accurate embedding representations. When dealing with knowledge graphs, GNN not only considers the direct relationships between entities but also can effectively integrate multi-hop relationship information, so it can better handle the reasoning and completion problems of missing information in the graph. However, existing GNN methods also face some challenges. It is mainly reflected in the following aspects: Singularity of information propagation: Traditional GNN updates node features through a fixed message passing mechanism, that is, the feature information of neighboring nodes is aggregated with the same weight, which may lead to information loss or reduced accuracy of feature updates. Especially when facing complex relationships and diverse node features, traditional GNN may not be able to capture all important information. Dynamic update of node representation: In traditional graph neural networks, the update of node representation is usually static, that is, when aggregating information in each round, the importance of different relationships or the influence differences of neighboring nodes are not considered. In this way, the update of node features may be limited by the fixed propagation strategy and cannot flexibly adapt to the diversity of various relationships in the knowledge graph.
[0005] Therefore, how to provide a knowledge graph completion method based on graph neural network learning adaptive propagation that can solve the problem that the traditional message passing mechanism is difficult to accurately capture the complex relationships between nodes and is difficult to flexibly adjust the information propagation path during the node update process, while avoiding noise interference and redundant calculations during the information propagation process and effectively improving the performance of the knowledge graph completion task is an urgent problem for those skilled in the art. Summary of the Invention
[0006] In view of this, the present invention proposes a knowledge graph completion method based on graph neural network learning adaptive propagation.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] A knowledge graph completion method based on graph neural network learning adaptive propagation, comprising:
[0009] Step 1: Initialize the relationship between nodes in the knowledge graph, obtain the relationship embedding vector, and initialize the given query node based on the relationship embedding vector to obtain the embedding representation of the query node, and initialize the target node as the query node;
[0010] Step 2: Extract and construct a subgraph containing the target node and its neighbor nodes from the knowledge graph, and based on the subgraph, combine the relation embedding vector and the embedding representation of the target node, and use the message generation mechanism that combines node features and relation embedding to generate semantic information about the message transmission between the target node and its neighbor nodes;
[0011] Step 3: Based on semantic information, use the weighted strategy based on the attention mechanism to calculate the attention scores of neighbor nodes, and update the features of neighbor nodes in combination with semantic information, calculate the score of each neighbor node, and select the top-K neighbor nodes with the highest scores for sampling;
[0012] Step 4: Add the sampled top-K neighbor nodes to the target node, repeat steps 2 and 3 based on the preset number of iterations, obtain the multi-hop neighbor nodes of the query node, and perform reasoning based on the embedding of the multi-hop neighbor nodes to calculate the scores for the candidate entities, predict the entities based on the scores, and complete the knowledge graph completion task.
[0013] Optionally, in step 1, a given query node is initialized based on the relation embedding vector to obtain an embedding representation of the query node, and the target node is initialized as the query node, specifically:
[0014] Given a query fact (e q , r q , e t ), where e q is the query node; r q To query the relationship; t is the answer node; relation embedding vector E r Assign a separate embedding representation to each relation;
[0015] Based on the relation embedding vector E r Initializes the given query node e q , get the query node e q The embedding representation of Initialize the target node V s ={e q}.
[0016] Optionally, in step 2, a subgraph including the target node and the neighboring nodes of the target node is extracted and constructed from the knowledge graph as follows:
[0017] ε={(e s ,r so, e o ) | e s ∈ V s , e o ∈ N(V s )};
[0018] Among them, ε is a sub - graph; e s is the target node; e o is the neighbor node of the target node; r so is the relationship from the target node e s to the neighbor node e o ; V s is the set of target nodes; N(V s ) is the set of neighbor nodes, which is obtained by taking the union of the neighbor nodes of the target nodes in the set of target nodes.
[0019] Optionally, in step 2, based on the sub - graph, combining the relationship embedding vector and the embedding representation of the target node, using the message generation mechanism that combines node features and relationship embedding, generate the semantic information of message passing between the target node and the neighbor node as follows:
[0020]
[0021] Among them, mes is the semantic information of message passing between the target node e s and the neighbor node e o ; is the process of generating messages through linear transformation, representing the semantic information passed through the relationship between the target node e s and the neighbor node e o ; is the embedding representation of the target node e s ; is the relationship embedding vector from the target node e s to the neighbor node e o , which is one of the relationship embedding vectors; ⊙ is the element - wise dot - product operation.
[0022] Optionally, in step 3, based on the semantic information, using the weighted strategy based on the attention mechanism, calculate the attention scores of the neighbor nodes as follows:
[0023]
[0024]
[0025] mes k = W k (mes);
[0026] Among them, α s,o is the neighbor node e oAttention score; softmax is the standard normalization activation function; d in is the embedding dimension; W q and W k are both learnable parameters; mes is the semantic information of message passing between the target node e s and its neighbor node e o ; mes k is a transformed representation of the message passed between the target node e s and its neighbor node e o , which is used to match with the query relation vector query to calculate the attention score; is the relation embedding vector of the query relation and is one of the relation embedding vectors; query is the query vector calculated based on the given query relation, obtained by applying the linear transformation W to q and is used as the basis for matching with the neighbor node message representation mes k to generate adaptive attention weights for different neighbor nodes.
[0027] Optionally, in step 3, based on the attention scores of neighbor nodes and combined with semantic information, the feature update of neighbor nodes is as follows:
[0028] E o = ACG(α s,o mes v );
[0029] mes v = W v (mes);
[0030] E′ o = W h ·E o ;
[0031] where E o is the aggregated information of neighbor node e o ; ACG represents the message weighted aggregation process; α s,o is the attention score of neighbor node e o ; W v is a learnable parameter; mes v is the representation of the message, which after transformation, is used to weight and aggregate the information of neighbor node e o . This representation contains the semantic interaction information between the target node e s and neighbor node e o and finally participates in the update of neighbor node e o ; mes is the message passed between the target node e s and neighbor node e oSemantic information for message passing among entities; E′ o is the final feature obtained by linearly transforming E o ; W h is the learned weight matrix for linearly transforming node features, and · represents matrix multiplication.
[0032] Optionally, in step 3, calculate the scores of each neighbor node, and select the top-K neighbor nodes with the highest scores for sampling, as follows:
[0033] sCore o = softmax(W s · E o );
[0034] selected node = top-k(score o );
[0035] where score o is the score of neighbor node e o ; W s is a learnable parameter; E′ o is the updated feature of neighbor node e o ; selected node is the screening result of the top-K neighbor nodes with the highest scores.
[0036] Optionally, in step 4, perform reasoning based on the embeddings of multi-hop neighbor nodes and calculate scores for candidate entities, as follows:
[0037]
[0038] where f is the scoring function; e q is the query node; r q is the query relation; N is the number of iterations of the last iteration; is the neighbor node after the Nth iteration, and also the multi-hop neighbor node of the query node; W score ∈ R 1×d is the learned scoring matrix; is the set of neighbor nodes after the Nth iteration, and also the set of multi-hop neighbor nodes of the query node.
[0039] Optionally, in step 4, it also includes: training the model using multi-class log loss, as follows:
[0040]
[0041] where L is the loss; f is the scoring function; (e q , r q , e t) is the given query fact; e q is the query node; r q is the query relation; e t is the answer node; τ is the set of training triples; N is the number of iterations of the last iteration; is the neighbor node after the Nth iteration; is the set of neighbor nodes after the Nth iteration; exp is the exponential function.
[0042] As can be seen from the above technical solutions, compared with the prior art, the present invention proposes a knowledge graph completion method based on graph neural network learning adaptive propagation. By jointly modeling the embeddings of node features and their connection relationships, a message passing mechanism based on relation embeddings and node features is proposed, which can accurately capture the complex interaction relationships between nodes in the graph and achieve efficient information update and transmission. First, the present invention accurately captures the interaction information between nodes and relationships through a dynamic matching method based on the attention mechanism. The node features and relation embeddings are efficiently combined, and the interaction calculation between the query (Query) and the key (Key) is used to generate dynamic weights, and these weights are used to weight the value (Value), thereby optimizing the information transmission process. This mechanism can efficiently implement message update in the graph network, improve the accuracy of relationship modeling between nodes, and enhance the expression ability of the graph embedding space. Secondly, in order to further optimize the information transmission process, the present invention introduces an adaptive propagation path method. This method can learn and dynamically select appropriate propagation paths, thereby effectively filtering out irrelevant entities and noises and retaining the target nodes that contribute highly to the task. Through this adaptive path selection, the system can flexibly adjust the information propagation path according to the task requirements, avoid the interference of irrelevant information, reduce the computational complexity, and significantly improve the efficiency and accuracy of information propagation. Brief Description of the Drawings
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0044] Figure 1 is the schematic diagram of the method flow of the present invention.
[0045] Figure 2 is the schematic diagram of the model structure of the present invention. Detailed Embodiment
[0046] 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. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0047] Embodiment 1:
[0048] Embodiment 1 of the present invention discloses a knowledge graph completion method based on adaptive propagation of graph neural network learning, including:
[0049] Step 1: Initialize the relationships between nodes in the knowledge graph to obtain the relationship embedding vector E r , and initialize the given query node based on the relationship embedding vector to obtain the embedding representation of the query node, and initialize the target node as the query node.
[0050] Initializing the given query node based on the relationship embedding vector to obtain the embedding representation of the query node, and initializing the target node as the query node specifically as follows:
[0051] Given a query fact (e q , r q , e t ); where e q is the query node; r q is the query relationship; e t is the answer node; the relationship embedding vector E r assigns an independent embedding representation to each relationship;
[0052] Based on the relationship embedding vector E r initialize the given query node e q , to obtain the embedding representation of the query node e q Initialize the target node V s = {e q}.
[0053] Step 2: Extract and construct a subgraph from the knowledge graph that includes the target node and the neighbor nodes of the target node, and based on the subgraph, combine the relationship embedding vector and the embedding representation of the target node, and use the message generation mechanism that combines node features and relationship embeddings to generate the semantic information of message passing between the target node and the neighbor nodes.
[0054] Extract and construct a subgraph from the knowledge graph that includes the target node and the neighbor nodes of the target node as follows:
[0055] ε = {(e s , r so , eo ) | e s ∈ Vs, e o ∈ N(V s )};
[0056] Among them, ε is a sub - graph; e s is the target node; e o is the neighbor node of the target node; r so is the relationship from the target node e s to the neighbor node e o ; V s is the set of target nodes; N(V s ) is the set of neighbor nodes, which is obtained by taking the union of the neighbor nodes of the target nodes in the set of target nodes.
[0057] In a graph neural network, message passing is the core step of information exchange between nodes. The present invention proposes a message generation mechanism that combines node features and relationship embeddings, which can effectively capture the complex interaction relationship between the target node and its neighbor nodes. Based on the sub - graph, combining the relationship embedding vector and the embedding representation of the target node, using the message generation mechanism that combines node features and relationship embeddings, generate the semantic information of message passing between the target node and its neighbor nodes, as follows:
[0058]
[0059] Among them, mes is the semantic information of message passing between the target node e s and the neighbor node e o ; is the process of generating messages through linear transformation, which represents the semantic information passed through the relationship between the target node e s and the neighbor node e o , and provides key information for the subsequent feature update of the target node e s ; is the embedding representation of the target node e s ; is the relationship embedding vector from the target node e s to the neighbor node e o , which is one of the relationship embedding vectors; ⊙ is the element - wise dot - product operation.
[0060] Step 3: Based on the semantic information, using the weighted strategy based on the attention mechanism, calculate the attention scores of the neighbor nodes, and combine the semantic information to update the features of the neighbor nodes, calculate the scores of each neighbor node, and sample the top - K neighbor nodes with the highest scores.
[0061] To dynamically adjust the influence of each neighbor node on the target node, a weighted strategy based on the attention mechanism is adopted. For mes, it first undergoes a linear transformation to obtain mes k , and then applies a linear transformation W q , and finally obtains the attention score α s,o . Based on semantic information, using the weighted strategy based on the attention mechanism, calculate the attention scores of neighbor nodes as follows:
[0062]
[0063]
[0064] mes k = W k (mes);
[0065] where α s,o is the attention score of neighbor node e o ; softmax is the standard normalization activation function; d in is the embedding dimension; W q , W k are both learnable parameters; mes is the semantic information of message passing between target node e s and neighbor node e o ; mes k is a transformed representation of the message passed between target node e s and neighbor node e o , used to match with the query relation vector query to calculate the attention score; is the relation embedding vector of the query relation, one of the relation embedding vectors; query is the query vector calculated based on the given query relation, obtained by applying a linear transformation W to q , serving as the basis for matching with the neighbor node message representation mes k , thus generating adaptive attention weights for different neighbor nodes.
[0066] This mechanism enables the target node to flexibly focus on the neighbor nodes that are most important for the task by adaptively weighting the messages of each neighbor node, thereby improving the effectiveness of message passing.
[0067] Based on the attention scores of neighbor nodes and combined with semantic information, update the features of neighbor nodes as follows:
[0068] E o = ACG(α s,o mes v );
[0069] mes v = W v (mes);
[0070] E′ o = W h ·E o ;
[0071] Among them, E o is the aggregated information of neighbor node e o ; ACG represents the message weighted aggregation process; α s,o is the attention score of neighbor node e o ; W v is a learnable parameter; mes v is the representation of the message, which is used to weight and aggregate the information of neighbor node e o after transformation. This representation contains the semantic interaction information between the target node e s and neighbor node e o , and finally participates in the update of neighbor node e o ; mes is the semantic information of message passing between the target node e s and neighbor node e o ; E′ o is the final feature obtained by linearly transforming E o ; W h is the learned weight matrix used to linearly transform the node features, and · represents matrix multiplication.
[0072] This step ensures that the features of the node can accurately reflect the comprehensive information from its neighbor nodes, thus providing richer semantic features for the next step of reasoning.
[0073] In practical applications, the neighbor nodes of the target node may be very numerous, so sampling is required to select the most influential nodes. Therefore, calculate the score of each neighbor node, and filter the top-K neighbor nodes with the highest scores for sampling, as follows:
[0074] score o = softmax(W s ·E′ o );
[0075] selected nod e = top-k(score o );
[0076] Among them, score o is the score of neighbor node e o ; W s is a learnable parameter; E′ o is the neighbor node eo Updated features; selected node Screen the results for the top-K neighbor nodes with the highest scores.
[0077] This sampling method can ensure that the most influential nodes in the graph are retained even when the number of neighbor nodes is extremely large, thus guaranteeing the quality and efficiency of information dissemination.
[0078] Step 4: Add the sampled top-K neighbor nodes to the target node, repeat Steps 2 and 3 based on a preset number of iterations to obtain the multi-hop neighbor nodes of the query node, and perform reasoning based on the embeddings of the multi-hop neighbor nodes to calculate scores for candidate entities, and predict entities according to the scores to complete the knowledge graph completion task. Among them, the multi-hop neighbor nodes represent the multi-hop neighbor information of the query node in the graph, which can fully reflect the complex semantic relationships and interactions between the target node and its neighbors.
[0079] Perform reasoning based on the embeddings of the multi-hop neighbor nodes to calculate scores for candidate entities as follows:
[0080]
[0081] where f is the scoring function; e q is the query node; r q is the query relation; N is the number of iterations of the last iteration; is the neighbor node after the Nth iteration, and is also the multi-hop neighbor node of the query node; W score ∈R 1×d is the learned scoring matrix; is the set of neighbor nodes after the Nth iteration, and is also the set of multi-hop neighbor nodes of the query node.
[0082] This process can score candidate entities and predict the most likely entity according to the scores, thus completing the knowledge graph completion task.
[0083] The knowledge graph completion model structure based on graph neural network learning adaptive propagation proposed by the present invention is as Figure 2 shown.
[0084] It also includes: training the model using multi-class log loss as follows:
[0085]
[0086] where L is the loss; f is the scoring function; (e q , r q , e t ) is the given query fact; e q is the query node; r qis a query relationship; e t is an answer node; τ is a set of training triples; N is the number of iterations of the last iteration; is the neighbor node after the Nth iteration; is the set of neighbor nodes after the Nth iteration; exp is an exponential function.
[0087] By minimizing the loss function, the scores of positive facts are increased, and the scores of negative facts are reduced, so as to achieve more accurate knowledge reasoning and completion.
[0088] The embodiment of the present invention discloses a knowledge graph completion method based on graph neural network learning adaptive propagation. By jointly modeling the embeddings of node features and their connection relationships, a message passing mechanism based on relation embeddings and node features is proposed, which can accurately capture the complex interaction relationships between nodes in the graph and achieve efficient information update and transmission. First, the present invention accurately captures the interaction information between nodes and relationships through a dynamic matching method based on the attention mechanism. The node features and relation embeddings are efficiently combined, and the interaction calculation between the query (Query) and the key (Key) is used to generate dynamic weights, and these weights are used to weight the value (Value), thereby optimizing the information transmission process. This mechanism can efficiently implement message update in the graph network, improve the accuracy of relationship modeling between nodes, and enhance the expression ability of the graph embedding space. Secondly, in order to further optimize the information transmission process, the present invention introduces an adaptive propagation path method. This method can learn and dynamically select appropriate propagation paths, thereby effectively filtering out irrelevant entities and noises and retaining the target nodes that contribute highly to the task. Through this adaptive path selection, the system can flexibly adjust the information propagation path according to the task requirements, avoid the interference of irrelevant information, reduce the computational complexity, and significantly improve the efficiency and accuracy of information propagation.
[0089] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0090] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A knowledge graph completion method based on graph neural network learning adaptive propagation, characterized in that: include: Step 1: Initialize the relationship between nodes in the knowledge graph, obtain the relationship embedding vector, and initialize the given query node based on the relationship embedding vector to obtain the embedding representation of the query node, and initialize the target node as the query node; Step 2: extract and construct a subgraph including the target node and the neighbor nodes of the target node from the knowledge graph, and based on the subgraph, combine the relation embedding vector and the embedding representation of the target node, and use the message generation mechanism combining node features and relation embedding to generate semantic information of message transmission between the target node and the neighbor nodes; Step 3: Based on the semantic information, the attention score of the neighbor node is calculated using a weighted strategy based on the attention mechanism, and the features of the neighbor node are updated in combination with the semantic information, the score of each neighbor node is calculated, and the top-K neighbor nodes with the highest scores are selected for sampling; Step 4: Add the sampled top-K neighbor nodes to the target node, repeat steps 2 and 3 based on the preset number of iterations, obtain the multi-hop neighbor nodes of the query node, and perform reasoning based on the embedding of the multi-hop neighbor nodes to calculate the scores for the candidate entities, predict the entities based on the scores, and complete the knowledge graph completion task.
2. According to claim 1, a knowledge graph completion method based on graph neural network learning adaptive propagation is characterized in that: In step 1, a given query node is initialized based on the relation embedding vector to obtain an embedding representation of the query node, and a target node is initialized as the query node, specifically: Given a query fact (e q , r q , e t ), where e q is the query node; r q To query the relationship; t is the answer node; relation embedding vector E r Assign a separate embedding representation to each relation; Based on the relationship embedding vector E r Initializes the given query node e q , get the query node e q The embedding representation of Initialize the target node V s ={e q }.
3. According to claim 1, a knowledge graph completion method based on graph neural network learning adaptive propagation is characterized in that: In step 2, a subgraph including the target node and the neighboring nodes of the target node is extracted and constructed from the knowledge graph as follows: ε={(e s ,r so ,e o )|e s ∈V s ,e o ∈N(V s )}; Where, ε is the subgraph; e s is the target node; o is the neighbor node of the target node; r so is the target node e s To neighbor node e o relationship; V s is the set of target nodes; N(V s ) is the set of neighbor nodes, which is obtained by taking the union of the neighbor nodes of the target node in the set of target nodes.
4. According to claim 1, a knowledge graph completion method based on graph neural network learning adaptive propagation is characterized in that: In step 2, based on the subgraph, combined with the relation embedding vector and the embedding representation of the target node, the semantic information of the message transmission between the target node and the neighboring node is generated by using the message generation mechanism combining node features and relation embedding, as follows: Among them, mes is the target node e s With the neighbor node e o Semantic information passed between messages; is the process of generating messages through linear transformation, representing the target node e s With neighbor node e o The semantic information transmitted through relations between is the embedding representation of the target node es; The target node e s To neighbor node e o , which is one of the relation embedding vectors; ⊙ is an element-level dot product operation.
5. According to claim 1, a knowledge graph completion method based on graph neural network learning adaptive propagation is characterized in that: In step 3, based on the semantic information, the attention score of the neighbor node is calculated using a weighted strategy based on the attention mechanism, as follows: my k =W k (my); Among them, α s,o is the neighbor node e o The attention score; softmax is the standard normalized activation function; d in is the embedding dimension; W q , W k are all learnable parameters; mes is the target node e s With the neighbor node e o Semantic information of message passing between k is the target node e s With neighbor node e o A transformation representation of the message passed between them, which is used to match the query relation vector query to calculate the attention score; is the relation embedding vector of the query relation, which is one of the relation embedding vectors; query is the query vector calculated based on the given query relation, Apply the linear transformation W q Get, as the message with the neighbor node mes k The matching basis generates adaptive attention weights for different neighbor nodes.
6. According to claim 1, a knowledge graph completion method based on graph neural network learning adaptive propagation is characterized in that: In step 3, based on the attention score of the neighbor node and in combination with the semantic information, the feature update of the neighbor node is performed as follows: E o =ACG(a s,o month v ); my v =W v (my); HAVE BEEN' o =W h ·HAVE BEEN o ; Among them, E o is the neighbor node e o Aggregate information; ACG represents the message weighted aggregation process; α s,o is the neighbor node e o The attention score of W v is a learnable parameter; mes v is the representation of the message, which is transformed and used to weight the aggregation of neighbor nodes e o This representation contains the target node e s With neighbor node e o The semantic interaction information between the neighbor nodes e o mes is the target node e s With the neighbor node e o Semantic information of message passing between o Through E o The final feature obtained by linear transformation; W h is the learned weight matrix used to linearly transform node features, and represents matrix multiplication.
7. According to claim 1, a knowledge graph completion method based on graph neural network learning adaptive propagation is characterized in that: In step 3, the score of each neighbor node is calculated, and the top-K neighbor nodes with the highest scores are selected for sampling, as follows: score o =softmax(W s ·E′ o ); selected node =top-k(score o ); Among them, score o is the neighbor node e o Score: W s is a learnable parameter; E′ o is the neighbor node e o Updated features; selected node Filter the results for the top-K neighbor nodes with the highest scores.
8. According to claim 1, a knowledge graph completion method based on graph neural network learning adaptive propagation is characterized in that: In step 4, reasoning is performed based on the embedding of the multi-hop neighbor nodes to calculate the score for the candidate entity as follows: Where f is the fractional function; e q is the query node; r q is the query relation; N is the number of iterations of the last iteration; is the neighbor node after the Nth iteration, and is also the multi-hop neighbor node of the query node; W score ∈R 1×d is the learned rating matrix; is the set of neighbor nodes after the Nth iteration, and is also the set of multi-hop neighbor nodes of the query node.
9. According to claim 1, a knowledge graph completion method based on graph neural network learning adaptive propagation is characterized in that: Step 4 also includes: training the model using multi-classification logarithmic loss as follows: Where L is the loss; f is the score function; (e q , r q , e t ) is a given query fact; e q is the query node; r q To query the relationship; t is the answer node; τ is the set of training triples; N is the number of iterations of the last iteration; is the neighbor node after the Nth iteration; is the set of neighbor nodes after the Nth iteration; exp is the exponential function.
Citation Information
Cited By
Drug-disease relation prediction method and system based on dual-channel fusion knowledge graph
CN120372560A
Attention diffusion knowledge graph reasoning method for smart home
CN120806173A
Node embedding method based on knowledge graph, electronic equipment and storage medium
CN120875000A