A knowledge graph embedding representation method and device

By combining graph attention networks and circular convolutions, the utilization of neighborhood information in knowledge graph models is optimized, solving the problem of neglecting neighborhood information in existing technologies and improving the knowledge reasoning and fusion capabilities of knowledge graphs.

CN117035070BActive Publication Date: 2026-03-27MAINTENANCE BRANCH OF STATE GRID FUJIAN ELECTRIC POWER +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-09
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing knowledge graph models ignore neighborhood information around triples during modeling, making it difficult to effectively handle rare entities with limited associated knowledge.

Method used

A knowledge graph embedding representation method is adopted, which calculates the relative attention coefficient and relative structure coefficient through graph attention network to correct the weights in the neighborhood of the central node, and uses circular convolution to fuse the relationship embedding between entities to optimize the utilization of neighborhood information.

Benefits of technology

It improves the knowledge reasoning and fusion capabilities of knowledge graphs, effectively utilizes the neighborhood information of triples, and enhances the ability to mine neighborhood features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117035070B_ABST
    Figure CN117035070B_ABST
Patent Text Reader

Abstract

The application discloses a knowledge graph embedding representation method and device, wherein the weights of each adjacent node in the neighborhood of an original central node in a knowledge graph are corrected by using relative attention coefficients and relative structure coefficients, then the relationship embedding between entities is fused in a circular convolution manner, the neighborhood features of the central node can be deeply mined from the neighborhood structure and the adjacent nodes, the information intake capacity of the central node to the neighborhood can be better optimized, the neighborhood information of the triplets can be effectively utilized, and the knowledge reasoning and fusion capacity can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of knowledge graph, and particularly relates to a knowledge graph embedding representation method and device. BACKGROUND

[0002] The concept of knowledge graph (KG) was formally proposed by Google in 2012, and is mainly used to improve the performance of search engines. In essence, a knowledge graph is a semantic network that expresses the semantic relationships between entities of various types. A knowledge graph is a directed graph with different types of entities as nodes and various relationships between entities as edges. It is usually stored using the Resource Description Framework (RDF) standard in the form of triples (head, relation, tail), which is abbreviated as (h, r, t), where h represents the head entity, t represents the tail entity, and r represents the relationship between the head entity h and the tail entity t. Current knowledge graphs play a crucial role in data mining, artificial intelligence, and other fields, and have promoted the development of artificial intelligence applications such as intelligent question answering and personalized travel recommendations.

[0003] With the advent of the big data era, the scale of knowledge graphs has grown rapidly, and various large-scale knowledge graphs such as Freebase, WordNet, and DBpedia have emerged. In recent years, methods for learning vector representations of entities and relationships in knowledge graphs have become very popular. Translational models represented by TransE model relationships as translation vectors from head entities to tail entities. Due to its simplicity and effectiveness, it has become a representative model of knowledge representation learning. Other models such as TransH, TransR, CTransR, and TransD, which are extensions of TransE, have also achieved good results.

[0004] However, the above models all assume that triples are independent of each other, and ignore the neighborhood information around the triples when modeling, so they cannot handle rare entities with less associated knowledge. SUMMARY

[0005] The technical problem to be solved by the present application is to provide a knowledge graph embedding representation method and device that can effectively utilize neighborhood information of triples and improve the ability of knowledge reasoning and fusion.

[0006] To solve the above technical problems, the present application adopts a technical solution:

[0007] A knowledge graph embedding representation method, comprising the steps of:

[0008] input the relation embedding vector and the entity embedding vector into a graph attention network to obtain an attention coefficient containing a relation feature between two entities, and determine a relative attention coefficient and a relative structure coefficient based on the attention coefficient;

[0009] correct the weight of each neighbor node in a neighborhood of an original center node in the knowledge graph using the relative attention coefficient and the relative structure coefficient to obtain a corrected attention weight, and calculate a new entity embedding vector representation according to each neighbor node and the corresponding corrected attention weight of the neighbor node;

[0010] fuse the relation embedding between entities in a circular convolution manner according to the new entity embedding vector representation to obtain a head entity vector and a tail entity vector in a relation space;

[0011] calculate a loss function based on the head entity vector and the tail entity vector in the relation space, and train a knowledge graph embedding model using the loss function to obtain a trained knowledge graph embedding model.

[0012] To solve the above technical problems, another technical solution adopted by the present application is:

[0013] A knowledge graph embedding representation device comprises:

[0014] a coefficient determination module configured to input a relation embedding vector and an entity embedding vector into a graph attention network to obtain an attention coefficient containing a relation feature between two entities, and determine a relative attention coefficient and a relative structure coefficient based on the attention coefficient;

[0015] a weight correction module configured to correct the weight of each neighbor node in a neighborhood of an original center node in the knowledge graph using the relative attention coefficient and the relative structure coefficient to obtain a corrected attention weight, and calculate a new entity embedding vector representation according to each neighbor node and the corresponding corrected attention weight of the neighbor node;

[0016] a fusion module configured to fuse the relation embedding between entities in a circular convolution manner according to the new entity embedding vector representation to obtain a head entity vector and a tail entity vector in a relation space;

[0017] a training module configured to calculate a loss function based on the head entity vector and the tail entity vector in the relation space, and train a knowledge graph embedding model using the loss function to obtain a trained knowledge graph embedding model.

[0018] Further, the coefficient determination module is configured to input a relation embedding vector and an entity embedding vector into a graph attention network to obtain an attention coefficient containing a relation feature between two entities, and determine a relative attention coefficient and a relative structure coefficient based on the attention coefficient;

[0019] inputting the relation embedding vector and the entity embedding vector into a graph attention network to obtain an attention parameter containing a relation feature between two entities;

[0020] processing the attention parameter and a linear transformation parameter matrix based on a nonlinear activation function to obtain an attention coefficient containing the relation feature between the two entities.

[0021] Further, the processing the attention parameter and the linear transformation parameter matrix based on the nonlinear activation function to obtain the attention coefficient containing the relation feature between the two entities comprises:

[0022] b ijk = LeakyReLU(Vt ijk );

[0023] In the formula, LeakyReLU() represents the nonlinear activation function, b ijk represents the attention coefficient containing the relation feature between the two entities, V represents the linear transformation parameter matrix, and t ijk represents the attention parameter.

[0024] Further, the coefficient determination module, configured to determine a relative attention coefficient and a relative structure coefficient based on the attention coefficient, comprises:

[0025]

[0026]

