Knowledge graph embedding method and system based on multi-relation knowledge enhancement graph convolutional network

By introducing inverse relationships and self-cycle edges into the knowledge graph, combined with graph neural networks and attention mechanisms, the problem of insufficient entity and relationship modeling capabilities in the existing technology is solved, and more efficient knowledge graph embedding and unknown entities are achieved. predict.

CN119089995APending Publication Date: 2024-12-06CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411219852.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing knowledge graph embedding method based on graph neural networks is difficult to model entities and relationships simultaneously, and the role of different relationship types on entity updates is not fully considered, resulting in insufficient feature learning ability and the inability to make full use of graph structure information.

Method used

Introduce inverse relationships and self-cycle edges, combine graph neural networks and attention mechanisms, capture complex interaction patterns between entities and relationships through cyclic correlation operations and attention weight calculations, and use DTAE as a decoder to score triples .

Benefits of technology

Effectively learning the structural information of the knowledge graph improves the embedded representation ability of entities and relationships, and improves the prediction accuracy of unknown entities and the performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119089995A_ABST
    Figure CN119089995A_ABST
Patent Text Reader

Abstract

The invention relates to a knowledge graph embedding method and system based on a multi-relation knowledge enhancement graph convolutional network, and belongs to the field of knowledge graph embedding. The method comprises the following steps: S1, expanding relationships in an input knowledge graph, introducing an inverse relationship of each relationship, and adding a self-circulation edge; s2, introducing an entity-relationship combination operation into the graph neural network by using a cyclic correlation operation so as to bring relationship features into feature propagation, capturing an interaction mode between entities and relationships, calculating the weight of each relationship through an attention mechanism, and learning semantic changes of each entity under different relationships; s3, in an updating function of the graph neural network, node embedding is updated by using all neighbor sets of nodes, and corresponding edges are updated; and S4, retrieving a feature matrix of each entity and relationship from the updated node embedding and relationship embedding, and scoring the triad by using DTAE as a decoder. According to the invention, the performance of embedding the knowledge graph can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of knowledge graph embedding, and relates to a knowledge graph embedding method and system based on a multi-relational knowledge enhanced graph convolutional network. Background Art

[0002] As a multi-relational knowledge base, the knowledge graph has nodes that describe entities in the real world and edges that represent relationships between entities. Different relationships correspond to different edges, and a triple (s, r, o) is used to describe the relationship r between entity s and o. Knowledge graphs are widely used in fields such as intelligent search, recommendation systems, and intelligent question-answering systems. Although existing knowledge graphs already contain a large number of entities and triples, the existing knowledge graphs are still incomplete due to the continuous updates and changes in the real world. Therefore, predicting unknown entities based on known entities and relationships is crucial to completing the knowledge graph. In recent years, researchers have proposed using knowledge graph embedding to achieve knowledge graph completion. Knowledge graph embedding predicts unknown entities or relationships by encoding entities and relationships in a low-dimensional vector space.

[0003] Knowledge graph embedding methods can be roughly divided into three categories: one is based on traditional machine learning, the second is based on convolutional neural network, and the third is based on graph neural network. The traditional machine learning-based methods include two subcategories: translation-based methods and semantic matching-based methods. Among them, TransE, as the pioneering work based on translation methods, projects entities and relationships into the same translation vector space, regards the relationship between entities as a translation operation from the source entity to the target entity, and attempts to make the equation s+r≈o hold. The semantic matching-based method uses a multiplication scoring function to evaluate the possibility of a triple being established. Among them, RESCAL uses a matrix to model the relationship between entities to capture the interaction pattern between entities and relationships, and then decomposes the matrix to obtain a low-dimensional embedding of entities and relationships. Although the traditional machine learning-based methods have the advantages of small parameters and easy expansion to large knowledge graphs, their shallow structure makes it impossible to capture deeper semantic relationships and their expression ability is limited. ConvE, as a classic method based on convolutional neural network, reshapes entities and relationships into matrices as inputs to the convolution layer. Although it has achieved good results, it ignores the global information of triples. Therefore, ConvKB represents the triple as a three-column matrix and applies one-dimensional convolution on this matrix to effectively capture feature interactions. However, it is difficult for methods based on convolutional neural networks to fully utilize the graph structure information of the knowledge graph. Methods based on graph neural networks can use neighboring nodes to iteratively update the embedding representation of the central node, and then learn the structural information in the knowledge graph. Among them, R-GCN proves the importance of integrating structural information in the field of knowledge graph embedding. SACN divides the entire knowledge graph into multiple different subgraphs according to the type of relationship to process the multi-relation characteristics of the knowledge graph.

