A knowledge graph representation learning method fusing graph structure information

By incorporating graph structure information into a knowledge graph representation learning method, and utilizing multi-layer message passing and attention mechanisms to calculate path weights, the problem of insufficient knowledge representation in existing technologies is solved, achieving more efficient knowledge graph completion.

CN114357115BActive Publication Date: 2025-12-12HOHAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210012260.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-06
Publication Date
2025-12-12
Estimated Expiration
2042-01-06

AI Technical Summary

Technical Problem

Existing knowledge graph representation learning methods cannot effectively utilize the insufficient length of relation paths and neighborhood context information, resulting in insufficient knowledge representation capabilities and affecting the completion effect of knowledge graphs.

Method used

By fusing neighborhood context information and relational path information of triples through a multi-layer message passing mechanism, using an attention mechanism to measure the weight of relational paths, and training a convolutional neural network to complete missing triples.

Benefits of technology

It improves the representational capabilities of knowledge graphs, enhances the influence of relational paths and neighborhood contexts, and improves the accuracy and efficiency of knowledge graph completion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114357115B_ABST
    Figure CN114357115B_ABST
Patent Text Reader

Abstract

The application discloses a knowledge graph representation learning method fusing graph structure information, adopts a multilayer message passing mechanism to iteratively calculate triad neighborhood context information, adopts a path weight method to obtain relationship path information, combines an attention mechanism, utilizes the triad neighborhood context information to measure the weight of all paths of the relationship and fuses and calculates a final comprehensive path vector, so that the triad vector matrix fuses rich graph structure information, and the missing target entity is trained through a convolutional neural network, and the triads and the knowledge graph are completed; the application obtains more accurate and effective path vector representation, strengthens the influence between the path vector and the neighborhood context, and improves the representation learning capability of the knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to a knowledge graph representation learning method. BACKGROUND

[0002] A knowledge graph is a multi-relation knowledge base, which describes many objective facts in the form of triples (h, r, t). In recent years, knowledge bases such as Freebase, YAGO, DBpedia, etc. have been constructed and support applications such as intelligent question answering, web search, and recommendation systems. Although there are a large number of high-quality triple facts in the knowledge graph, for example, about 71% of people in Freebase lack birthplaces, and about 75% of people lack nationality information, so there is a lack of completeness of knowledge in the knowledge graph, and the performance of these applications is also affected by the completeness of the knowledge graph. Knowledge graph completion is to use existing knowledge graph information to mine potential objective facts, and to complete the missing information in the knowledge graph, which is of great significance to solve the data sparsity problem existing in the knowledge graph.

[0003] Knowledge graph representation learning, also known as knowledge representation learning, is to map entities and relationships to low-dimensional vector space, which can effectively alleviate the data sparsity problem and preserve the structural information between triples, and is a method to realize knowledge graph completion. From the perspective of graph, we can get rich graph structure information, such as multi-step relationship path, K-step adjacent entities of a given entity, etc., which describe the role and semantics of entities from different angles, but are ignored by previous knowledge representation methods based on single triple. For example, neighborhood context information, adjacent nodes explain the semantics of entities from the graph structure semantic level, such as PathCon, which proposes that neighborhood context information helps to determine the attributes and characteristics of target entities, and adopts a multi-layer message passing mechanism to not only solve some problems of GCN, GAT to fuse neighborhood features, but also help to measure the importance of all relationship paths. Relationship path information helps to express the association and complex relationship between entity pairs, such as using simple addition of relationship vectors or using RNN, LSTM, etc. deep learning models for modeling. However, the existing path modeling methods have shortcomings, such as using RNN, etc. to model relationship path information, the length of the relationship path is often maintained between 2 to 4 hops, because the length of the relationship path is not long enough, so the training of the path sequence using these deep learning models cannot guarantee that the output path representation is effective enough, and the use of simple relationship vectors also coarsens the weight of each relationship, which is equivalent to setting the weight to 1 and equal. Therefore, the existing knowledge graph representation learning methods cannot obtain effective path vector representation, which leads to insufficient knowledge representation capability, thereby affecting the completion of the knowledge graph. SUMMARY

[0004] Invention purposes: The purpose of the present application is to provide a knowledge graph representation learning method that fuses precise relationship path vectors and neighborhood context information, strengthens the influence between relationship paths and neighborhood context, and improves knowledge representation capabilities.

[0005] Technical solutions: The knowledge graph representation learning method fusing graph structure information comprises the following steps:

