Knowledge graph completion method and system fusing relationship description and relationship transmission

By using the pre-trained language model BERT to encode relation description information in the knowledge graph and combining it with the relation transfer mechanism, the problem that existing knowledge graph completion models cannot make good use of rich information is solved, and a more efficient knowledge graph completion effect is achieved.

CN118227800BActive Publication Date: 2026-05-05SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
Filing Date
2024-03-22
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing knowledge graph completion models struggle to effectively utilize entity description information, relation description information, and attribute information, resulting in insufficient knowledge graph completion performance.

Method used

The pre-trained language model BERT is used to encode relation description information, generate relation context information and paths, and combine relation transitivity mechanism to obtain rich semantic information through aggregation function and update function to complete missing relations.

Benefits of technology

It improves the performance and accuracy of knowledge graph completion, especially in applications in social networks and smart city healthcare, enabling more accurate prediction and completion of missing relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118227800B_ABST
    Figure CN118227800B_ABST
Patent Text Reader

Abstract

This disclosure provides a method and system for knowledge graph completion that integrates relation description and relation propagation, relating to the field of knowledge graph completion technology. The method includes: acquiring relation description text information and inputting it into a language model BERT to extract description vectors of all relations, forming a relation matrix; combining entity nodes and the relation matrix, aggregating neighbor edges using an aggregation function to obtain contextual propagation messages about the set of node neighbor edges; repeating the aggregation and update functions multiple times to obtain the final contextual relation information; constructing a relation path from the relation type sequence of all edges in the original path; extracting the embedded representation of the contextual relation information and the embedded representation of the relation path; fusing the embedded representation of the contextual relation information and the embedded representation of the relation path; using the fused embedded representation to predict relation distribution and determine the relative position of the relation path, thus completing the completion of missing relations in the knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of knowledge graph completion technology, specifically to a knowledge graph completion method and system that integrates relation description and relation transfer. Background Technology

[0002] The statements in this section are merely background information relating to this disclosure and do not necessarily constitute prior art.

[0003] A knowledge graph is a structured data model used to represent knowledge, presenting the relationships between things in the form of a graph. A knowledge graph typically consists of entities, relations, and attributes, where entities represent individuals or concepts in the real world, relations represent the connections between entities, and attributes describe the characteristics of entities.

[0004] In the construction of knowledge graphs in social networks or smart city healthcare, information gaps are frequently encountered due to limitations in data sources, difficulties in information acquisition, and data inconsistencies, resulting in incomplete knowledge graphs. Based on different model methods, knowledge graph completion can be divided into three categories. Translation distance-based knowledge graph completion methods utilize representation learning techniques to map entities and relations to a low-dimensional continuous vector space, obtaining low-dimensional dense vector representations, and using distance metrics to evaluate the degree of association between entities. Tensor decomposition-based knowledge graph completion methods typically represent entities and relations in the knowledge graph as tensors, and then use tensor decomposition techniques to decompose these tensors into low-rank sub-tensors to capture the latent semantic information between entities and relations. The learned low-rank sub-tensors can predict missing triples or relations in the knowledge graph. Furthermore, neural networks have been widely used in knowledge graph completion tasks. Their powerful feature extraction capabilities and effective aggregation of neighborhood information enable them to better represent entities and relations, thereby improving the performance of knowledge graph completion.

[0005] Currently, most knowledge graph completion tasks face the challenge of improving performance by leveraging multi-source information. To address this issue, numerous knowledge graph completion techniques have emerged. Most current knowledge graph completion models rely on the triple structure of the knowledge graph to obtain entity and relation representations, easily overlooking much information from other sources, such as entity descriptions, relation descriptions, and attribute information. Entity and relation descriptions in knowledge graphs are typically unstructured natural language text, containing rich semantic information, which traditional neural network models struggle to handle well. While some models attempt to integrate information from other sources such as entity descriptions, relation descriptions, and attribute information, effectively utilizing this information remains a complex problem. For example, models using Convolutional Neural Networks (CNNs) and Long Short-Term Memory (LSTMs) to extract entity and relation descriptions have limited access to latent semantic information, failing to fully capture the complex relationships and semantic information between descriptions and failing to significantly improve the performance of knowledge graph completion tasks. Summary of the Invention