[0004] Although the above-mentioned graph neural network-based methods have greatly improved the performance of knowledge graph embedding with their powerful feature extraction capabilities, the current graph neural network-based models still have problems: ① Existing models mainly focus on the embedding representation of entities and cannot model entities and relationships at the same time; ② Existing models do not fully consider the role of different relationship types in entity updates. Therefore, the feature learning ability of the knowledge graph embedding method based on graph neural networks is still insufficient, and the utilization of structural information still needs to be strengthened. Summary of the invention

[0005] In view of this, the object of the present invention is to provide a knowledge graph embedding method and system based on multi-relational knowledge enhanced graph convolutional network, so as to improve the performance of knowledge graph embedding.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] Solution 1: A knowledge graph embedding method based on multi-relation knowledge enhanced graph convolutional network, defining the knowledge graph G = {V, R, ε}, V is the entity / vertex set, R is the relationship set, ε is the set of all triples / edges in G, and the triple ε = (s, r, o) indicates that there is a certain relationship r ∈ R between the source entity s ∈ V and the target entity o ∈ V, so that the fact is true. The method specifically includes the following steps:

[0008] S1: Input the knowledge graph dataset G, expand the relationships in the knowledge graph G, introduce the inverse relationship of each relationship and add self-loop edges, and provide richer and more comprehensive graph structure information and relationship features;

[0009] S2: Introduce entity-relation combination operations in graph neural networks using loop-related operations to incorporate relational features into feature propagation, capture more complex interaction patterns between entities and relations, and calculate the weight of each relation through the attention mechanism to learn the semantic changes of each entity under different relations in a more detailed manner;

[0010] S3: In the update function of the graph neural network, all neighbor sets of node v are used to update the node embedding representation h v , and update the corresponding edge or relation embedding representation h r ;

[0011] S4: Embedding h from the updated node v and relation embedding h r Retrieve the feature matrix v of each entity and relationship from s 、v r and v o , DTAE is used as a decoder to score the triples, where DTAE represents a knowledge graph embedding model based on dynamic adaptive void convolution and attention mechanism (see patent application number 202310386311.5 for details).

[0012] Further, step S1 specifically includes: converting the knowledge graph G into G′={V,R′,ε′} containing inverse relations and self-loop edges, where R′=R∪R inv ∪{T},R inv = {r -1 |r∈R] represents the set of inverse relations, T represents the self-loop edge, ε′=ε∪{(o,r -1 ,s)|(s,r,o)∈R}∪{(s,T,s)|s∈R}; then and relationship Initialized as d-dimensional vector representation and

[0013] Further, step S2 specifically includes the following steps:

[0014] S21: In the graph neural network, the entity-relationship combination operation is introduced using the loop-related operation to incorporate the relationship features into the feature propagation. At the same time, in order to simplify the model complexity and improve the computational efficiency, the non-parametric combination operation is selected, which can effectively capture the interaction between entity relationships. Its expression is as follows:

[0015] v'=Comp(v,r)=v*r

[0016] Among them, v′ represents entity-relationship combination, v represents entity, r represents the relationship connected to entity v, Comp(·) represents a combination operator, and * represents a cyclic association operation. Unlike the commonly used addition combination and multiplication combination, the cyclic association operation is non-commutative, that is, v*r≠r*v. This non-commutativity enables it to distinguish the direction of the relationship between entities and provide richer expression capabilities for directed graphs. At the same time, the cyclic association operation can capture more complex interaction patterns between entities and relationships by considering the dot product of all possible cyclic displacements of a vector and another vector.