[0027] In the formula, δ ij represents the relative attention coefficient, υ ij represents the relative structure coefficient, N i represents a neighbor node set of node i, N j represents a neighbor node set of node j, |N i | represents a number of neighbor nodes of node i, |N j | represents a number of neighbor nodes of node j, x represents any common neighbor node of node i and node j, b ixk′ represents an attention coefficient between node i and its neighbor node x, k' represents a direct relation between node i and its neighbor node x, represents an attention coefficient between node j and its neighbor node x, represents a direct relation between node j and its neighbor node x, b ijk represents the attention coefficient containing the relation feature between the two entities, S represents a correct triple set, Cov() represents a covariance, and σ() represents a standard deviation.

[0028] Further, the weight correction module is configured to correct the weight of each neighbor node in the neighborhood of the original center node in the knowledge graph using the relative attention coefficient and the relative structure coefficient, to obtain a corrected attention weight, including:

[0029]

[0030] wherein a ijk represents the corrected attention weight, δ in represents the relative attention coefficient of node i and its neighbor node n, υ in represents the relative structure coefficient of node i and its neighbor node n, b inz represents the attention coefficient between node i and its neighbor node n.

[0031] Further, the weight correction module is configured to calculate each neighbor node and its corresponding corrected attention weight to obtain a new entity embedding vector representation, including:

[0032] The new entity embedding vector representation is obtained by multiplying each neighbor node and its corresponding corrected attention weight based on the multi-head attention mechanism.

[0033] Further, the new entity embedding vector representation is obtained by multiplying each neighbor node and its corresponding corrected attention weight based on the multi-head attention mechanism, including:

[0034]

[0035]

[0036]

[0037] wherein M represents the number of times of multi-head attention network, represents the embedding vector representation of the new head entity, represents the embedding vector representation of the new tail entity, a ijk m represents the corrected attention weight corresponding to the neighbor node in the mth time, t ijk m represents the attention parameter containing the relationship feature between the two entities for the mth time of attention calculation, W m [] represents the mth linear transformation matrix.

[0038] Further, the fusion module is configured to fuse the relationship embedding between entities using the circular convolution method according to the new entity embedding vector representation, to obtain the head entity vector and the tail entity vector in the relationship space, including:

[0039]

[0040]

[0041] wherein h ⊥ denotes the head entity vector under the relation space, t ⊥ denotes the tail entity vector under the relation space, denotes the embedding vector representation of the new head entity, denotes the embedding vector representation of the new tail entity, r k denotes the relation embedding matrix R row vector, denotes the circular convolution operation, denotes the fusion relation coefficient, R h denotes the relation mapping vector of the head entity to be learned, R t denotes the relation mapping vector of the tail entity to be learned, b h denotes the bias parameter vector of the head entity, b t denotes the bias parameter vector of the tail entity.

[0042] Further, the training module is configured to calculate a loss function based on the head entity vector and the tail entity vector under the relation space, and the loss function comprises:

[0043]

[0044]

[0045] wherein L denotes the loss function, f r (h, r, t) denotes the first score function of the correct triple, f r (h', r, t') denotes the score function of the incorrect triple, γ denotes the margin boundary parameter, S denotes the correct triple set, S' denotes the incorrect triple set, (h, r, t) denotes the correct triple, and (h', r, t') denotes the incorrect triple.

[0046] The present application has the beneficial effect that, unlike the prior art which mainly focuses on the information aggregation of neighboring nodes and fails to effectively utilize the structural features of the neighborhood, the present application corrects the weights of each neighboring node in the neighborhood of the original center node in the knowledge graph by using the relative attention coefficient and the relative structure coefficient, and then fuses the relation embedding between entities in a circular convolution manner, which can simultaneously deeply mine the neighborhood features of the center node from the neighborhood structure and the neighboring nodes, and better optimize the information intake ability of the center node to the neighborhood, thereby effectively utilizing the neighborhood information of the triple and improving the knowledge reasoning and fusion ability. BRIEF DESCRIPTION OF DRAWINGS

[0047] Figure 1 A step flowchart of a knowledge graph embedding representation method according to an embodiment of the present application;

[0048] Figure 2 A structural schematic diagram of a knowledge graph embedding representation device according to an embodiment of the present application;

[0049] Figure 3 A neighborhood structure diagram corresponding to an entity in a knowledge graph in a knowledge graph embedding representation method according to an embodiment of the present application;

[0050] Figure 4 A circumferential convolution interaction mode diagram in a knowledge graph embedding representation method according to an embodiment of the present application. DETAILED DESCRIPTION

[0051] To make the technical content of the present application, the purposes and effects achieved more clear, the following will be described in detail in conjunction with the embodiments and the accompanying drawings.

[0052] Please refer to Figure 1 The embodiment of the present application provides a knowledge graph embedding representation method, comprising the steps of:

[0053] inputting the relation embedding vector and the entity embedding vector into a graph attention network to obtain an attention coefficient containing the relation feature between two entities, and determining a relative attention coefficient and a relative structure coefficient based on the attention coefficient;

[0054] using the relative attention coefficient and the relative structure coefficient to correct the weight of each neighbor node in the neighborhood of the original center node in the knowledge graph, obtaining a corrected attention weight, and calculating a new entity embedding vector representation according to each neighbor node and the corresponding corrected attention weight thereof;

[0055] fusing the relation embedding between entities using a circumferential convolution mode according to the new entity embedding vector representation, obtaining a head entity vector and a tail entity vector in a relation space;

[0056] calculating a loss function based on the head entity vector and the tail entity vector in the relation space, and training a knowledge graph embedding model using the loss function to obtain a trained knowledge graph embedding model.

[0057] From the above description, it can be seen that the beneficial effects of the present application are that, unlike the prior art which mainly focuses on information aggregation of neighbor nodes and fails to effectively utilize neighborhood structure features, the present application corrects the weight of each neighbor node in the neighborhood of the original center node in the knowledge graph using a relative attention coefficient and a relative structure coefficient, and then fuses the relation embedding between entities using a circumferential convolution mode, which can simultaneously deeply mine the neighborhood features of the center node from both the neighborhood structure and the neighbor nodes, better optimizes the information intake ability of the center node to the neighborhood, and thus effectively utilizes the neighborhood information of the triplets and improves the ability of knowledge reasoning and fusion.

[0058] Further, the inputting the relation embedding vector and the entity embedding vector into the graph attention network to obtain an attention coefficient containing a relation feature between two entities includes:

[0059] The relation embedding vector and the entity embedding vector are inputted into the graph attention network to obtain an attention parameter containing a relation feature between two entities.