[0006] To address the aforementioned issues, this disclosure proposes a knowledge graph completion method and system that integrates relation description and relation propagation. The method extracts semantic information of relations from relation description information, encodes the relation description information using a pre-trained language model BERT, generates relation context information and relation paths from the obtained relation matrix, and combines the relation context information and relation paths to obtain richer semantic information, thereby improving the completion performance.

[0007] According to some embodiments, the present disclosure adopts the following technical solutions:

[0008] A knowledge graph completion method that integrates relation description and relation transitivity includes:

[0009] Obtain the relation description text information of all relations in the knowledge graph, and input it into the language model BERT to extract the description vectors of all relations to form a relation matrix;

[0010] By combining entity nodes and the relation matrix, the neighbor edges are aggregated using an aggregation function to obtain the context message about the set of neighbor edges of a node. The aggregation function and update function are repeated multiple times to obtain the final context relation information.

[0011] A relation path is constructed from the relation type sequence of all edges in the original path. The embedded representations of context relation information and relation path are extracted. The embedded representations of context relation information and relation path are fused. The fused embedded representation is used to predict the relation distribution and determine the relative position of relation path, thus completing the completion of missing relations in the knowledge graph.

[0012] According to some embodiments, the present disclosure adopts the following technical solutions:

[0013] A knowledge graph completion system that integrates relation description and relation transitivity includes:

[0014] The relation matrix construction module is used to obtain the relation description text information of all relations in the knowledge graph and input it into the language model BERT to extract the description vectors of all relations to form a relation matrix;

[0015] The relation propagation module is used to combine entity nodes and relation matrices, aggregate neighbor edges through aggregation functions, obtain context propagation messages about the set of neighbor edges of a node, repeat the aggregation function and update function multiple times to obtain the final context relation information.

[0016] The prediction and completion module is used to construct a relation path from the relation type sequence of all edges in the original path, extract the embedded representation of the context relation information and the embedded representation of the relation path, fuse the embedded representation of the context relation information and the embedded representation of the relation path, and use the fused embedded representation to predict the relation distribution and determine the relative position of the relation path, thus completing the completion of missing relations in the knowledge graph.

[0017] According to some embodiments, the present disclosure adopts the following technical solutions:

[0018] A non-transitory computer-readable storage medium is provided for storing computer instructions, which, when executed by a processor, implement the knowledge graph completion method that integrates relation description and relation transfer.

[0019] According to some embodiments, the present disclosure adopts the following technical solutions:

[0020] An electronic device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to execute the knowledge graph completion method that implements the fusion relationship description and relationship transfer.

[0021] Compared with the prior art, the beneficial effects of this disclosure are as follows:

[0022] This disclosed knowledge graph completion method integrates relation description and relation propagation. It extracts semantic information of relations from relation description information, encodes relation description information in knowledge graph using a pre-trained language model BERT, generates relation context information and relation paths from the obtained relation matrix, and combines relation context information and relation paths to obtain richer semantic information, thereby improving completion performance.

[0023] This disclosed knowledge graph completion method integrates relation description and relation propagation. It uses a pre-trained language model, BERT, to encode relation description information, obtaining richer semantic information about the relations. Combined with a relation message passing mechanism, it more accurately aggregates relation description information to obtain relation context. In the relation message passing stage, weights are calculated based on the similarity between neighbor relations and the target relation to distinguish the importance of different neighbor relations, thereby improving the efficiency and accuracy of relation prediction. Attached Figure Description

[0024] The accompanying drawings, which form part of this disclosure, are used to provide a further understanding of this disclosure. The illustrative embodiments of this disclosure and their descriptions are used to explain this disclosure and do not constitute an undue limitation of this disclosure.

[0025] Figure 1 This is a schematic diagram of the method flow of an embodiment of this disclosure; Detailed Implementation

[0026] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.

[0027] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains.

[0028] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this disclosure. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0029] Terminology Explanation:

[0030] Representation: Representing entities or relationships using vectors or other forms of data structures so that computers can understand and process them.

[0031] Embedding refers to the process of mapping objects (such as words, text, entities, etc.) from a high-dimensional space to a low-dimensional dense vector space. This representation method can help machine learning models better understand and process information in knowledge graphs.