[0017] S22: In the knowledge graph, the same entity has different semantic meanings in different triples. Each relationship has different importance for different prediction tasks. Therefore, in addition to including the features of the edges in the update process, it is also necessary to calculate a specific attention weight for each relationship. To this end, an attention layer is added before updating the embedding. This layer extracts the weight from the entity embedding h. v Extract entity representation From the relation embedding h r Extract relation representation Then these representations are combined to obtain the comprehensive representation c of the triple in the embedding space ijk as follows:

[0018]

[0019] Among them, W1 is a linear transformation matrix; by c ijk Apply a linear transformation and process it through the LeakyReLU activation function to get the attention score b ijk as follows:

[0020] b ijk =LeakyReLU(W2c ijk )

[0021] Among them, W2 is a linear transformation matrix; finally, the Softmax function is used to calculate the attention weight a of the triple according to the attention score ijk as follows:

[0022]

[0023] Among them, b inr represents the attention score obtained by node i and its neighbor node n under relationship r; N i represents the set of neighbor nodes of node i, R in Represents the set of relationships between node i and its neighbor node n. By assigning different attention weights to each triple according to different relationships and entities, it can more effectively capture the semantic changes of entities under different relationships. It can not only identify the relationship changes between entities, but also distinguish entities according to the different importance of relationships, further improving the accuracy of the model in predicting missing entities.

[0024] Further, step S3 specifically includes: updating the embedding representation of node v by performing a combined operation of neighbor node u and its relationship r and treating original edges, reverse edges and self-loops differently; calculating attention weights for original edges and reverse edges respectively, and omitting the conversion matrix and nonlinear activation operations commonly used in traditional graph convolutional neural networks to simplify the model and improve efficiency. The calculation process of the update function is as follows:

[0025]

[0026] Among them, x u , z r They represent the initial features of node u and relationship r, respectively, and h v represents the updated node embedding representation, α λ(r) It is the attention weight based on the relationship type and adopts direction-specific weight, i.e., λ(r)=dir(r), which is specifically defined as:

[0027]

[0028] Among them, α O represents the attention weight based on the original relationship, α I represents the attention weight based on the inverse relationship, α S represents the attention weight based on the self-loop edge, and T represents the self-loop edge;

[0029] When a node is updated, the relationship embedding is also updated:

[0030] h r =W r z r

[0031] Among them, W r is a learnable transformation matrix that projects all relations into the same embedding space as nodes.

[0032] Further, step S4 specifically includes: embedding the updated node representation h v and hr The feature matrix v of the entity and relationship of the triple (s, r, o) is retrieved from s 、v r and v o , the retrieval process is as follows:

[0033]

[0034] in, Represent the high-dimensional index of the source entity, relation, and target entity respectively; then, DTAE is used as a decoder to score the triples, and the score ψ(s, r, o) of a candidate tail entity is calculated by the following scoring function:

[0035]

[0036]

[0037] in, Indicates that v s Reshape into a two-dimensional matrix, * represents the convolution operation, express and The splicing, Indicated by v r The convolution filters of the generated dynamic adaptive convolutional neural network, Indicates the use of v r The convolution filter of the generated dynamic adaptive dilated convolutional neural network, vec(·) is used to convert the tensor into a vector form, ECA(·) represents the ECA channel attention mechanism operation, and W is the conversion matrix; if the triple (s, r, o) is correct, the probability p(o|s, r) is 1, otherwise it is 0. For the training model parameters, its loss function The calculation is as follows:

[0038]

[0039] Where o is a label vector whose element value is 1 when the relationship exists and 0 otherwise; N is the number of entities in the knowledge graph; p(o|s,r) represents the probability distribution of candidate entity o given the source entity and relationship.

[0040] Solution 2: A knowledge graph embedding system based on multi-relational knowledge enhanced graph convolutional network, including:

[0041] The encoding module includes a multi-relationship expansion module and a relationship feature fusion module; the multi-relationship expansion module is responsible for expanding the edges of the relationships in the knowledge graph based on the directionality of the graph; the relationship feature fusion module is responsible for forming entity-relationship combinations to achieve joint learning of entity and relationship representations, and using the attention mechanism to calculate the attention weight of each edge to achieve selective aggregation of neighbor information;

[0042] The vector decoding module is responsible for using DTAE to decode the embedded vector obtained through graph convolution encoding to achieve the scoring of the triples;

[0043] The model training module is responsible for calculating the scores and probability distribution of all candidate triplets and calculating the loss function of the model.

[0044] Solution 3: A computer-readable storage medium, comprising a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the knowledge graph embedding method of Solution 1.

[0045] The beneficial effects of the present invention are as follows: the present invention expands the edges in the knowledge graph by introducing inverse edges and self-loop edges, and on this basis combines the graph neural network and the attention mechanism to construct an encoder to learn the rich structural information of the knowledge graph, overcome the limitations of the convolutional neural network in processing graph structural information, and use DTAE as a decoder to further optimize the representation of entities and relationships after knowledge enhancement and score all candidate triples, forming an end-to-end multi-relational knowledge enhanced graph convolutional network (MRKECN), which can make full use of the graph structure information of the knowledge graph and effectively learn the complex interactions between entities and relationships.

[0046] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0048] Figure 1 It is a schematic diagram of the overall framework of the knowledge graph embedding system MRKECN of the present invention;

[0049] Figure 2 This is a schematic diagram of the expanded knowledge graph;

[0050] Figure 3It is a diagram of the attention framework that calculates the weights of different entities under each relationship;

[0051] Figure 4 It is a framework diagram for calculating the combination of entities and relationships. DETAILED DESCRIPTION

[0052] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0053] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0054] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0055] Example:

[0056] The results were verified by comparative experiments on FB15k-237 and WN18RR. These two public knowledge graph datasets are composed of information extracted from Freebase and WordNet knowledge bases, respectively, and each dataset is divided into training set, validation set, and test set. Table 1 lists their statistics.

[0057] Table 1

[0058] Dataset Number of relationships Number of entities Training set Validation set Test Set FB15K-237 237 14541 272115 17535 20446 WN18RR 11 40943 86835 3034 3034

[0059] The following takes WN18RR as an example to introduce the knowledge graph embedding method based on multi-relational knowledge enhanced graph convolutional network (MRKECN) proposed in the present invention.

[0060] like Figure 1 As shown, the present invention provides a knowledge graph embedding method based on multi-relation knowledge enhanced graph convolutional network, and the specific steps are as follows:

[0061] S1: Input the knowledge graph dataset G, expand the relationships in the knowledge graph G, introduce the inverse relationship of each relationship and add self-loop edges to provide richer and more comprehensive graph structure information and relationship features.

[0062] S2: Introducing entity-relation combination operations in graph neural networks using recurrent correlation operations to incorporate relational features into feature propagation, capturing more complex interaction patterns between entities and relations, and calculating the weight of each relation through the attention mechanism to more carefully learn the semantic changes of each entity under different relations.

[0063] like Figure 2 As shown in the figure, for a given knowledge graph G, after step S1, it is converted into G′={V,R′,ε′} containing inverse relations and self-loop edges, where R′=R∪R inv ∪{T},R inv = {r -1 |r∈R} represents the set of inverse relations, T represents the self-loop edge, ε′=ε∪{(o,r -1 ,s)|(s,r,o)∈R}∪{(s,T,s)|s∈R}. Then the entity and relationship Initialized as d-dimensional vector representation and

[0064] Step S2 specifically includes the following steps:

[0065] S21: In the graph neural network, the entity-relationship combination operation is introduced by using the recurrent association operation to incorporate the relationship features into the feature propagation. At the same time, in order to simplify the model complexity and improve the computational efficiency, the non-parametric combination operation is selected, which can effectively capture the interaction between entity relationships. Its expression is as follows:

[0066] v'=Comp(v,r)=v*r