[0060] The attention parameter is processed based on a linear transformation parameter matrix using a nonlinear activation function to obtain an attention coefficient containing a relation feature between two entities.

[0061] As can be seen from the above description, the attention coefficient contains a relation feature between two entities, so as to further mine the feature and extract more neighborhood information.

[0062] Further, the processing of the attention parameter based on the linear transformation parameter matrix using the nonlinear activation function to obtain the attention coefficient containing the relation feature between two entities includes:

[0063] b ijk = LeakyReLU(Vt ijk );

[0064] In the formula, LeakyReLU() represents the nonlinear activation function, b ijk represents the attention coefficient containing the relation feature between two entities, V represents the linear transformation parameter matrix, and t ijk represents the attention parameter.

[0065] As can be seen from the above description, the attention parameter is processed based on the linear transformation parameter matrix using the nonlinear activation function to avoid that a multi-layer network is equivalent to a single-layer linear function, strengthen the representation ability of the network, and thus obtain greater learning and fitting ability.

[0066] Further, the determination of a relative attention coefficient and a relative structure coefficient based on the attention coefficient includes:

[0067]

[0068]

[0069] In the formula, δ ij represents the relative attention coefficient, υ ij represents the relative structure coefficient, N i represents a neighborhood node set of node i, N j represents a neighborhood node set of node j, |N i | represents a number of neighborhood nodes of node i, and |N j| represents the number of adjacent nodes of node j, x represents any common adjacent node of node i and node j, b ixk′ represents the attention coefficient between node i and its adjacent node x, k' represents the direct relationship between node i and its adjacent node x, represents the attention coefficient between node j and its adjacent node x, represents the direct relationship between node j and its adjacent node x, b ijk represents the attention coefficient containing the relationship characteristics between two entities, S represents the correct triple set, Cov() represents the covariance, and σ() represents the standard deviation.

[0070] As can be seen from the above description, for the relative attention coefficient, if the adjacent nodes b and c of the center node a are connected by a direct relationship, it means that b and c also have the same attribute characteristics, and they are both adjacent nodes of a. Therefore, for node b, the center node a can not only aggregate the characteristics represented by the relationship between a and b from b, but also a small amount of characteristics contained in c from b, because b and c have a direct relationship, and the characteristics in c are less than those in b. In addition, for the relative structure coefficient, if nodes x and y contain several same adjacent nodes, and the distance from x and y to any adjacent node is similar, it means that the higher the position coincidence degree of the two nodes in the common neighborhood, the more similar they are. The relative attention coefficient and the relative structure coefficient designed in this way can maximize the information intake ability of the center node to the neighborhood, thereby improving the ability of knowledge reasoning and fusion.

[0071] Further, the use of the relative attention coefficient and the relative structure coefficient to correct the weight of each adjacent node in the neighborhood of the original center node in the knowledge graph to obtain the corrected attention weight includes:

[0072]

[0073] In the formula, a ijk represents the corrected attention weight, δ in represents the relative attention coefficient of node i and its adjacent node n, υ in represents the relative structure coefficient of node i and its adjacent node n, b inz represents the attention coefficient between node i and its adjacent node n.

[0074] As can be seen from the above description, using the relative attention coefficient and the relative structure coefficient to correct the weight of each adjacent node in the neighborhood of the original center node in the knowledge graph can simultaneously deeply mine the neighborhood characteristics of the center node from the structure and the adjacent nodes in the neighborhood, and then effectively utilize the neighborhood information to assist in modeling the triple in the knowledge graph, thereby providing more semantic information for the entity.

[0075] Further, the calculating, according to each neighbor node and the corresponding modified attention weight, of a new entity embedding vector representation includes:

[0076] The multiplying, based on the multi-head attention mechanism, of each neighbor node and the corresponding modified attention weight, obtains a new entity embedding vector representation.

[0077] As can be seen from the above description, in order to avoid overfitting, the multi-head attention mechanism is used to make the embedding vector representations independent of each other, so as to better stabilize the learning process and encapsulate as much neighbor node information as possible.

[0078] Further, the multiplying, based on the multi-head attention mechanism, of each neighbor node and the corresponding modified attention weight, obtains a new entity embedding vector representation.

[0079]

[0080]

[0081]

[0082] In the formula, M represents the number of times of multi-head attention network, represents the embedding vector representation of the new head entity, represents the embedding vector representation of the new tail entity, a ijk m represents the modified attention weight corresponding to the mth neighbor node, t ijk m represents the attention parameter containing the relationship feature between the two entities for the mth attention calculation, W m [] represents the mth linear transformation matrix.

[0083] As can be seen from the above description, multiplying the neighbor node and the corresponding attention weight can update the center node information, and then the multi-head attention layer will generate a new entity embedding vector representation, so as to effectively utilize the neighborhood information to assist in modeling the triples in the knowledge graph and provide more semantic information for the entities, thereby improving the ability of knowledge reasoning and fusion.

[0084] Further, the using, according to the new entity embedding vector representation, of the circular convolution method to fuse the relationship embedding between entities, to obtain the head entity vector and the tail entity vector in the relationship space includes:

[0085]

[0086]

[0087] wherein h ⊥ denotes the head entity vector under the relation space, t ⊥ denotes the tail entity vector under the relation space, denotes the embedding vector representation of the new head entity, denotes the embedding vector representation of the new tail entity, r k denotes the relation embedding matrix R row vector, Θ denotes the circular convolution operation, μ denotes the fusion relation coefficient, R h denotes the relation mapping vector of the head entity to be learned, R t denotes the relation mapping vector of the tail entity to be learned, b h denotes the bias parameter vector of the head entity, b t denotes the bias parameter vector of the tail entity.

[0088] As can be seen from the above description, considering the influence of the relationship between the head entity and the tail entity on the head entity and the tail entity, the relationship embedding between the entities is fused using the circular convolution manner, which can further mine the neighborhood structure and the neighborhood characteristics of the adjacent nodes to the center node.

[0089] Further, the calculation of the loss function based on the head entity vector and the tail entity vector under the relation space comprises:

[0090]

[0091]

[0092] wherein L denotes the loss function, f r (h, r, t) denotes the first score function of the correct triple, f r (h', r, t') denotes the score function of the incorrect triple, γ denotes the margin boundary parameter, S denotes the correct triple set, S' denotes the incorrect triple set, (h, r, t) denotes the correct triple, and (h', r, t') denotes the incorrect triple.