[0032] Knowledge graph: A structured data model used to represent knowledge, presenting relationships between things in the form of a graph. A knowledge graph typically consists of entities, relations, and attributes, where entities represent individuals or concepts in the real world, relations represent the connections between entities, and attributes describe the characteristics of entities.

[0033] Neighbor edge: In a knowledge graph, for a given edge, the edges connected to entities connected to that edge are called neighbor edges.

[0034] Example 1

[0035] One embodiment of this disclosure provides a knowledge graph completion method that integrates relation description and relation transitivity. It utilizes a pre-trained language model, BERT, to encode relation description information in the knowledge graph. The resulting relation matrix generates relation context information and relation paths. Combining the relation context information and relation paths yields richer semantic information, thereby improving completion performance. The method includes the following steps:

[0036] Step 1: Obtain the relation description text information of all relations in the knowledge graph and input it into the language model BERT to extract the description vectors of all relations to form a relation matrix;

[0037] Step 2: Combining entity nodes and the relation matrix, aggregate neighbor edges using an aggregation function to obtain contextual messages about the set of neighbor edges of a node. Repeat the aggregation and update functions multiple times to obtain the final contextual relation information.

[0038] Step 3: Construct a relation path from the relation type sequence of all edges in the original path, extract the embedded representation of the context relation information and the embedded representation of the relation path, and fuse the embedded representation of the context relation information and the embedded representation of the relation path.

[0039] Step 4: Use the fused embedding representation to predict the distribution of relations and determine the relative positions of relation paths to complete the missing relations in the knowledge graph.

[0040] As one embodiment, the knowledge graph completion method that integrates relationship description and relationship transitivity disclosed herein is implemented as follows:

[0041] Step 1: Encoding the entity relationship description text information

[0042] Relationship description information is supplementary text or attributes used to describe the relationships between entities, explaining and illustrating a specific relationship. For example, in a social network knowledge graph, for a friend relationship, the relationship description information includes relevant information such as how long the friends have known each other and their shared interests.

[0043] The relational description text information is taken as input and encoded using a pre-trained language model, BERT.

[0044] Specifically, first, the text describing the relations is prepared as input data. The text begins with [CLS] as an identifier and consists of a sequence of text describing the relations. Each term has a corresponding representation; [CLS] is selected in the context embedding as the initial representation of the relation to capture the semantic information of the entire sentence. For each relation, the relation description information is encoded using the selected token [CLS] to obtain a description vector, which contains the semantic information of the relation. All relations in the knowledge graph are traversed, and the description vector extraction step is performed for each relation. These description vectors are then combined into a relation matrix E, which serves as the representation matrix of the relations.

[0045] Step 2: Contextual message passing combining nodes and relationships

[0046] In a knowledge graph, each edge has a relation type. Entities in a knowledge graph are typically abstracted as nodes in the graph, with each entity corresponding to a node in the graph structure. The edge to be aggregated is designated as the target edge, the head and tail entities connected to the target edge serve as "transfer centers," and the edges connected to vertices are called neighbor edges. The head or tail entity collects and temporarily stores messages from neighbor edges, then propagates the aggregated message back to each of its neighbor edges. In a knowledge graph, a node often connects to several edges. To differentiate the influence of neighbor edges of varying importance on the target edge, the attention weights of the target edge and neighbor edges are obtained by calculating the similarity between the neighbor edges and the target edge.

[0047] Specifically, each edge in the knowledge graph connects two nodes. For each node v, an aggregation function is used to aggregate the neighboring edges of v, resulting in a message about the set of neighboring edges of that node. in This represents the set of neighboring edges of node v. Let e ​​be the hidden state of edge e during the iteration. Indicates the current edge e j With the target edge e k Attention weight, which is determined by the value when edge e j With the target edge e kThe similarity is calculated, where σ is the non-linear activation function LeakyReLU (slope α = 0.2 for negative inputs). The advantage of LeakyReLU over ReLU is that it has a small slope in the negative region, thus avoiding the "dead neuron" problem and making it easier to train deep neural networks. When the input value is negative, the output value will be 0.2 times the input value, instead of directly becoming 0 as in the traditional ReLU function. This setting helps alleviate the vanishing gradient problem.