[0067] Among them, Comp(·) represents a combination operator, and ★ represents a cyclic associative operation. Different from the commonly used addition combination and multiplication combination, the cyclic associative operation is non-commutative, that is, v*r≠r*v. This non-commutativity enables it to distinguish the direction of the relationship between entities and provide richer expressive power for directed graphs. At the same time, the cyclic associative operation can capture more complex interaction patterns between entities and relationships by considering the dot product of all possible cyclic displacements of a vector and another vector.

[0068] S22: Figure 3 As shown in Figure 1, the same entity in the knowledge graph has different semantic meanings in different triples, and each relationship has different importance for different prediction tasks. Therefore, in addition to including the features of the edges in the update process, it is also necessary to calculate a specific attention weight for each relationship. To this end, an attention layer is added before updating the embedding. This layer extracts the weight from the entity embedding h. v Extract entity representation From the relation embedding h r Extract relation representation Then these representations are combined to obtain the comprehensive representation of the triple in the embedding space as follows:

[0069]

[0070] Among them, W1 is a linear transformation matrix; by c ijk Applying a linear transformation and processing it through the LeakyReLU activation function, we get the following attention scores:

[0071] b ijk =LeakyReLU(W2C ijk )

[0072] Among them, W2 is a linear transformation matrix; finally, the Softmax function is used to calculate the attention weight of the triple according to the attention score:

[0073]

[0074] Among them, N i represents the set of neighbor nodes of node i, and R in Represents the set of relationships between node i and its neighbor node n. By assigning different attention weights to each triple according to different relationships and entities, it can more effectively capture the semantic changes of entities under different relationships. It can not only identify the relationship changes between entities, but also distinguish entities according to the different importance of relationships, further improving the accuracy of the model in predicting missing entities.

[0075] S3: In the update function of the graph neural network, all neighbor sets of node v are used to update the node embedding representation h v And update the corresponding edge representation h r ;like Figure 4 As shown, specifically including:

[0076] The embedding representation of node v is updated by performing a combined operation on neighbor nodes u and their relations r and treating original edges, reverse edges, and self-loops differently; attention weights are calculated for original edges and reverse edges respectively, and the conversion matrix and nonlinear activation operations commonly used in traditional graph convolutional neural networks are omitted to simplify the model and improve efficiency. The calculation process of the update function is as follows:

[0077]

[0078] Among them, x u , z r They represent the initial features of node u and relationship r, respectively, and h v represents the updated node embedding representation, α λ(r) It is the attention weight based on the relationship type and adopts direction-specific weight, i.e., λ(r)=dir(r), which is specifically defined as:

[0079]

[0080] Among them, α O represents the attention weight based on the original relationship, α I represents the attention weight based on the inverse relationship, α S represents the attention weight based on the self-loop edge, and T represents the self-loop edge;

[0081] When a node is updated, the relationship embedding is also updated:

[0082] h r =W r z r

[0083] Among them, W r is a learnable transformation matrix that projects all relations into the same embedding space as nodes.

[0084] S4: Embedding h from the updated node v and h r The feature matrix of the entity and relationship of the triple (s, r, o) is retrieved from the retrieval process as follows:

[0085]

[0086] in, Represent the high-dimensional index of the source entity, relation, and target entity respectively; then, DTAE is used as a decoder to score the triples and the score of a candidate tail entity is calculated by the following scoring function:

[0087]

[0088]

[0089] in, Indicates that v s Reshape into a two-dimensional matrix, * represents the convolution operation, express and The splicing, Indicated by v r The convolution filters of the generated dynamic adaptive convolutional neural network, Indicates the use of v r The convolution filter of the generated dynamic adaptive atrous convolutional neural network, ECA(·) represents the ECA channel attention mechanism operation, W is the transformation matrix; if the triple (s, r, o) is correct, the probability p(o|s, r) is 1, otherwise it is 0. For the training model parameters, the loss function is calculated as follows:

[0090]

[0091] Where o is a label vector whose element value is 1 when the relationship exists and 0 otherwise; N is the number of entities in the knowledge graph; p(o|s,r) represents the probability distribution of candidate entity o given the source entity and relationship.