[0093] As can be seen from the above description, the loss function designed in the above manner can be used for subsequent training of the knowledge graph embedding model, so that the knowledge graph embedding model has the best embedding representation effect.

[0094] Please refer to Figure 2 Another embodiment of the present application provides a knowledge graph embedding representation device, comprising:

[0095] The coefficient determination module is configured to input the relation embedding vector and the entity embedding vector into the graph attention network to obtain the attention coefficient containing the relationship characteristics between the two entities, and determine the relative attention coefficient and the relative structure coefficient based on the attention coefficient.

[0096] a weight correction module, configured to correct weights of each neighbor node in a neighborhood of an original center node in a knowledge graph using the relative attention coefficient and the relative structure coefficient, to obtain a corrected attention weight, and to calculate a new embedding vector representation of an entity according to each neighbor node and the corresponding corrected attention weight of the neighbor node;

[0097] a fusion module, configured to fuse relationship embeddings between entities in a circular convolution manner according to the new embedding vector representation of the entity to obtain a head entity vector and a tail entity vector in a relationship space;

[0098] a training module, configured to calculate a loss function based on the head entity vector and the tail entity vector in the relationship space, and to train the knowledge graph embedding model using the loss function to obtain a trained knowledge graph embedding model.

[0099] From the above description, it can be seen that the beneficial effects of the present application are as follows: unlike the prior art which mainly focuses on information aggregation of neighbor nodes and fails to effectively utilize neighborhood structure features, the present application corrects weights of each neighbor node in a neighborhood of an original center node in a knowledge graph using a relative attention coefficient and a relative structure coefficient, and then fuses relationship embeddings between entities in a circular convolution manner, which can simultaneously deeply mine neighborhood features of the center node from both neighborhood structure and neighbor nodes, better optimize the information intake ability of the center node to the neighborhood, effectively utilize neighborhood information of triplets, and improve the ability of knowledge reasoning and fusion.

[0100] Further, the coefficient determination module is configured to input the relationship embedding vector and the entity embedding vector into a graph attention network to obtain an attention coefficient containing relationship features between two entities, including:

[0101] inputting the relationship embedding vector and the entity embedding vector into the graph attention network to obtain an attention parameter containing relationship features between two entities;

[0102] processing the attention parameter and a linear transformation parameter matrix based on a nonlinear activation function to obtain an attention coefficient containing relationship features between two entities.

[0103] As can be seen from the above description, the attention coefficient contains relationship features between two entities, so as to subsequently deeply mine based on the features to extract more neighborhood information.

[0104] Further, the processing the attention parameter and the linear transformation parameter matrix based on the nonlinear activation function to obtain the attention coefficient containing the relationship features between the two entities includes:

[0105] b ijk = LeakyReLU(Vt ijk );

[0106] wherein LeakyReLU() represents the nonlinear activation function, b ijk represents the attention coefficient containing the relationship feature between two entities, V represents the linear transformation parameter matrix, t ijk represents the attention parameter.

[0107] As can be seen from the above description, the nonlinear activation function is used to process the attention parameter and the linear transformation parameter matrix, so as to avoid that the multi-layer network is equivalent to a single-layer linear function, strengthen the representation ability of the network, and thus obtain greater learning and fitting ability.

[0108] Further, the coefficient determination module is configured to determine a relative attention coefficient and a relative structure coefficient based on the attention coefficient, and the relative attention coefficient and the relative structure coefficient include:

[0109]

[0110]

[0111] wherein δ ij represents the relative attention coefficient, υ ij represents the relative structure coefficient, N i represents a set of neighborhood nodes of node i, N j represents a set of neighborhood nodes of node j, |N i represents the number of neighborhood nodes of node i, |N j represents the number of neighborhood nodes of node j, x represents any common neighborhood node of node i and node j, b ixk′ represents the attention coefficient between node i and its neighborhood node x, k' represents the direct relationship between node i and its neighborhood node x, represents the attention coefficient between node j and its neighborhood node x, represents the direct relationship between node j and its neighborhood node x, b ijk represents the attention coefficient containing the relationship feature between two entities, S represents a set of correct triplets, Cov() represents covariance, and σ() represents standard deviation.

[0112] From the above description, for the relative attention coefficient, if there is a direct relationship between the adjacent nodes b and c of the center node a, it means that b and c also have the same certain attribute characteristics, and they are both adjacent nodes of a. Therefore, it can be inferred that for node b, the center node a can not only aggregate from b to the part of the characteristics represented by the relationship between a and b, but also aggregate from b to the small amount of characteristics contained in c, because b and c have a direct relationship, and the characteristics aggregated into c are less than those in b. Secondly, for the relative structure coefficient, if nodes x and y contain several same adjacent nodes, and the distance from x and y to any adjacent node is similar, it means that the higher the position coincidence degree of the two nodes in the common neighborhood, the more similar they are. The relative attention coefficient and the relative structure coefficient designed in this way can maximize the information intake ability of the center node to the neighborhood, thereby improving the ability of knowledge reasoning and fusion.

[0113] Further, the weight correction module is configured to correct the weight of each adjacent node in the neighborhood of the original center node in the knowledge graph using the relative attention coefficient and the relative structure coefficient to obtain a corrected attention weight, including:

[0114]

[0115] wherein, a ijk represents the corrected attention weight, δ in represents the relative attention coefficient of node i and its adjacent node n, υ in represents the relative structure coefficient of node i and its adjacent node n, b inz represents the attention coefficient between node i and its adjacent node n.

[0116] From the above description, using the relative attention coefficient and the relative structure coefficient to correct the weight of each adjacent node in the neighborhood of the original center node in the knowledge graph can simultaneously deeply mine the neighborhood characteristics of the center node from the structure and the adjacent nodes in the neighborhood, and further effectively utilize the neighborhood information to assist in modeling the triples in the knowledge graph, thereby providing more semantic information for entities.

[0117] Further, the weight correction module is configured to calculate a new embedding vector representation of an entity according to each adjacent node and its corresponding corrected attention weight, including:

[0118] Each adjacent node is multiplied by its corresponding corrected attention weight based on the multi-head attention mechanism to obtain a new embedding vector representation of an entity.

[0119] From the above description, to avoid overfitting, a multi-head attention mechanism is used to make the embedding vector representations independent of each other, so as to better stabilize the learning process and encapsulate as much neighborhood information as possible.

[0120] Further, the multi-head attention mechanism is used to multiply each neighbor node with its corresponding modified attention weight to obtain a new entity embedding vector representation, including:

[0121]

[0122]

[0123]