[0048]

[0049]

[0050] in, The message passed to the neighbor edge set of node v in the i-th iteration. Let e ​​be the hidden state of edge e in the i-th iteration. Indicates the current edge e j With the target edge e k The attention weight in the i-th iteration is determined by the value obtained when edge e... j With the target edge e k The similarity is calculated, where σ is the non-linear activation function LeakyReLU (negative input slope α = 0.2). v represents a node. T is the matrix transpose operation. It represents the set of neighboring edges of node v.

[0051] Aggregate the neighbor edge information of the two nodes connected by an edge, and update the hidden state of the edge using the edge update function. This represents the hidden state of edge e in iteration i. and This represents the neighbor information of the edges that converge at the two vertices connected by the edge.

[0052]

[0053] In the formula, [·] is the join function, w i and b i These are the learnable transformation matrix and the bias, respectively. This is the initial feature of edge e. This represents the set of nodes connected by the edge. The above equation passes the context message of the relation, and the aggregation and update functions are repeated k times to obtain the final relation information. and These are respectively used as representations of the head entity h and the tail entity t.

[0054] Linear transformations are typically performed using weight matrices and biases. In each layer of a neural network, the input (x) undergoes a linear transformation to obtain the output (y), where the weight matrix (w)... i ) and bias (b i ) are learnable parameters.

[0055] Step 3: Construct the relationship path

[0056] Relational context messaging can only detect the "type" of the head entity h and the tail entity t, but does not know their relative positions in the knowledge graph. In order to accurately identify the relative positions between the head entity h and the tail entity t in the knowledge graph, we propose to explore the connectivity patterns between the head entity h and the tail entity t, which are represented as their path representations in the knowledge graph.

[0057] The specific steps are as follows: Represent the corresponding relation path P in the knowledge graph using the sequence of relation types of all edges in the original path, i.e. in Given the relation type of edge e, It is represented as the set of all relation paths from h to t in the knowledge graph, and for each relation path... Calculate an embedding vector s p Here, a recurrent neural network (RNN) is used to learn the table of relational paths:

[0058]

[0059] in, Represents a relation path, s p This represents the embedding vector obtained after processing the path using an RNN model. The original path is the existing relational path, obtained by exploring the connectivity patterns between entity h and tail entity t.

[0060] Step 4: Combine relation context and relation path to complete relation prediction

[0061] Relational context captures information about adjacent relationships in a knowledge graph. While adjacent relationships provide the properties and types of a given entity, they cannot identify the relative positions between head and tail entities in the knowledge graph. Combining relational context with relational paths allows us to monitor the relative positions of entities in the knowledge graph based on their types. Relational context helps predict relational distribution and determine the relative positions of relational paths, thereby enabling the prediction of missing relations in the knowledge graph.

[0062] Specifically, for a relational context, the message-passing method is used to iterate k times to calculate the final relational message h and t. and Summarize their contextual information separately. and Further combining these calculations yields the context of the entity pair (h,t), s (h,t) The contextual representation of an entity pair (h,t):

[0063]

[0064] Among them, b K-1 It represents a learnable bias term.

[0065] Path importance score is used to calculate the importance of a relation path, based on s (h,t) Path importance score α p In the formula It is the set of all paths from h to t, s p For relational paths Embedded representation:

[0066]

[0067] in, It is s p The matrix transpose operation.

[0068] Use context information s (h,t) To help identify the most important relationship paths, attention weights are then applied to the average representation of all paths.

[0069]

[0070] Among them, s h→t It is an aggregate representation of the relationship path from head entity h to tail entity t, α P The path importance score, s P Represents s P For relational paths Embedded representation.

[0071] Given a relation context representation s (h,t) Relational path representation s h→t First, the two representations are fused and added together, and then the softmax function is taken (the softmax function is a commonly used activation function), as shown below:

[0072] p(r|h,t)=softmax(s (h,t) +s h→t )

[0073] Training is performed by minimizing the loss between the predicted and actual values ​​on the training triples, where J(·) is the cross-entropy loss function:

[0074]

[0075] in, Let (h,r,t) be the training set, and (h,r,t) represent each sample in the training. p(r|h,t) represents the conditional probability of relation r given the head entity h and the tail entity t.