[0092] Based on the same inventive concept, Figure 1 As shown, the present invention also provides a knowledge graph embedding system based on a multi-relational knowledge enhanced graph convolutional network, comprising:

[0093] The encoding module includes a multi-relation expansion module and a relation feature fusion module. The multi-relation expansion module is responsible for expanding the edges of relations in the knowledge graph based on the directionality of the graph. The relation feature fusion module is responsible for forming entity-relation combinations, realizing joint learning of entity and relation representations, and using the attention mechanism to calculate the attention weights of each edge to achieve selective aggregation of neighbor information.

[0094] The vector decoding module is responsible for using DTAE to decode the embedded vector obtained through graph convolution encoding to achieve the scoring of the triples;

[0095] The model training module is responsible for calculating the scores and probability distribution of all candidate triplets and calculating the loss function of the model.

[0096] Comparative experiment:

[0097] This experiment compares several most advanced knowledge graph embedding methods on the test set. The main comparisons are the mean reciprocal rank (MRR) and the top ten, top three, and first recall rates (Hits@10, Hits@3, Hits@1). S is the set of triples, |S| is the number of triples, rank i It refers to the link prediction ranking of the i-th triple, so the larger the MRR, the better; Hits@n refers to the average proportion of triples ranked less than n in link prediction, and the larger the value, the better. For each triple (s, r, o) in the test set, when predicting the target entity o, all candidate target entities are sorted according to the score. The higher the ranking, the greater the possibility that the triple is established. Therefore, whether the predicted target entity ranks in the top ten, top three, and first can be used as an indicator to measure the quality of the model. Similarly, the same is true for predicting the source entity. It can be seen from the results in Table 2 that the method of the present invention (MRKECN) has better performance than the current advanced methods.

[0098] Table 2

[0099]

[0100]