[0124] In the formula, M represents the number of times of multi-head attention network, represents the embedding vector representation of the new head entity, represents the embedding vector representation of the new tail entity, a ijk m represents the modified attention weight corresponding to the mth neighbor node, t ijk m represents the attention parameter containing the relationship feature between the two entities for the mth attention calculation, W m [] represents the mth linear transformation matrix.

[0125] From the above description, multiplying the neighbor node with its corresponding attention weight can update the center node information, and then the multi-head attention layer will produce a new entity embedding vector representation, so as to effectively utilize the neighborhood information to assist in modeling the triples in the knowledge graph and provide more semantic information for the entities, thereby improving the ability of knowledge reasoning and fusion.

[0126] Further, the fusion module is configured to fuse the relationship embedding between entities using a circular convolution manner according to the new entity embedding vector representation, to obtain a head entity vector and a tail entity vector in a relationship space, including:

[0127]

[0128]

[0129] In the formula, h ⊥ represents the head entity vector in the relationship space, t ⊥ represents the tail entity vector in the relationship space, represents the embedding vector representation of the new head entity, represents the embedding vector representation of the new tail entity, r kR represents a relation embedding matrix, Θ represents a circular convolution operation, μ represents a fusion relation coefficient, R h R represents a relation embedding matrix, Θ represents a circular convolution operation, μ represents a fusion relation coefficient, R t R represents a relation embedding matrix, Θ represents a circular convolution operation, μ represents a fusion relation coefficient, R h R represents a relation embedding matrix, Θ represents a circular convolution operation, μ represents a fusion relation coefficient, R t R represents a relation embedding matrix, Θ represents a circular convolution operation, μ represents a fusion relation coefficient, R

[0130] As can be seen from the above description, considering the influence of the relationship between the head entity and the tail entity on the head entity and the tail entity, the relationship between the entities is fused using the circular convolution mode, which can further mine the structure in the neighborhood and the neighborhood characteristics of the adjacent nodes to the center node.

[0131] Further, the training module is configured to calculate a loss function based on the head entity vector and the tail entity vector in the relation space, and the loss function comprises:

[0132]

[0133]

[0134] In the formula, L represents a loss function, f r (h, r, t) represents a first score function of a correct triple, f r (h', r, t') represents a score function of an incorrect triple, γ represents a margin boundary parameter, S represents a correct triple set, S' represents an incorrect triple set, (h, r, t) represents a correct triple, and (h', r, t') represents an incorrect triple.

[0135] As can be seen from the above description, the loss function designed in the above manner can be used for subsequent training of a knowledge graph embedding model, so that the knowledge graph embedding model has the best embedding representation effect.

[0136] The knowledge graph embedding representation method and device described above can be applied to a knowledge graph, and the following specific embodiments are described:

[0137] Embodiment one

[0138] Please refer to Figure 1 , Figure 3 and Figure 4 , the knowledge graph embedding representation method of the embodiment comprises the following steps:

[0139] S1, define the symbolic representation of the knowledge graph, specifically:

[0140] The knowledge graph is represented as G=(E, R), wherein E represents a set of entities in the knowledge graph, R represents a set of relations in the knowledge graph, N eN represents the number of entities e in the entity set of the knowledge graph r d represents the number of relations r in the relation set of the knowledge graph

[0141] is the embedding vector representation of the triple (h i , r k , t j ), h i represents the head entity embedding vector, t j represents the tail entity embedding vector, and r k represents the relation embedding vector; the neighborhood node set of the center node i is N i , the number of neighborhood nodes is |N i |, the initial entity embedding matrix is the initial relation embedding matrix is

[0142] When the initial entity embedding matrix and the initial relation embedding matrix are updated based on the fine-grained graph attention network, the final entity embedding matrix and the relation embedding matrix

[0143] S2, input the relation embedding vector and the entity embedding vector into the graph attention network to obtain the attention coefficient containing the relation feature between the two entities, and determine the relative attention coefficient and the relative structure coefficient based on the attention coefficient, specifically including:

[0144] S21, input the relation embedding vector and the entity embedding vector into the graph attention network to obtain the attention parameter containing the relation feature between the two entities, wherein the entity embedding vector contains the head entity embedding vector and the tail entity embedding vector, specifically:

[0145] t ijk = W[h i ||t j ||r k ];

[0146] In the formula, t ijk represents the attention parameter, W[] represents a linear transformation matrix, and || represents a concatenation vector operation.

[0147] S22, use a nonlinear activation function to process the attention parameter and the linear transformation parameter matrix to obtain the attention coefficient containing the relation feature between the two entities, specifically:

[0148] b ijk = LeakyReLU(Vt ijk );

[0149] In the formula, LeakyReLU() represents the nonlinear activation function, b ijk The attention coefficients representing the features of the relationship between the two entities are represented by V, and the linear transformation parameter matrix is ​​represented by t. ijk This refers to the attention parameter.

[0150] like Figure 3 As shown, with Figure 3 Taking node e1 as the central node as an example, within its neighborhood, e1 is connected to e2, e3, e4, e5, e6, and e11 through direct relations r0, r8, r1, r6, r2, and r5, respectively. Furthermore, the neighboring nodes e2, e3, e6, and e11 of e11 are also connected through their respective relations. Considering a node as a whole composed of numerous attributes, different relations correspond to different attribute categories. A direct relation r between two nodes indicates that the two wholes share similar attribute components measured by relation r. For example, e2 and e3 are both neighbors of e1 and are connected to the central node e1 through different relations r8 and r0, respectively. Therefore, it can be understood that e2 and e3 share similar attribute components with e1, measured by relations r8 and r0, respectively. If there is no direct relation connecting e2 and e3, it can be understood that these two attribute components are dissimilar (i.e., there is no overlap). In the diagram, e2 and e3 are connected by a direct relationship r8, indicating that these two attribute parts have similarities (i.e., overlap). Specifically, for node e2, its overall structure includes not only the attribute part that is directly related to the central node e1 via the direct relationship r0, but also a small portion of attributes that are directly related to e1 and e3 via the direct relationship r8, and are transmitted through the relationship r8 between e2 and e3. The size of this portion depends not only on the similarity (distance) between e2 and e3, but also on the number of neighboring nodes of e2 and e3. The greater the similarity (closer the distance) between e2 and e3, the greater the transmission efficiency. The more neighboring nodes e2 has, the smaller the proportion of the transmitted portion in e2's overall attributes. Similarly, the more neighboring nodes e3 has, the smaller the proportion of the target transmission area in the transmitted portion (transfer node) in the overall transmitted attributes.

