Knowledge graph completion method, system and device and storage medium
By analyzing the data of knowledge graph through graph convolution network, similarity measurement and support set interaction model, it solves the problem of incomplete and unable to update the knowledge graph information, achieves more accurate entity representation and relationship modeling, and has stronger general-purpose capabilities. ization ability.
Patent Information
- Application Number
- CN202410722344.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-10-01
AI Technical Summary
Knowledge graphs suffer from incomplete information and errors, are difficult to capture complex semantic associations between entities and relationships, and cannot be updated as time and content change.
The graph convolution network model, similarity measurement model and support set interaction model are used to analyze the graph structure, sequence data and entity interaction of the knowledge graph, obtain the connections, similarities, dependencies and interactive relationships between entities, and carry out the knowledge graph Complete update.
It improves the representation accuracy and completeness of the knowledge graph, can more accurately capture the complex semantic associations between entities and relationships, has stronger generalization capabilities, and can be updated as the content and structure of the knowledge graph change.
Smart Images

Figure CN118734946A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graph technology, and in particular to a knowledge graph completion method, system, device and storage medium. Background Art
[0002] Currently, the task of knowledge graph completion faces multiple challenges. Knowledge graphs often have incomplete and erroneous information, which makes the knowledge representation therein may not be accurate and complete. Secondly, for the problem of small sample learning, that is, when data is scarce, traditional methods often find it difficult to fully capture the complex semantic associations between entities and relationships, resulting in limited performance. In addition, knowledge graphs are dynamic and diverse. As time goes by and information is updated, the content and structure of knowledge graphs may change, which also brings additional challenges to the completion task. Summary of the invention
[0003] In view of this, the present invention proposes a knowledge graph completion method, system, device and storage medium, which can solve the defects of the prior art that the knowledge representation may not be accurate and complete, it is difficult to fully capture the complex semantic associations between entities and relationships, and it is impossible to update as the content and structure of the knowledge graph change.
[0004] The technical solution of the present invention is achieved in this way:
[0005] A knowledge graph completion method, specifically comprising:
[0006] Analyze the graph structure data of the knowledge graph based on the graph convolutional network model to obtain the connection relationship between entities;
[0007] Analyze the similarity of entities in the knowledge graph based on the similarity measurement model to obtain the similarity between entities;
[0008] Analyze the sequence data of the knowledge graph based on the Transformer model to obtain the dependency relationship between entities;
[0009] Analyze the interactions between entities in the knowledge graph based on the support set interaction model to obtain the interaction relationship between entities;
[0010] The knowledge graph is completed and updated based on the connection, similarity, dependency and interaction between entities.
[0011] As a further optional solution of the knowledge graph completion method, the graph structure data of the knowledge graph is analyzed according to the graph convolutional network model to obtain the connection relationship between entities, which specifically includes:
[0012] According to the graph structure data of the knowledge graph, the node set, edge set, adjacency matrix, degree matrix, activation function and weight matrix are obtained;
[0013] Based on the node set, edge set, adjacency matrix, degree matrix, activation function and weight matrix, the connection relationship between entities is obtained.
[0014] As a further optional solution of the knowledge graph completion method, the similarity between entities in the knowledge graph is analyzed according to the similarity measurement model to obtain the similarity between entities, which specifically includes:
[0015] Obtain entity sets based on knowledge graphs;
[0016] The similarity measurement function is called to calculate the similarity between any two entities in the entity set to obtain the similarity between every two entities.
[0017] As a further optional solution of the knowledge graph completion method, the interaction between entities in the knowledge graph is analyzed according to the support set interaction model to obtain the interaction relationship between the entities, which specifically includes:
[0018] Based on the interactions between entities in the knowledge graph, we obtain the relationship reasoning data and information transfer data between entities;
[0019] The interaction function is called to calculate the relationship reasoning data and information transfer data between entities to obtain the interaction relationship between entities.
[0020] A knowledge graph completion system, comprising:
[0021] The graph convolutional network model analysis module is used to analyze the graph structure data of the knowledge graph based on the graph convolutional network model to obtain the connection relationship between entities;
[0022] The similarity measurement model analysis module is used to analyze the similarity of entities in the knowledge graph based on the similarity measurement model to obtain the similarity between entities;
[0023] Transformer model analysis module, which is used to analyze the sequence data of the knowledge graph based on the Transformer model to obtain the dependency relationship between entities;
[0024] The support set interaction model analysis module is used to analyze the interactions between entities in the knowledge graph based on the support set interaction model to obtain the interaction relationship between entities;
[0025] The completion and update module is used to complete and update the knowledge graph based on the connection, similarity, dependency and interaction relationships between entities.
[0026] As a further optional solution of the knowledge graph completion system, the graph convolutional network model analysis module includes:
[0027] The first analysis module is used to obtain a node set, an edge set, an adjacency matrix, a degree matrix, an activation function and a weight matrix based on the graph structure data of the knowledge graph;
[0028] The first calculation module is used to obtain the connection relationship between entities based on the node set, edge set, adjacency matrix, degree matrix, activation function and weight matrix.
[0029] As a further optional solution of the knowledge graph completion system, the similarity measurement model analysis module includes:
[0030] The second analysis module is used to obtain an entity set based on the knowledge graph;
[0031] The second calculation module is used to call the similarity measurement function to perform similarity calculation on any two entities in the entity set to obtain the similarity between every two entities.
[0032] As a further optional solution of the knowledge graph completion system, the support set interaction model analysis module includes:
[0033] The third analysis module is used to obtain the relationship reasoning data and information transmission data between entities based on the interactions between entities in the knowledge graph;
[0034] The third computing module is used to call the interactive function to calculate the relationship reasoning data and information transmission data between entities to obtain the interactive relationship between entities.
[0035] A computing device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned knowledge graph completion methods when executing the computer program.
[0036] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any one of the above-mentioned knowledge graph completion methods.
[0037] The beneficial effects of the present invention are: by utilizing the graph convolutional network model to effectively capture graph structure information, updating the node representation through multi-layer neural network layers and information aggregation of neighboring nodes, thereby learning the connection relationship between entities, and measuring the similarity between entities through a similarity measurement module, helping to identify potential entity matches or similarities, and improving the ability to understand the knowledge graph. At the same time, the Transformer model is applied to sequence modeling, and the dependencies between entities are captured through the self-attention mechanism, thereby capturing the complex semantic associations between entities and relationships. In addition, by supporting the set interaction model for analyzing real-time interactions between entities, it is possible to more accurately learn the representation of entities, more accurately model the relationships between entities, and have stronger generalization capabilities, thereby solving the defect that the prior art cannot be updated as the content and structure of the knowledge graph change. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A schematic diagram of a process of a knowledge graph completion method of the present invention;
[0040] Figure 2 This is a schematic diagram of the composition of a knowledge graph completion system of the present invention. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] refer to Figure 1-2 , a knowledge graph completion method, specifically comprising:
[0043] Analyze the graph structure data of the knowledge graph based on the graph convolutional network model to obtain the connection relationship between entities;
[0044] Analyze the similarity of entities in the knowledge graph based on the similarity measurement model to obtain the similarity between entities;
[0045] Analyze the sequence data of the knowledge graph based on the Transformer model to obtain the dependency relationship between entities;
[0046] Analyze the interactions between entities in the knowledge graph based on the support set interaction model to obtain the interaction relationship between entities;
[0047] The knowledge graph is completed and updated based on the connection, similarity, dependency and interaction between entities.
[0048] In this embodiment, a graph convolutional network model is used to effectively capture graph structure information, and the representation of nodes is updated through multi-layer neural network layers and information aggregation of neighboring nodes, so as to learn the connection relationship between entities, and measure the similarity between entities through a similarity measurement module, so as to help identify potential entity matches or similarities and improve the ability to understand the knowledge graph. At the same time, the Transformer model is applied to sequence modeling, and the dependencies between entities are captured through a self-attention mechanism, so as to capture the complex semantic associations between entities and relationships. In addition, the support set interaction model is used to analyze the real-time interaction between entities, so as to more accurately learn the representation of entities, more accurately model the relationship between entities, and have stronger generalization ability, so as to solve the defect that the existing technology cannot be updated as the content and structure of the knowledge graph change.
[0049] Preferably, the graph structure data of the knowledge graph is analyzed based on the graph convolutional network model to obtain the connection relationship between entities, specifically including:
[0050] According to the graph structure data of the knowledge graph, the node set, edge set, adjacency matrix, degree matrix, activation function and weight matrix are obtained;
[0051] Based on the node set, edge set, adjacency matrix, degree matrix, activation function and weight matrix, the connection relationship between entities is obtained.
[0052] In this embodiment, the graph convolutional network is a deep learning model for processing graph structure data. In the knowledge graph, entities and relationships can be regarded as nodes and edges of the graph, so GCN can be used to learn the relationship between entities and the representation of entities. The mathematical formula of GCN is as follows:
[0053] Given a graph G = (V, E), where V is the set of nodes and E is the set of edges, let A be the adjacency matrix, X be the node feature matrix, and H be (l) is the node representation matrix of the lth layer, then the update rule of GCN can be expressed as:
[0054]
[0055] in, is the adjacency matrix with self-connection added, yes The degree matrix, σ is the activation function, W(l) is the weight matrix of the lth layer;
[0056] When applying graph convolutional networks (GCNs) to knowledge graphs, nodes usually represent entities (such as people, places, events, etc.) and edges represent relationships between entities (such as association, belonging, similarity, etc.). Let us explain this formula from the perspective of knowledge graphs:
[0057] H (l) represents the entity representation matrix of the lth layer, where each row represents the representation of an entity;
[0058] A is the adjacency matrix of the knowledge graph, which describes the relationship connection between entities;
[0059] D is the degree matrix, where the elements on the diagonal are the degree of each entity, i.e., the number of edges associated with the entity;
[0060] is the inverse square root matrix of the degree matrix, used to normalize the degree matrix;
[0061] It is a degree-normalized adjacency matrix, which is used to reflect the normalized relationship between entities;
[0062] W (l) is the weight matrix of the lth layer, which is used to project the entity representation into the new representation space;
[0063] σ is the activation function, usually the ReLU function;
[0064] H (l+1) is the entity representation matrix of the l+1th layer, by (l) After multiplying by the weight matrix and adjacency matrix, it is obtained through the activation function;
[0065] Through this formula, GCN can learn the relationships and representations of entities in the knowledge graph. Through multi-layer graph convolution operations, the network can gradually learn more complex relationships and representations between entities, thereby improving the representation ability and application effect of the knowledge graph.
[0066] Preferably, the similarity between entities in the knowledge graph is analyzed based on a similarity measurement model to obtain the similarity between the entities, specifically including:
[0067] Obtain entity sets based on knowledge graphs;
[0068] The similarity measurement function is called to calculate the similarity between any two entities in the entity set to obtain the similarity between every two entities.
[0069] In this embodiment, similarity measurement is a method for measuring the similarity between two entities. In the knowledge graph, similarity measurement can help identify potential entity matches or similarities. The mathematical formula of similarity measurement can be expressed as:
[0070] Similarity(e i , e j )=f(e i , e j )
[0071] Among them, e i and e j are two entities, and f is the similarity measure function.
[0072] Preferably, the analysis of the interaction between entities in the knowledge graph based on the support set interaction model to obtain the interaction relationship between the entities specifically includes:
[0073] Based on the interactions between entities in the knowledge graph, we obtain the relationship reasoning data and information transfer data between entities;
[0074] The interaction function is called to calculate the relationship reasoning data and information transfer data between entities to obtain the interaction relationship between entities.
[0075] In this embodiment, the support set interaction module is a module for learning the interaction between entities. In the knowledge graph, the interaction between entities may include relationship reasoning, information transfer, etc. The mathematical formula of the support set interaction module can be expressed as:
[0076] Interaction i , e j )=g(e i , e j )
[0077] Among them, e i and e j are two entities and g is the interaction function.
[0078] By combining the above techniques, we design a holistic knowledge graph latent model that can effectively learn entity representations and achieve good performance in knowledge graph tasks.
[0079] A knowledge graph completion system, comprising:
[0080] The graph convolutional network model analysis module is used to analyze the graph structure data of the knowledge graph based on the graph convolutional network model to obtain the connection relationship between entities;
[0081] The similarity measurement model analysis module is used to analyze the similarity of entities in the knowledge graph based on the similarity measurement model to obtain the similarity between entities;
[0082] Transformer model analysis module, which is used to analyze the sequence data of the knowledge graph based on the Transformer model to obtain the dependency relationship between entities;
[0083] The support set interaction model analysis module is used to analyze the interactions between entities in the knowledge graph based on the support set interaction model to obtain the interaction relationship between entities;
[0084] The completion and update module is used to complete and update the knowledge graph based on the connection, similarity, dependency and interaction relationships between entities.
[0085] Preferably, the graph convolutional network model analysis module includes:
[0086] The first analysis module is used to obtain a node set, an edge set, an adjacency matrix, a degree matrix, an activation function and a weight matrix based on the graph structure data of the knowledge graph;
[0087] The first calculation module is used to obtain the connection relationship between entities based on the node set, edge set, adjacency matrix, degree matrix, activation function and weight matrix.
[0088] Preferably, the similarity measurement model analysis module includes:
[0089] The second analysis module is used to obtain an entity set based on the knowledge graph;
[0090] The second calculation module is used to call the similarity measurement function to perform similarity calculation on any two entities in the entity set to obtain the similarity between every two entities.
[0091] Preferably, the support set interaction model analysis module includes:
[0092] The third analysis module is used to obtain the relationship reasoning data and information transmission data between entities based on the interactions between entities in the knowledge graph;
[0093] The third computing module is used to call the interactive function to calculate the relationship reasoning data and information transmission data between entities to obtain the interactive relationship between entities.
[0094] A computing device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned knowledge graph completion methods when executing the computer program.
[0095] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any one of the above-mentioned knowledge graph completion methods.
[0096] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A knowledge graph completion method, It is characterized in that Specifically include: Analyze the graph structure data of the knowledge graph based on the graph convolutional network model to obtain the connection relationship between entities; Analyze the similarity of entities in the knowledge graph based on the similarity measurement model to obtain the similarity between entities; Analyze the sequence data of the knowledge graph based on the Transformer model to obtain the dependency relationship between entities; Analyze the interactions between entities in the knowledge graph based on the support set interaction model to obtain the interaction relationship between entities; The knowledge graph is completed and updated based on the connection, similarity, dependency and interaction relationships between entities.
2. A knowledge graph completion method according to claim 1, It is characterized in that The graph structure data of the knowledge graph is analyzed based on the graph convolutional network model to obtain the connection relationship between entities, which specifically includes: According to the graph structure data of the knowledge graph, the node set, edge set, adjacency matrix, degree matrix, activation function and weight matrix are obtained; Based on the node set, edge set, adjacency matrix, degree matrix, activation function and weight matrix, the connection relationship between entities is obtained.
3. A knowledge graph completion method according to claim 2, It is characterized in that The similarity between entities is analyzed by the similarity measurement model, and the similarity between entities is obtained, which specifically includes: Obtain entity sets based on knowledge graphs; The similarity measurement function is called to calculate the similarity between any two entities in the entity set to obtain the similarity between every two entities.
4. A knowledge graph completion method according to claim 3, It is characterized in that The interaction between entities in the knowledge graph is analyzed based on the support set interaction model to obtain the interaction relationship between the entities, specifically including: Based on the interactions between entities in the knowledge graph, we obtain the relationship reasoning data and information transfer data between entities; The interaction function is called to calculate the relationship reasoning data and information transfer data between entities to obtain the interaction relationship between entities.
5. A knowledge graph completion system, It is characterized in that include: The graph convolutional network model analysis module is used to analyze the graph structure data of the knowledge graph based on the graph convolutional network model to obtain the connection relationship between entities; The similarity measurement model analysis module is used to analyze the similarity of entities in the knowledge graph based on the similarity measurement model to obtain the similarity between entities; Transformer model analysis module, which is used to analyze the sequence data of the knowledge graph based on the Transformer model to obtain the dependency relationship between entities; The support set interaction model analysis module is used to analyze the interactions between entities in the knowledge graph based on the support set interaction model to obtain the interaction relationship between entities; The completion and update module is used to complete and update the knowledge graph based on the connection, similarity, dependency and interaction relationships between entities.
6. A knowledge graph completion system according to claim 5, It is characterized in that The graph convolutional network model analysis module includes: The first analysis module is used to obtain a node set, an edge set, an adjacency matrix, a degree matrix, an activation function and a weight matrix based on the graph structure data of the knowledge graph; The first calculation module is used to obtain the connection relationship between entities based on the node set, edge set, adjacency matrix, degree matrix, activation function and weight matrix.
7. A knowledge graph completion system according to claim 6, It is characterized in that The similarity measurement model analysis module includes: The second analysis module is used to obtain an entity set based on the knowledge graph; The second calculation module is used to call the similarity measurement function to perform similarity calculation on any two entities in the entity set to obtain the similarity between every two entities.
8. A knowledge graph completion system according to claim 7, It is characterized in that The support set interaction model analysis module includes: The third analysis module is used to obtain the relationship reasoning data and information transmission data between entities based on the interactions between entities in the knowledge graph; The third computing module is used to call the interactive function to calculate the relationship reasoning data and information transmission data between entities to obtain the interactive relationship between entities.
9. A computing device, It is characterized in that The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the knowledge graph completion methods in claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, which, when executed by a processor, implements the steps of any one of the knowledge graph completion methods in claims 1-4.