[0006] (1) Obtain the triplets and triplet feature vector matrix A = [v h ,v r ,v t ] of the knowledge graph;

[0007] (2) Fuse the features of entities and relationships in the triplets using a multi-layer message passing formula;

[0008] (3) Calculate the weighted sum of the relationships between the head entity and the tail entity to obtain the representation of each path The formula for the weight is:

[0009]

[0010] Where p i =(e1,e2,…,e l ) is a path composed of relationships e j , l is the length of the path p i , and |P (h,t) | is the number of all path sets between the head entity h and the tail entity t.

[0011] (4) Aggregate path features using an attention mechanism to obtain comprehensive path vectors;

[0012] (5) Integrate the comprehensive path vectors into the triplet feature vector matrix A, train the missing target entity through a convolutional neural network, and complete the triplets and the knowledge graph.

[0013] Further, in step (2), the features of entities and relationships in the K-order neighborhood of the head entity and the tail entity in the triplets are fused, and the K is not greater than 3.

[0014] Further, step (2) comprises the following steps:

[0015] (21) Calculate the hidden state of the entity v in the i-th iteration Where is the hidden state of the relationship e in the i-th iteration, and E(v) is the set of first-order neighborhood relationships of the entity v.

[0016] (22) Calculate the hidden state of the relation e in the i+1th iteration where are the hidden states of the head entity h and tail entity t in the ith iteration, N(e) is the entities on both sides of the relation e, and AGGREGATE is an aggregation operation.

[0017] (23) Repeat steps (21) and (22) for N iterations to obtain

[0018] Further, step (4) includes the following steps:

[0019] (41) Calculate the neighborhood context information

[0020] (42) Calculate the attention weight of each path using the neighborhood context information

[0021]

[0022] (43) Calculate the comprehensive path vector representation of the head entity h to the tail entity t:

[0023]

[0024] Further, the formula for integrating the comprehensive relation vector into the triple feature vector matrix A in step (5) is:

[0025] A' = [v h ,v r + P h→t ,v t ] ∈ R kx3 .

[0026] Further, the method for obtaining the missing target entity in step (5) is:

[0027] (51) Use a convolutional neural network to extract features and calculate the evaluation function f(h, r, t) of the triple:

[0028]

[0029] where σ(·) is an activation function, is an average pooling function, * is a convolution operation, and Ω and ω are shared parameters.

[0030] (52) Use the convolutional neural network to train the evaluation function model F that minimizes the soft-margin loss;

[0031] (53) Use the model F to predict the missing triple and obtain the target entity with the highest evaluation score, which is the missing target entity in the triple.

[0032] Beneficial effects: The advantages of this invention compared with the prior art are: (1) The weight path calculation method designed in this invention models the relation path, which not only obtains a more accurate and effective path vector representation, but also strengthens the influence between the neighboring context; (2) Using the neighborhood context information of triples to measure the weight of all paths of the relation and integrate the calculation of the final comprehensive path vector makes the triple vector matrix integrate rich graph structure information, thereby improving the representation ability of the model. Attached Figure Description

[0033] Figure 1 This is a diagram of the knowledge graph representation learning model of the present invention;

[0034] Figure 2 This is a diagram showing the implementation parameters on four benchmark datasets in this embodiment of the invention;

[0035] Figure 3 This is a comparison chart of experimental results on datasets FB15K and WN18 in this embodiment of the invention;

[0036] Figure 4 This is a comparison chart of experimental results on datasets FB15K-237 and WN18RR in this embodiment of the invention. Detailed Implementation

[0037] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0038] like Figure 1 As shown, the knowledge graph representation learning method of this invention improves upon traditional methods by fusing neighborhood context information and relation path information of triples. It employs a multi-layer message passing mechanism to iteratively calculate the neighborhood context information of triples and uses path weights to obtain relation path information. Simultaneously, it combines an attention mechanism, utilizing the neighborhood context information of triples to measure the weights of all paths in a relation and fusing them to calculate the final comprehensive path vector. This results in the triple vector matrix incorporating rich graph structure information, improving the model's representational capability. The method includes the following steps:

[0039] (1) Obtain the triples and triple feature vector matrix A = [v] of the knowledge graph. h ,v r ,v t ].

[0040] (2) Use the multi-level message passing formula to perform feature fusion on the entities and relations in the triple.

[0041] The triple neighborhood context information refers to the entity and relationship information in the K-order neighborhood of the head and tail entities in the triple. The neighborhood context information is aggregated by using a multi-layer message passing formula, and 2 to 3-order neighborhoods are selected according to different data sets. Specifically, the following steps are performed:

[0042] (21) The aggregation operation is performed on all the relationships connected to the entity v to obtain denotes the hidden state of the relationship e after the i th iteration, denotes the hidden state of the entity v in the i th iteration, denotes the initial vector corresponding to the relationship e, and E(v) denotes the set of first-order neighborhood relationships of the entity v.

[0043] (22) The hidden states of the head entity h and the tail entity t of the single triple (h, r, t) are obtained according to step (21) Then, the hidden state of the relationship e after the i+1 th iteration is obtained by aggregation:

[0044]

[0045] wherein N(e) denotes the entities at both ends of the relationship e, and AGGREGATE denotes the aggregation operation. Cross or Concat operation is selected according to different data sets;

[0046] (23) Steps (21) and (22) are repeated for N iterations to obtain

[0047] (3) Fusion of relationship path information: The relationship path of the triple refers to all the connected paths between the head entity and the tail entity in the triple. The feature representation of all the paths is obtained by using the weight path calculation method for all the relationship paths. Specifically, the following steps are performed:

[0048] (31) A path from the head entity h to the tail entity t can be represented as wherein l denotes the length of the path, e i is the relationship connecting the entities, and v i is the entity in the path. The entities in the original path are excluded, and a relationship path p i = (e1, e2, …, e l ) is defined.

[0049] (32) The weight of the relationship between the head entity and the tail entity in the triple in all the paths is calculated. For the relationship e j , the weight

[0050]

[0051] where |e j | represents the number of paths p i in relation e j (h,t) | represents the number of all paths between head entity h and tail entity t.

[0052] (33) According to step (32), the representation of each path is obtained by weighted summation of all relations:

[0053]

[0054] By representing the importance of each relation in all paths of the triple head entity and tail entity, that is, the more times this relation appears, the less important this relation is, and the calculation method of the weight path strengthens the interaction and influence of the neighborhood context, enhancing the role of step (4).

[0055] (4) Utilizing the attention mechanism to aggregate the relation features to obtain a comprehensive path vector;

[0056] (41) Calculate the hidden state of the head entity h and the tail entity t in the triple (h, r, t) to aggregate the neighborhood context information c (h,t) of the entity pair (h, t).

[0057]

[0058] (42) All paths between the entity pair (h, t) and the importance are not equal, and by utilizing the neighborhood context information c (h,t) of the entity pair, the importance score of each path is measured:

[0059]

[0060] (43) According to step (42), the corresponding attention weight is added to each relation path, and the weighted summation is obtained to obtain the final comprehensive path vector representation:

[0061]

[0062] where P h→t represents the comprehensive representation of all relation paths between the entity pair (h, t), so the neighborhood context information c (h,t) in the above steps (42) and (43) plays a role in distinguishing the most important paths, expanding the influence of useful paths to fuse more effective graph structure information.

[0063] ​(5) The comprehensive path vector is fused into the triple feature vector matrix A, a missing target entity is obtained by training through a convolutional neural network, and a triple and a knowledge graph are completed, specifically as follows:

[0064] (51) The comprehensive path vector is fused into the triple feature vector matrix A=[v h ,v r ,v t ], that is, the graph structure information of the triple in the knowledge graph:

[0065]

[0066] (52) A convolutional neural network is used to extract features and calculate an evaluation function:

[0067]

[0068] wherein sigma (·) is an activation function, a nonlinear activation function ReLU is selected in the embodiment, and is an average pooling function, * is a convolution operation, and omega and omega are shared parameters;

[0069] (53) A convolutional neural network is used to train an evaluation function model F that minimizes a soft margin loss:

[0070]

[0071] wherein G represents a triple positive sample set, G' represents a triple negative sample set, l (h,r,t) is a data label, when (h, r, t) belongs to the positive sample l (h,r,t) is 1, otherwise, it is -1, is an L2 regularization term;

[0072] (54) The model F is used to predict a missing triple, and a target entity with the highest evaluation score is obtained, that is, a missing target entity in the triple;

[0073] (55) A new triple is completed in the knowledge graph.

[0074] In order to verify the effect of the application, a model is built by using a python programming language in the embodiment, and four benchmark data sets are used in the experiment, which are WN18, FB15k, WN18RR and FB15k-237, wherein WN18 contains 40943 entities and 18 relations, FB15k contains 14951 entities and 1352 relations, WN18RR contains 40943 entities and 11 relations, and FB15k-237 contains 14541 and 237 entities, and specific implementation parameters are shown as follows. Figure 2