[0151] In addition, the neighborhood structure and the distance between common neighboring nodes of two nodes can also serve as important bases for their attention weights. Taking nodes e2 and e3 as an example, nodes e2 and e3 contain a total of 3 common neighboring nodes, that is, the more similar the overall neighborhood structure, the more similar the two entities are. Furthermore, since the central node aggregates the information of each node in its neighborhood, if the distance between nodes e2 and e3 for any common node (the closer the similarity) is, that is, the closer e3 is to the position of e2 in the common neighborhood of e2 and e3, the more accurate the weights can be. Based on this idea, relative attention coefficients and relative structure coefficients are designed, as shown in S23.

[0152] S23, determining a relative attention coefficient and a relative structure coefficient based on the attention coefficient, specifically:

[0153]

[0154]

[0155] wherein, δ ij represents the relative attention coefficient, u ij represents the relative structure coefficient, N i represents the neighbor node set of node i, N j represents the neighbor node set of node j, |N i represents the number of neighbor nodes of node i, |N j represents the number of neighbor nodes of node j, x represents any common neighbor node of node i and node j, b ixk′ represents the attention coefficient between node i and its neighbor node x, k' represents the direct relationship between node i and its neighbor node x, which is not limited in direction, and can be directed from i to x or from x to i, represents the attention coefficient between node j and its neighbor node x, represents the direct relationship between node j and its neighbor node x, which is not limited in direction, and can be directed from j to x or from x to j, b ijk represents the attention coefficient containing the relationship characteristics between two entities, S represents the correct triple set, Cov() represents the covariance, and σ() represents the standard deviation.

[0156] First, for the relative attention coefficient δ ij , if there is a direct relationship between the neighbor nodes b and c of the center node a, it means that b and c also have the same attribute characteristics, and they are both neighbor nodes of a. Therefore, for node b, the center node a can not only aggregate from b to the part of the characteristics represented by the relationship between a and b, but also aggregate from b to the small amount of characteristics contained in c, because b and c have a direct relationship, and the characteristics aggregated from b to c are less than those aggregated from b. Second, for the relative structure coefficient u ij , if two nodes x and y contain several same neighbor nodes, if the distance from x and y to any neighbor node is similar, it means that the higher the position coincidence degree of two nodes in the common neighborhood, the more similar they are.

[0157] S3, using the relative attention coefficient and the relative structure coefficient, the weight of each adjacent node in the neighborhood of the original center node in the knowledge graph is corrected to obtain a corrected attention weight, and a new entity embedding vector representation is obtained according to the calculation of each adjacent node and the corresponding corrected attention weight of the adjacent node.

[0158]

[0159] In the formula, a ijk The corrected attention weight is represented by δ in The relative attention coefficient of node i and its adjacent node n is represented by υ in The relative structure coefficient of node i and its adjacent node n is represented by b inz The attention coefficient between node i and its adjacent node n is represented by.

[0160] The calculation according to each adjacent node and the corresponding corrected attention weight of the adjacent node to obtain a new entity embedding vector representation includes:

[0161] Each adjacent node is multiplied by the corresponding corrected attention weight to update the center node information to obtain a new node embedding vector representation, such as:

[0162]

[0163] In order to avoid overfitting, the multi-head attention mechanism is used to make them independent of each other, so as to better stabilize the learning process and encapsulate more adjacent node information as much as possible, which is as follows:

[0164] Based on the multi-head attention mechanism, each adjacent node is multiplied by the corresponding corrected attention weight to obtain a new entity embedding vector representation, which is as follows:

[0165]

[0166]

[0167] In the formula, M represents the number of times of multi-head attention network, The new head entity embedding vector representation is represented by, The new tail entity embedding vector representation is represented by a ijk m The corrected attention weight corresponding to the mth adjacent node is represented by t ijk m The attention parameter containing the relationship feature between the two entities for the mth attention calculation is represented by W m The mth linear transformation matrix is represented by [].

[0168] However, the initial embedding vector information of the relationship is lost in the process of learning a new embedding representation, so a weight matrix W R ∈R d×d′ is multiplied with the initial relationship embedding matrix R0 to update it, i.e., R = R0W R ;

[0169] Similarly, in the process of learning new entity embedding information, the embedding vector representation of the entity also adopts a linear transformation manner, i.e., a weight matrix W h ∈R d×d′ is multiplied with the initial embedding matrix H0, and H' is the entity embedding matrix learned by the graph attention network, i.e., H = H0W h + H', and the generated H and R are used as the final embedding to define the score function and the loss function, and the Adam optimizer is used to minimize the global loss.

[0170] Considering the influence of the head-tail entity relationship on the head entity and the tail entity, a new embedding method that fuses the inter-entity relationship is proposed, i.e., the head entity and tail entity vectors in the triple are respectively fused with the relationship vector to form a circular ring, and the circular convolution method is used to map them to the relationship space, and a bias parameter vector is added to perform a translation operation in the space, and finally the head-tail entity vectors in the relationship space are obtained, as shown in Figure 4 , and specifically as described in S4;

[0171] S4, the new entity embedding vector representation is fused with the inter-entity relationship embedding using the circular convolution method to obtain the head entity vector and the tail entity vector in the relationship space, specifically as follows:

[0172]

[0173]

[0174] In the formula, h ⊥ represents the head entity vector in the relationship space, t ⊥ represents the tail entity vector in the relationship space, represents the new head entity embedding vector representation, represents the new tail entity embedding vector representation, r k represents the relationship embedding matrix R row vector, Θ represents the circular convolution operation, μ represents the fusion relationship coefficient, R h represents the relationship mapping vector of the head entity to be learned, R t represents the relationship mapping vector of the tail entity to be learned, b h represents the bias parameter vector of the head entity, and b t represents the bias parameter vector of the tail entity.

[0175] S5. Calculate the loss function based on the head entity vector and tail entity vector in the relation space, and use the loss function to train the knowledge graph embedding model to obtain the trained knowledge graph embedding model.

[0176] Specifically, a scoring function for triples is defined, and the TransE method is used to train the dataset, generating initial entity embedding vectors and initial relation embedding vectors. The model is trained using a hinge loss function based on maximum margin. The first scoring function and loss function are as follows:

[0177]

[0178]

[0179] In the formula, L represents the loss function, f r (h, r, t) represents the first score function for the correct triplet, f r (h′, r, t′) represents the score function for incorrect triples, γ represents the margin boundary parameter, S represents the set of correct triples, S′ represents the set of incorrect triples, (h, r, t) represents correct triples, and (h′, r, t′) represents incorrect triples.