[0076] As one embodiment, taking the completion of a knowledge graph in the field of smart city healthcare as an example, the implementation process of completing a knowledge graph in the field of smart city healthcare using the knowledge graph completion method disclosed herein includes:

[0077] The process involves acquiring the knowledge graph for the smart city healthcare domain to be completed, and extracting relational descriptions from it. For example, the description of the "belonging department" relation includes its explanation ("belonging department typically refers to different departments or offices within a hospital, each responsible for different medical services, management, and support work") and its attribute information. This information is then encoded using a pre-trained BERT language model. Relational descriptions describe the relationships within the knowledge graph and contain rich semantic information about those relationships.

[0078] The encoded relation description vectors are combined to obtain the relation representation matrix E, which contains relation semantic information.

[0079] The encoded relation vector containing relational semantic information is aggregated using a relational message passing method. The head entity h "epilepsy" and the tail entity t "neurology" are then represented by the aggregated relational information. and

[0080] In a knowledge graph, there are multiple paths from the head entity h to the tail entity t. The corresponding relation paths P in the knowledge graph are represented using a sequence of edge relation types, i.e. Let represent the set of all paths from head entity h to tail entity t. Encoding each relation path yields the relation path embedding vector s. P .

[0081] The obtained relational information and the following information By combining these elements further, we obtain the contextual representation s of the relation. (h,t) .

[0082] Calculate the importance of each path from the head entity h to the tail entity t, i.e., the path importance score based on the relational context, which is the relational path attention weight α. P .

[0083] The importance score of a path helps identify the most important relational paths. Applying attention weights to the average representation of all paths yields the relational path representation s. h→t .

[0084] Represent the relational context as s (h,t) Relational path representation s h→t The relationships are summed to calculate the probability score p(r|h,t). The existence of the relationship is determined based on the score, thus completing the knowledge graph of the smart city healthcare field.

[0085] Example 2

[0086] One embodiment of this disclosure provides a knowledge graph completion system that integrates relation description and relation transitivity, including:

[0087] The relation matrix construction module is used to obtain the relation description text information of all relations in the knowledge graph and input it into the language model BERT to extract the description vectors of all relations to form a relation matrix;

[0088] The relation propagation module is used to combine entity nodes and relation matrices, aggregate neighbor edges through aggregation functions, obtain context propagation messages about the set of neighbor edges of a node, repeat the aggregation function and update function multiple times to obtain the final context relation information.

[0089] The prediction and completion module is used to construct a relation path from the relation type sequence of all edges in the original path, extract the embedded representation of the context relation information and the embedded representation of the relation path, fuse the embedded representation of the context relation information and the embedded representation of the relation path, and use the fused embedded representation to predict the relation distribution and determine the relative position of the relation path, thus completing the completion of missing relations in the knowledge graph.

[0090] Example 3

[0091] One embodiment of this disclosure provides a non-transitory computer-readable storage medium for storing computer instructions. When these computer instructions are executed by a processor, they implement the knowledge graph completion method that integrates relationship description and relationship transfer.

[0092] Example 4

[0093] One embodiment of this disclosure provides an electronic device, including: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to execute the knowledge graph completion method that implements the fusion relationship description and relationship transfer.

[0094] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0095] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0096] While the specific embodiments of this disclosure have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of this disclosure. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this disclosure are still within the scope of protection of this disclosure.

Claims