[0075] ​In order to evaluate the representation learning ability of the application, two important evaluation indexes MR and Hits@10 are selected on the knowledge graph completion task, and the representative model is compared with the experimental comparison, the smaller the MR value, the larger the Hits@10 value, the better the representation ability of the model. For the data sets FB15k and WN18, they contain inverse relationship data sets, while FB15k-237 and WN18RR are based on the first two data sets, and the inverse relationship triplets are removed, and all the constructed data sets are more real and more challenging.

[0076] As shown in Figure 3 , the Hits@10 value of the application is improved in two data sets, and as shown in Figure 4 , the application achieves the best result in two indexes of two data sets, which shows the effectiveness of the application in the knowledge graph task. From Figure 4 , compared with the latest ConvKB, the MR value of the application is improved by 58, and the Hits@10 is improved by 6.7% on FB15k-237; on WN18RR, the MR value of the application is improved by 97, and the Hits@10 is improved by 2.2. From the above performance analysis, it can be seen that the application has good ability to fuse the graph structure information of the knowledge graph, including the fusion of the neighborhood context information and the relationship path information of the triplets, and these information can effectively express the relationship between entities, at the same time, the neighborhood context information is used to measure the importance score of the relationship path, which ensures that the fused path information is the most effective, and the experimental results show that the application can effectively improve the representation ability of the model for triplets.

Claims

1. A knowledge graph representation learning method that integrates graph structure information, characterized in that, Includes the following steps: (1) Obtain the triples and triple feature vector matrix A = [v] of the knowledge graph. h ,v r ,v t ]; (2) Use the multi-level message passing formula to perform feature fusion on the entities and relations in the triples; the entities and relations are taken from any one of the WN18, FB15k, WN18RR and FB15k-237 datasets; (3) Calculate the weighted sum of the relationships between the head entity and the tail entity to obtain the representation of each path. Weight The formula is: Where, p i =(e1,e2,…,e l ) is due to relation e j A path consisting of p, where l is the path p i The length of |P (h,t) | represents the set of all paths between the head entity h and the tail entity t; (4) Use the attention mechanism to aggregate path features to obtain a comprehensive path vector; (5) Integrate the comprehensive path vector into the triplet feature vector matrix A, train the convolutional neural network to obtain the missing target entity, and complete the triplet and knowledge graph; Step (2) includes the following steps: (21) Calculate the hidden state of entity v in the i-th iteration. in Let E(v) be the hidden state of relation e in the i-th iteration, and let E(v) be the set of first-order neighborhood relations of entity v. (22) Calculate the hidden state of relation e in the (i+1)th iteration. in Let h and t be the hidden states of the head entity h and tail entity t respectively in the i-th iteration, N(e) be the entities at both ends of relation e, and AGGREGATE be the aggregation operation; (23) Repeat steps (21) and (22) for N iterations to obtain 2. The knowledge graph representation learning method that integrates graph structure information according to claim 1, characterized in that, In step (2), feature fusion is performed on the entities and relations in the K-order neighborhood of the head entity and tail entity in the triplet.

3. The knowledge graph representation learning method that integrates graph structure information according to claim 2, characterized in that, The value of K is no greater than 3.

4. The knowledge graph representation learning method that integrates graph structure information according to claim 1, characterized in that, Step (4) includes the following steps: (41) Calculate neighborhood context information (42) Calculate the attention weight for each path using the neighborhood context information. (43) Calculate the comprehensive path vector representation from the head entity h to the tail entity t:

5. The knowledge graph representation learning method that integrates graph structure information according to claim 1, characterized in that, The formula for integrating the comprehensive relation vector into the triplet feature vector matrix A in step (5) is as follows: A′=[in h ,in r +P h→t ,in t ]∈R kx3 。 6. The knowledge graph representation learning method that integrates graph structure information according to claim 1, characterized in that, The method for obtaining the missing target entity in step (5) is as follows: (51) Use a convolutional neural network for feature extraction and calculate the evaluation function f(h,r,t) for the triples: Where σ(·) is the activation function. Ω represents the average pooling function, * represents the convolution operation, and Ω and ω are shared parameters. (52) The evaluation function model F that minimizes the soft margin loss is obtained by training a convolutional neural network; (53) Use model F to predict the missing triples and obtain the target entity with the highest evaluation score, which is the missing target entity in the triple.

Citation Information

Patent Citations

  • Knowledge graph fusion method based on entity alignment

    CN110941722A

  • Knowledge extraction and fusion method based on big data

    CN111191044A