[0180] ConvKB is used as the decoder. ConvKB improves upon previous models by using convolutional neural networks. In ConvKB, each triple (head entity, relation, tail entity) is represented as a 3-column matrix, where each column vector represents a triple element. This 3-column matrix is ​​then fed into a convolutional layer, where multiple filters are applied to the matrix to generate different feature maps. These feature maps are then concatenated into a single feature vector representing the input triple. The feature vector is multiplied by the weight vector using a dot product to return a score. This score is then used to predict whether the triple is valid. The second scoring function is:

[0181] f(h,r,t)=concat(g([h i ,r k ,h j ]*Ω))·w;

[0182] In the formula, concat() represents the concatenation operator, Ω represents the convolution kernel with shared parameters, w represents the shared parameters, and w∈R 1×3 , * indicates a convolution operation;

[0183] The loss function is:

[0184]

[0185]

[0186] wherein, l (h,r,t) denotes whether the triple is a correct triple, and denotes a regularization term parameter; wherein, when the triple is a correct triple, l (h,r,t) is 1, otherwise -1.

[0187] Embodiment Two

[0188] Please refer to Figure 2 The knowledge graph embedding representation device of the embodiment comprises:

[0189] a coefficient determination module configured to input the relation embedding vector and the entity embedding vector into a graph attention network to obtain an attention coefficient containing the relation feature between the two entities, and determine a relative attention coefficient and a relative structure coefficient based on the attention coefficient;

[0190] a weight correction module configured to correct the weight of each neighbor node in the neighborhood of the original center node in the knowledge graph using the relative attention coefficient and the relative structure coefficient to obtain a corrected attention weight, and calculate a new entity embedding representation according to each neighbor node and its corresponding corrected attention weight;

[0191] a fusion module configured to fuse the relation embedding between entities using a circular convolution manner according to the new entity embedding representation to obtain a head entity vector and a tail entity vector in a relation space, specifically:

[0192]

[0193]

[0194] wherein, h ⊥ denotes the head entity vector in the relation space, t ⊥ denotes the tail entity vector in the relation space, denotes the new head entity embedding representation, denotes the new tail entity embedding representation, r k denotes a relation embedding matrix R row vector, denotes a circular convolution operation, and denotes a fusion relation coefficient, R h denotes a relation mapping vector of the head entity to be learned, R t denotes a relation mapping vector of the tail entity to be learned, b h denotes a head entity bias parameter vector, b t denotes a tail entity bias parameter vector.

[0195] The training module is used to calculate the loss function based on the head entity vector and tail entity vector in the relation space, and use the loss function to train the knowledge graph embedding model to obtain the trained knowledge graph embedding model.

[0196] In an optional implementation, the coefficient determination module is further configured to:

[0197] By inputting relation embedding vectors and entity embedding vectors into a graph attention network, attention parameters containing the relation features between two entities are obtained.

[0198] The attention coefficients, which contain the relationship features between the two entities, are obtained by processing the attention parameters and the linear transformation parameter matrix using a nonlinear activation function.

[0199] b ijk =LeakyReLU(Vt ijk );

[0200] In the formula, LeakyReLU() represents the nonlinear activation function, b ijk The attention coefficients representing the features of the relationship between the two entities are represented by V, and the linear transformation parameter matrix is ​​represented by t. ijk This refers to the attention parameter.

[0201] The determination of the relative attention coefficient and the relative structure coefficient based on the attention coefficient includes:

[0202]

[0203]

[0204] In the formula, δ ij Represents the relative attention coefficient, υ ij N represents the relative structural coefficient. i N represents the set of neighboring nodes of node i. j Let |N| represent the set of neighboring nodes of node j. i | represents the number of neighboring nodes of node i, |N j | represents the number of neighboring nodes of node j, x represents any common neighbor of node i and node j, b ixk′ Let represent the attention coefficient between node i and its neighboring node x, and let k′ represent the direct relationship between node i and its neighboring node x. This represents the attention coefficient between node j and its neighboring node x. b represents the direct relationship between node j and its neighboring node x. ijk Let S represent the attention coefficient containing the relationship features between the two entities, S represent the set of correct triples, Cov() represent the covariance, and σ() represent the standard deviation.

[0205] The weight of each neighbor node in the neighborhood of the original center node in the knowledge graph is corrected using the relative attention coefficient and the relative structure coefficient to obtain a corrected attention weight, and the corrected attention weight includes:

[0206]

[0207] In the formula, a ijk The corrected attention weight is represented by δ in The relative attention coefficient of node i and its neighbor node n is represented by υ in The relative structure coefficient of node i and its neighbor node n is represented by b inz The attention coefficient between node i and its neighbor node n is represented by.

[0208] In an optional embodiment, the weight correction module is further used to:

[0209] Each neighbor node is multiplied by its corresponding corrected attention weight based on the multi-head attention mechanism to obtain a new entity and relationship embedding vector representation, and specifically:

[0210]

[0211]

[0212] In the formula, M represents the number of times of multi-head attention network, The embedding vector representation of the new head entity is represented by, The embedding vector representation of the new tail entity is represented by a ijk m The corrected attention weight corresponding to the neighbor node in the mth time is represented by t ijk m The attention parameter containing the relationship feature between the two entities in the mth time of attention calculation is represented by W m The mth linear transformation matrix is represented by.

[0213] In some optional embodiments, the loss function is calculated based on the head entity vector and the tail entity vector in the relationship space, and the loss function includes:

[0214]

[0215]

[0216] In the formula, L represents the loss function, f r The score function of the correct triple is represented by f r(h', r, t') represents a score function of an error triple, γ represents a margin boundary parameter, S represents a correct triple set, S' represents an error triple set, (h, r, t) represents a correct triple, and (h', r, t') represents an error triple.

[0217] In summary, the knowledge graph embedding representation method and device provided by the application input the relation embedding vector and the entity embedding vector into the graph attention network, obtain the attention coefficient containing the relation feature between two entities, determine the relative attention coefficient and the relative structure coefficient based on the attention coefficient, correct the weight of each adjacent node in the neighborhood of the original center node in the knowledge graph using the relative attention coefficient and the relative structure coefficient, obtain the corrected attention weight, calculate each adjacent node and the corresponding corrected attention weight, obtain the new entity embedding vector representation, fuse the relation embedding between entities using the circular convolution based on the new entity embedding vector representation, obtain the head entity vector and the tail entity vector in the relation space, calculate the loss function based on the head entity vector and the tail entity vector in the relation space, and train the knowledge graph embedding model using the loss function to obtain the trained knowledge graph embedding model. The relative attention coefficient and the relative structure coefficient are used to correct the weight of each adjacent node in the neighborhood of the original center node in the knowledge graph, and then the relation embedding between entities is fused using the circular convolution, which can simultaneously deeply mine the neighborhood features of the center node from the neighborhood structure and the adjacent nodes, better optimize the information intake ability of the center node to the neighborhood, effectively utilize the neighborhood information of the triple, and improve the knowledge reasoning and fusion capability.