[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A knowledge graph embedding method based on multi-relation knowledge enhanced graph convolutional network, defining the knowledge graph G = {V, R, ε}, V is the entity / vertex set, R is the relationship set, ε is the set of all triples / edges in G, triple ε = (s, r, o), indicating that there is a certain relationship r ∈ R between the source entity s ∈ V and the target entity o ∈ V, so that the fact is true, characterized by, The method specifically comprises the following steps: S1: Input the knowledge graph dataset, expand the relations in the knowledge graph G, introduce the inverse relations of each relation and add self-loop edges, and provide graph structure information and relation features; S2: Introduce entity-relation combination operations in graph neural networks using loop-related operations to incorporate relational features into feature propagation, capture the interaction patterns between entities and relations, and calculate the weight of each relation through the attention mechanism to learn the semantic changes of each entity under different relations; S3: In the update function of the graph neural network, all neighbor sets of node v are used to update the node embedding representation h v , and update the corresponding edge or relation embedding representation h r ; S4: Embedding h from the updated node v and relation embedding h r Retrieve the feature matrix v of each entity and relationship from s 、v r and v o , DTAE is used as the decoder to score the triples, where DTAE represents the knowledge graph embedding model based on dynamic adaptive dilated convolution and attention mechanism.

2. The knowledge graph embedding method according to claim 1, characterized in that: Step S1 specifically includes: converting the knowledge graph G into G′={V,R′,ε′} containing inverse relations and self-loop edges, where R inv = {r -1 |r∈R} represents the set of inverse relations, T represents the self-loop edge, ε′=ε∪{(o,r -1 ,s)|(s,r,o)∈R}∪{(s,T,s)|s∈R}; then and relationship Initialized as d-dimensional vector representation and 3. The knowledge graph embedding method according to claim 2, characterized in that: Step S2 specifically includes the following steps: S21: In graph neural networks, cyclic correlation operations are used to introduce entity-relation combination operations to incorporate relational features into feature propagation, and non-parametric combination operations are selected to capture the interactions between entity relations, which are expressed as follows: v′=Comp(v,r)=v*r Among them, v′ represents an entity-relationship combination, v represents an entity, r represents a relationship connected to entity v, Comp(·) represents a combination operator, and ★ represents a loop association operation; S22: Add an attention layer before updating the embedding, which extracts the v Extract entity representation From the relation embedding h r Extract relation representation Then these representations are combined to obtain the comprehensive representation c of the triple in the embedding space ijk as follows: Among them, W1 is a linear transformation matrix; by c ijk Apply a linear transformation and process it through the LeakyReLU activation function to get the attention score b ijk as follows: b ijk =LeakyReLU(W2c ijk ) Among them, W2 is a linear transformation matrix; finally, the Softmax function is used to calculate the attention weight a of the triple according to the attention score ijk as follows: Among them, b inr represents the attention score obtained by node i and its neighbor node n under relationship r; N i represents the set of neighbor nodes of node i, R in Represents the set of relationships between node i and its neighbor node n.

4. The knowledge graph embedding method according to claim 3, characterized in that: Step S3 specifically includes: updating the embedding representation of node v by performing a combined operation between neighbor node u and its relationship r and treating original edges, reverse edges and self-loops differently; the calculation process of the update function is as follows: Among them, x u , z r They represent the initial features of node u and relationship r, respectively, and h v represents the updated node embedding representation, α λ(r) It is the attention weight based on the relationship type and adopts direction-specific weight, i.e., λ(r)=dir(r), which is specifically defined as: Among them, α O represents the attention weight based on the original relationship, α I represents the attention weight based on the inverse relationship, α S represents the attention weight based on the self-loop edge, Represents a self-loop edge; When a node is updated, the relationship embedding is also updated: h r =W r z r Among them, W r is a learnable transformation matrix that projects all relations into the same embedding space as nodes.

5. The knowledge graph embedding method according to claim 4, characterized in that: Step S4 specifically includes: embedding the updated node representation h v and h r The feature matrix v of the entity and relationship of the triple (s, r, o) is retrieved from s 、v r and v o , the retrieval process is as follows: in, Represent the high-dimensional index of the source entity, relation, and target entity respectively; then, DTAE is used as a decoder to score the triples, and the score ψ(s, r, o) of a candidate tail entity is calculated by the following scoring function: in, Indicates that v s Reshape into a two-dimensional matrix, * represents the convolution operation, express and The splicing, Indicated by v r The convolution filter of the generated dynamic adaptive convolutional neural network, w rDAA Indicates the use of v r The convolution filter of the generated dynamic adaptive dilated convolutional neural network, vec(·) is used to convert the tensor into a vector form, ECA(·) represents the ECA channel attention mechanism operation, and W is the conversion matrix; if the triple (s, r, o) is correct, the probability p(o|s, r) is 1, otherwise it is 0. For the training model parameters, its loss function The calculation is as follows: Where o is a label vector whose element value is 1 when the relationship exists and 0 otherwise; N is the number of entities in the knowledge graph; p(o|s,r) represents the probability distribution of candidate entity o given the source entity and relationship.

6. A knowledge graph embedding system based on multi-relational knowledge enhanced graph convolutional network, characterized in that: The system includes: The encoding module includes a multi-relationship expansion module and a relationship feature fusion module; the multi-relationship expansion module is responsible for expanding the edges of the relationships in the knowledge graph based on the directionality of the graph; the relationship feature fusion module is responsible for forming entity-relationship combinations to achieve joint learning of entity and relationship representations, and using the attention mechanism to calculate the attention weight of each edge to achieve selective aggregation of neighbor information; The vector decoding module is responsible for using DTAE to decode the embedded vector obtained through graph convolution encoding to achieve the scoring of the triples; The model training module is responsible for calculating the scores and probability distribution of all candidate triplets and calculating the loss function of the model.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the knowledge graph embedding method according to any one of claims 1 to 4.

Citation Information

Cited By

  • Event knowledge graph improvement method and device based on data driving and medium

    CN119849615A

  • A data-driven method, device, and medium for improving event knowledge graphs

    CN119849615B

  • Multi-agent reinforcement learning method, device, equipment, medium and product

    CN120633759A