1. A knowledge graph completion method that integrates relation description and relation transitivity, characterized in that, include: Obtain the relation description text information of all relations in the knowledge graph, and input it into the language model BERT to extract the description vectors of all relations to form a relation matrix; By combining entity nodes and the relation matrix, the neighbor edges are aggregated using an aggregation function to obtain the context message about the set of neighbor edges of a node. The aggregation function and update function are repeated multiple times to obtain the final context relation information. In the knowledge graph, each edge has a relation type, each entity corresponds to a node in the graph, the edge to be aggregated is the target edge, the head entity and tail entity connected by the target edge are the transmission center, the edge connected to the vertex is the neighbor edge, the head entity or tail entity collects and temporarily stores the messages from the neighbor edge, and then propagates the aggregated message back to each of their neighbor edges. In a knowledge graph, a node is often connected to several edges. Therefore, we need to distinguish the influence of neighboring edges of different importance on the target edge and obtain the attention weights of the target edge and neighboring edges by calculating the similarity between the neighboring edges and the target edge. A relation path is constructed from the relation type sequence of all edges in the original path. The embedded representations of context relation information and relation path are extracted. The embedded representations of context relation information and relation path are fused. The fused embedded representation is used to predict the relation distribution and determine the relative position of relation path, thus completing the completion of missing relations in the knowledge graph. For relational context, the message passing method is used to calculate the final relational messages of the head entity and the tail entity, and their contextual information is summarized separately. The final relational messages are combined together to calculate the context of the entity pair (h,t) and the contextual embedding representation of the entity pair (h,t). The most important relational paths are identified using the contextual information, and then the attention weights are applied to the average representation of all paths to obtain the relational path embedding representation.

2. The knowledge graph completion method that integrates relation description and relation transitivity as described in claim 1, characterized in that, The relation description text information is used as input data for the language model BERT. A specific token [CLS] is selected as the initial representation of the relation to capture the semantic information of the entire sentence. For each relation, the relation description information is encoded using the selected token [CLS] to obtain a description vector. The description vector contains the semantic information of the relation. All relations in the knowledge graph are traversed, and the description vector is extracted for each relation. These description vectors are then combined into a relation matrix.

3. The knowledge graph completion method that integrates relation description and relation transitivity as described in claim 1, characterized in that, Aggregate the neighbor edge information of the two nodes connected by an edge, update the hidden state of the edge using the update function of the other edge, obtain the context message of the relationship, repeat the aggregation function and update function k times to obtain the final relationship information and the representation as the head entity and tail entity respectively.

4. The knowledge graph completion method that integrates relation description and relation transitivity as described in claim 1, characterized in that, The corresponding relational paths in the knowledge graph are represented by the relational type sequence of all edges in the original path, and the set of all relational paths from the head entity and tail entity in the knowledge graph is obtained, and an independent embedding vector is assigned to each relational path.

5. A knowledge graph completion system that integrates relation description and relation transitivity, characterized in that, include: The relation matrix construction module is used to obtain the relation description text information of all relations in the knowledge graph and input it into the language model BERT to extract the description vectors of all relations to form a relation matrix; The relation propagation module is used to combine entity nodes and relation matrices, aggregate neighbor edges through aggregation functions, obtain context propagation messages about the set of neighbor edges of a node, repeat the aggregation function and update function multiple times to obtain the final context relation information. In the knowledge graph, each edge has a relation type, each entity corresponds to a node in the graph, the edge to be aggregated is the target edge, the head entity and tail entity connected by the target edge are the transmission center, the edge connected to the vertex is the neighbor edge, the head entity or tail entity collects and temporarily stores the messages from the neighbor edge, and then propagates the aggregated message back to each of their neighbor edges. In a knowledge graph, a node is often connected to several edges. Therefore, we need to distinguish the influence of neighboring edges of different importance on the target edge and obtain the attention weights of the target edge and neighboring edges by calculating the similarity between the neighboring edges and the target edge. The prediction and completion module is used to construct a relation path from the relation type sequence of all edges in the original path, extract the embedding representation of the context relation information and the embedding representation of the relation path, fuse the embedding representation of the context relation information and the embedding representation of the relation path, and use the fused embedding representation to predict the relation distribution and determine the relative position of the relation path, thereby completing the completion of missing relations in the knowledge graph. For relational context, the message passing method is used to calculate the final relational messages of the head entity and the tail entity, and their contextual information is summarized separately. The final relational messages are combined together to calculate the context of the entity pair (h,t) and the contextual embedding representation of the entity pair (h,t). The most important relational paths are identified using the contextual information, and then the attention weights are applied to the average representation of all paths to obtain the relational path embedding representation.

6. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium is used to store computer instructions, which, when executed by a processor, implement the knowledge graph completion method for fusing relationship description and relationship transfer as described in any one of claims 1-4.

7. An electronic device, characterized in that, include: The device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to perform the knowledge graph completion method that integrates relation description and relation transfer as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Knowledge graph completion method

    CN113360664A

  • Knowledge graph completion method based on context awareness

    CN115905568A