[0218] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer usable storage media containing computer usable program code (including but not limited to disk storage, CD-ROM, optical storage, etc.). The solutions in the embodiments of the present application can be implemented in various computer languages, such as object-oriented programming languages Java and interpreted scripting language JavaScript.

[0219] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0220] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0221] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0222] While the preferred embodiments of the application have been described, additional variations and modifications can be employed by those skilled in the art. Therefore, the appended claims intend to cover all such modifications and variations as fall within the true spirit and scope of the application.

[0223] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A knowledge graph embedding representation method, wherein the knowledge is related knowledge in intelligent question answering, characterized in that, Including the following steps: The relation embedding vector and entity embedding vector are input into the graph attention network to obtain attention coefficients containing the relation features between the two entities, and the relative attention coefficient and relative structure coefficient are determined based on the attention coefficients. The relative attention coefficient and the relative structure coefficient are used to correct the weights of each neighboring node in the neighborhood of the original central node in the knowledge graph to obtain the corrected attention weights. The new entity embedding vector representation is obtained by calculating based on each neighboring node and its corresponding corrected attention weight. Based on the new entity embedding vector representation, the relationship embeddings between entities are fused using circular convolution to obtain the head entity vector and tail entity vector in the relationship space; The loss function is calculated based on the head entity vector and tail entity vector in the relation space, and the loss function is used to train the knowledge graph embedding model to obtain the trained knowledge graph embedding model. The determination of the relative attention coefficient and the relative structure coefficient based on the attention coefficient includes: ; ; In the formula, δ ij Represents the relative attention coefficient, υ ij N represents the relative structural coefficient. i N represents the set of neighboring nodes of node i. j Let |N| represent the set of neighboring nodes of node j. i | represents the number of neighboring nodes of node i, |N j | represents the number of neighboring nodes of node j, and x represents any common neighbor of node i and node j. Let represent the attention coefficient between node i and its neighboring node x, and let k′ represent the direct relationship between node i and its neighboring node x. This represents the attention coefficient between node j and its neighboring node x. b represents the direct relationship between node j and its neighboring node x. ijk The attention coefficients representing the features of the relationship between the two entities are represented by S, which represents the set of correct triples, and Cov() represents the covariance. Indicates standard deviation; The process of using the relative attention coefficient and the relative structure coefficient to correct the weights of each neighboring node in the original central node's neighborhood in the knowledge graph, resulting in corrected attention weights, includes: ; In the formula, a ijk δ represents the modified attention weight. in υ represents the relative attention coefficient between node i and its neighboring node n. in b represents the relative structural coefficient between node i and its neighboring node n. ink This represents the attention coefficient between node i and its neighboring node n; The step of fusing the relational embeddings between entities using circular convolution based on the new entity embedding vector representation to obtain the head entity vector and tail entity vector in the relation space includes: ; ; In the formula, Represents the head entity vector in the relation space. Represents the tail entity vector in the relation space. This represents the embedding vector representation of the new head entity. The embedding vector representation of the new tail entity, r k Represents the row vectors of the relation embedding matrix R. R represents the circular convolution operation, μ represents the fusion coefficient, and R represents the circular convolution operation. h R represents the relational mapping vector of the head entity to be learned. t b represents the relational mapping vector of the tail entity to be learned. h b represents the bias parameter vector of the head entity. t This represents the bias parameter vector of the tail entity.

2. The knowledge graph embedding representation method according to claim 1, characterized in that, The process of inputting relation embedding vectors and entity embedding vectors into a graph attention network to obtain attention coefficients containing features of the relationship between two entities includes: By inputting relation embedding vectors and entity embedding vectors into a graph attention network, attention parameters containing the relation features between two entities are obtained. The attention coefficients, which contain the relationship features between the two entities, are obtained by processing the attention parameters and the linear transformation parameter matrix using a nonlinear activation function.

3. The knowledge graph embedding representation method according to claim 2, characterized in that, The process of using a nonlinear activation function based on the attention parameters and the linear transformation parameter matrix to obtain attention coefficients containing features of the relationship between the two entities includes: ; In the formula, LeakyReLU() represents the nonlinear activation function, b ijk The attention coefficients representing the features of the relationship between the two entities are represented by V, and the linear transformation parameter matrix is ​​represented by t. ijk This refers to the attention parameter.

4. The knowledge graph embedding representation method according to claim 1, characterized in that, The step of calculating the new entity's embedding vector representation based on each neighboring node and its corresponding modified attention weight includes: Based on the multi-head attention mechanism, each neighboring node is multiplied by its corresponding modified attention weight to obtain a new entity embedding vector representation.

5. The knowledge graph embedding representation method according to claim 4, characterized in that, The step of multiplying each neighboring node with its corresponding modified attention weight based on the multi-head attention mechanism to obtain the new entity's embedding vector representation includes: ; ; In the formula, M represents the number of times the multi-head attention network is executed. This represents the embedding vector representation of the new head entity. a represents the embedding vector representation of the new tail entity. ijk m Let t represent the corrected attention weights corresponding to the m-th neighbor node. ijk m This represents the attention parameters, which include the relationship features between the two entities, used in the m-th attention calculation. [] represents the m-th linear transformation matrix.

6. The knowledge graph embedding representation method according to claim 1, characterized in that, The loss function calculated based on the head entity vector and tail entity vector in the relation space includes: ; ; In the formula, L represents the loss function, f r (h, r, t) represents the score function for the correct triplet, f r (h′, r, t′) represents the scoring function for incorrect triples. Let S represent the margin boundary parameters, S represent the set of correct triples, S′ represent the set of incorrect triples, (h, r, t) represent correct triples, and (h′, r, t′) represent incorrect triples.

Citation Information

Patent Citations

  • Knowledge graph embedding method based on hierarchical attention

    CN113468341A

  • Cancer driver gene prediction device based on graph attention network and multi-omics fusion

    CN115171779A