Entity alignment method for heterogeneous knowledge graphs based on multi-view and graph enhancement

Through multi-view representation learning and graph enhancement technology, the problems of insufficient information utilization and low anti-interference ability in heterogeneous knowledge graph entity alignment are solved, and higher entity alignment accuracy is achieved.

CN118734953BActive Publication Date: 2024-11-29HUAQIAO UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411203434.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-11-29
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

Existing heterogeneous knowledge graph entity alignment technology fails to make full use of all the information of the knowledge graph, and there are problems with overfitting and data noise, resulting in insufficient anti-interference ability and affecting the accuracy of entity alignment.

Method used

Using multi-view representation learning combined with graph enhancement technology, through Xavier initialization, multi-head attention mechanism and vector stitching, views of entities, relationships and attributes are built, enhanced knowledge graphs are generated, and comparison learning based on margin distance and anti-interference are carried out to improve entities. Accuracy of alignment.

Benefits of technology

Effectively capture the characteristic information of the knowledge graph, reduce data noise and errors, and improve the anti-interference and accuracy of heterogeneous knowledge graph entity alignment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734953B_ABST
    Figure CN118734953B_ABST
Patent Text Reader

Abstract

The present invention discloses a heterogeneous knowledge graph entity alignment method based on multi-view and graph enhancement, which relates to the technical field of knowledge graphs, including: embedding entities, relationships, attributes and attribute values ​​of knowledge graphs by vectors to obtain initialization vectors; constructing entity neighbor adjacency matrix, entity relationship adjacency matrix, entity attribute adjacency matrix and entity attribute value adjacency matrix of knowledge graphs, and constructing entity neighbor view, relationship view, attribute view and attribute value view; fusing attribute view and attribute value view to form attribute-attribute value view; integrating various views to obtain knowledge graph entity fusion embedding representation; generating enhanced knowledge graphs, and obtaining entity fusion embedding representation of enhanced knowledge graphs; and obtaining heterogeneous knowledge graph entity alignment model. The present invention uses multi-views to better capture all information on knowledge graphs, and uses graph enhancement technology to reduce data noise and errors, thereby improving the accuracy of entity alignment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge graph technology, and in particular to a heterogeneous knowledge graph entity alignment method based on multi-view and graph enhancement. Background Art

[0002] Heterogeneous knowledge graph entity alignment is a core and extremely challenging task in natural language processing. It aims to identify and link information describing the same entity from knowledge graphs of different structures and sources, so as to promote the integration and interaction of knowledge graphs. Although there have been a lot of research on entity extraction from heterogeneous knowledge graphs, a large number of current studies on entity alignment in heterogeneous knowledge graphs only use the entity names and relationship structures of the knowledge graphs, and do not fully utilize all the information on the knowledge graphs. In addition, the anti-interference ability of entity alignment in heterogeneous knowledge graphs has been a long-standing problem. On the one hand, if the attributes, entities, relationships and other information on the knowledge graph are fully utilized for representation learning, the features on the knowledge graph can be well learned to improve the accuracy of entity alignment. On the other hand, entity alignment in heterogeneous knowledge graphs is prone to overfitting problems, and the data in heterogeneous knowledge graphs often have data noise and errors. Summary of the invention

[0003] The main purpose of the present invention is to overcome the above-mentioned defects in the prior art, and propose a heterogeneous knowledge graph entity alignment method based on multi-view and graph enhancement, which uses multi-view to better capture all information on the knowledge graph for feature representation and fusion, and combines graph enhancement technology to reduce data noise and errors, improve the anti-interference ability of heterogeneous knowledge graph entity alignment, and ultimately improve the accuracy of entity alignment.

[0004] The present invention adopts the following technical solution:

[0005] A heterogeneous knowledge graph entity alignment method based on multi-view and graph enhancement, comprising:

[0006] Step 1: Use the Xavier initialization method to embed the entities, relationships, attributes and attribute values ​​of the two heterogeneous original knowledge graphs into vectors, and obtain their respective initialization vectors including the initialization entity vector, initialization relationship vector, initialization attribute vector and initialization attribute value vector;

[0007] Step 2, respectively constructing the entity neighbor adjacency matrix, entity relationship adjacency matrix, entity attribute adjacency matrix and entity attribute value adjacency matrix of the two original knowledge graphs, and sending the respective initialization vectors, entity neighbor adjacency matrix, entity relationship adjacency matrix, entity attribute adjacency matrix and entity attribute value adjacency matrix to the view construction module to obtain the entity neighbor view, relationship view, attribute view and attribute value view;

[0008] Step 3, respectively fusing the attribute view and attribute value view of the two original knowledge graphs through a multi-head attention mechanism to form their own attribute-attribute value views;

[0009] Step 4, using a vector concatenation method to integrate the entity neighbor view, relationship view and attribute-attribute value view of the two original knowledge graphs to obtain an entity fusion embedding representation of the two original knowledge graphs;

[0010] Step 5: Introduce graph enhancement technology to process the two original knowledge graphs to generate enhanced knowledge graphs, and obtain entity fusion embedding representations of the two enhanced knowledge graphs;

[0011] Step 6: Perform margin distance-based comparative learning on the entity fusion embedding representation between the two enhanced knowledge graphs, and obtain a trained heterogeneous knowledge graph entity alignment model by performing anti-interference-based comparative learning between the enhanced knowledge graph and the original knowledge graph; based on the trained heterogeneous knowledge graph entity alignment model, calculate the distance between the entity fusion embedding representations of the two original knowledge graphs.

[0012] Preferably, the step 1 specifically comprises:

[0013] Step 11, the two heterogeneous original knowledge graphs G1 and G2 are respectively expressed as follows:

[0014]

[0015]

[0016] in, represents the i-th head entity in the original knowledge graph G1, represents the i-th relationship in the original knowledge graph G1, represents the i-th tail entity in the original knowledge graph G1, represents the i-th attribute in the original knowledge graph G1, Represents the i-th attribute value in the original knowledge graph G1; represents the i-th head entity in the original knowledge graph G2, represents the i-th relationship in the original knowledge graph G2, represents the i-th tail entity in the original knowledge graph G2, represents the i-th attribute in the original knowledge graph G2, Represents the i-th attribute value in the original knowledge graph G2; i = 1, 2, ..., n, where the size of n is related to the computing power of the processor;

[0017] Step 12: Use Xavier to initialize the vector and obtain the initialization entity vector of the original knowledge graph G1 Initialize the relationship vector Initialize the attribute vector and initialize the attribute value vector And the initialization entity vector of the original knowledge graph G2 Initialize the relationship vector Initialize the attribute vector and initialize the attribute value vector

[0018] Preferably, the calculation formula of each initialization vector is as follows:

[0019]

[0020] Where W represents the generated initialization vector; represents uniform distribution; d in Represents the dictionary length of each concept in the knowledge graph; d out Represents the output dimension of each concept vector of the knowledge graph.

[0021] Preferably, the step 2 specifically includes:

[0022] Step 21, construct the entity neighbor adjacency matrix adj1, entity relationship adjacency matrix rel_adj1, entity attribute adjacency matrix attr_adj1 and entity attribute value adjacency matrix val_adj1 of the original knowledge graph G1, and construct the entity neighbor adjacency matrix adj2, entity relationship adjacency matrix rel_adj2, entity attribute adjacency matrix attr_adj2 and entity attribute value adjacency matrix val_adj2 of the original knowledge graph G2;

[0023] Step 22, perform multi-head attention calculation on the initialized entity vectors E1 and E2 and the entity neighbor adjacency matrices adj1 and adj2 to obtain the aggregated neighbor entity vectors of E1 and E2 respectively. The formula is as follows:

[0024]

[0025] Wherein, the subscript k takes the value of 1 or 2; Represents the initialization entity vector The aggregated neighbor entity representation vector at layer l, Represents the initialization entity vector The set of neighbor entities of Represents the initialization entity vector and neighbor entities Attention weights at layer l are calculated as follows:

[0026]

[0027] Where, subscript j = 1, 2, ..., n, w = 1, 2, ..., n, Represents the initialization entity vector Aggregate neighbor entity representation vector at layer l; a T represents the learnable attention mechanism weight vector; W g represents a learnable weight matrix used to transform the entity representation vector to a new space; Represents the initialization entity vector The aggregated neighbor entity representation vector at the l-1 layer; LeakyReLU represents the LeakyReLU activation function, which is used to calculate the nonlinear transformation in the attention weight; exp is the exponential function, which is used to calculate the normalization of the attention weight; Represents a vector connection operation, which connects the entity and neighbor entities Connect together;

[0028] The aggregated neighbor entity representation vector of the lth layer is normalized, and the vector aggregation and splicing are performed based on the residual connection. The calculation formula is as follows:

[0029]

[0030] Among them, ||·||2 represents the two-norm, Represents the entity vector after aggregation and splicing, range is the residual connection range of multi-head attention, and Concatenate represents the vector aggregation and splicing function;

[0031] Next, we apply a multi-head attention mechanism to the aggregated entity vector to integrate the information of all layers and obtain the entity neighbor view. and The calculation formula is as follows:

[0032]

[0033] in, The subscript k is 1 or 2, indicating the entity neighbor view of the original knowledge graph G1 Or the entity neighbor view of the original knowledge graph G2 MultiHead represents the core operation of the multi-head attention mechanism;

[0034] MultiHead is the core operation of the multi-head attention mechanism. It performs multi-head attention calculation on the input query, key, and value. The calculation formula is as follows:

[0035] MultiHead(query,key,value)=Concat(head1,head2,...,head h )W O ;

[0036] Among them, W O is a learnable weight parameter, head p , p = 1, 2, ..., h is the pth attention head, and the calculation formula is as follows:

[0037]

[0038] in, is a learnable weight parameter. The specific Attention calculation formula is as follows:

[0039]

[0040] where d k is the dimension of the key vector, and softmax is the activation function;

[0041] Step 23, for the initialization relationship vectors R1 and R2 and the entity relationship adjacency matrices rel_adj1 and rel_adj2, first sum the entity relationship adjacency matrices, then multiply them with the initialization relationship vectors and normalize them to obtain the relationship view and The calculation formula is as follows:

[0042]

[0043] in, represents the sum of the rth row of the entity relationship adjacency matrix, represents the rth initialization relationship vector, It means that the sum of the rth row of the adjacency matrix is ​​matrix multiplied with the rth initialized relationship vector;

[0044] Step 24: for the initialization attribute vectors A1 and A2 and the entity attribute adjacency matrices attr_adj1 and attr_adj2, first sum the entity attribute adjacency matrices, then multiply them with the initialization attribute vectors and normalize them to obtain the attribute view and The calculation formula is as follows:

[0045]

[0046] in, represents the sum of the rth row of the entity attribute adjacency matrix, represents the rth initialization attribute vector, It means that the sum of the rth row of the adjacency matrix is ​​matrix multiplied with the rth initialization vector;

[0047] Step 25: For the initialization attribute value vectors V1 and V2 and the entity attribute value adjacency matrices val_adj1 and val_adj2, first sum the entity attribute value adjacency matrices, then multiply them with the initialization attribute value vectors and normalize them to obtain the final attribute value view. and The calculation formula is as follows:

[0048]

[0049] in, represents the sum of the rth row of the adjacency matrix of the entity attribute value, represents the rth initialized attribute value vector, It represents the matrix multiplication of the sum of the r-th row of the adjacency matrix and the r-th initialized attribute value vector.

[0050] Preferably, the step 3 specifically includes:

[0051] Step 31, for the attribute view and and the property value view and Fusion into attribute-attribute value vectors through highway gates and The calculation formula is as follows:

[0052]

[0053] in, represents the attribute view, Wq is the weight matrix, bq represents the bias vector, σ represents the sigmoid function, which limits the value between 0 and 1, and ⊙ represents the Hadamard product;

[0054] Step 32, for the attribute-attribute value vector and Properties View and and the property value view and Fusion into attribute-attribute value view through multi-head attention mechanism and The calculation formula is as follows:

[0055]

[0056] Preferably, the step 4 specifically includes:

[0057] For entity view and Relationship View and and the attribute-attribute value view and Using the vector concatenation method, each view is integrated to obtain the entity fusion embedding representation of the original knowledge graph. and The calculation formula is as follows:

[0058]

[0059] Among them, Concat represents the vector concatenation method.

[0060] Preferably, the step 5 specifically includes:

[0061] Step 51: Randomly delete relations and attributes from the original knowledge graphs G1 and G2. The deletion decision is to determine whether an entity has two or more neighbor entities or attribute values, thereby obtaining an enhanced knowledge graph. and

[0062] Step 52: Enhanced knowledge graph and Perform the same process as steps 2 to 4 to obtain the entity fusion embedding representation of the enhanced knowledge graph and

[0063] Preferably, the step 6 specifically includes:

[0064] Step 61: Entity fusion embedding representation for enhanced knowledge graph and Calculate the alignment loss based on the margin distance The calculation formula is as follows:

[0065]

[0066] Among them, (e i , e j )∈S represents a positively aligned entity pair; represents the negative sample pairs constructed from the positive aligned entity pairs; ρ is a hyperparameter; [·] + It is a corrective operation;

[0067] Step 62: Enhance the knowledge graph and Entity fusion embedding representation of original knowledge graphs G1 and G2 and enhanced knowledge graphs and And knowledge graph entity fusion embedding representation and Calculation of contrast loss based on interference rejection The calculation formula is as follows:

[0068]

[0069] Among them, E z ={G1, G2} represents all entities in the original knowledge graphs G1 and G2, e i ∈E z Indicates E z An entity in , symmetric contrast loss The calculation formula is as follows:

[0070]

[0071] Symmetric contrast loss The calculation formula is as follows:

[0072]

[0073] in, is the i-th embedding representation of the knowledge graph entity fusion embedding representation, The heterogeneous knowledge graph entity fusion embedding representation is the i-th embedding representation, Heterogeneous knowledge graph entity fusion embedding represents the oth embedding representation, proj is the projection function, which contains a linear transformation and activation function, used to map the high-dimensional vector to the low-dimensional space; <·) represents the inner product operation, that is, the dot product of two vectors;

[0074] Step 63, calculate the total loss The calculation formula is as follows:

[0075]

[0076] Among them, λ is a hyperparameter used to balance the marginal alignment loss and contrast loss The weight of Perform iterative optimization training to finally obtain a trained heterogeneous knowledge graph entity alignment model;

[0077] Step 64: fuse the embedding representations of any two entities and The trained heterogeneous knowledge graph entity alignment model calculates the distance. The calculation formula is as follows:

[0078]

[0079] in, Represents the entity fusion embedding representation in the original knowledge graph G1 The i-th vector; Represents the entity fusion embedding representation in the original knowledge graph G2 The jth vector; e opt is an entity node in the original knowledge graph G2, indicating the entity closest to the i-th entity in the original knowledge graph G1; d opt Yes opt The distance corresponding to the i-th entity in the original knowledge graph G1 will be compared with the threshold parameter ε to determine whether the corresponding two entities are an aligned entity pair.

[0080] Compared with the prior art, the present invention has the following beneficial effects:

[0081] The present invention uses multiple views to better capture all information on the knowledge graph for feature representation and fusion, and combines graph enhancement technology to reduce data noise and errors, improve the anti-interference ability of entity alignment in heterogeneous knowledge graphs, and ultimately improve the accuracy of entity alignment. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] Figure 1 It is a flow chart of the entity alignment method of heterogeneous knowledge graph based on multi-view and graph enhancement of the present invention;

[0083] Figure 2 This is a result block diagram of the heterogeneous knowledge graph entity alignment model based on multi-view and graph enhancement of the present invention. DETAILED DESCRIPTION

[0084] The present invention will be further described below in conjunction with specific implementation examples. It should be understood that the implementation examples are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.

[0085] See also Figure 1 and Figure 2 As shown, the present invention provides a heterogeneous knowledge graph entity alignment method based on multi-view and graph enhancement, comprising the following steps:

[0086] Step 1: Use the Xavier initialization method to embed the entities, relationships, attributes and attribute values ​​of the two heterogeneous original knowledge graphs into vectors, and obtain their respective initialization vectors including the initialization entity vector, initialization relationship vector, initialization attribute vector and initialization attribute value vector;

[0087] Step 2, respectively constructing the entity neighbor adjacency matrix, entity relationship adjacency matrix, entity attribute adjacency matrix and entity attribute value adjacency matrix of the two original knowledge graphs, and sending the respective initialization vectors, entity neighbor adjacency matrix, entity relationship adjacency matrix, entity attribute adjacency matrix and entity attribute value adjacency matrix to the view construction module to obtain the entity neighbor view, relationship view, attribute view and attribute value view;

[0088] Step 3, respectively fusing the attribute view and attribute value view of the two original knowledge graphs through a multi-head attention mechanism to form their own attribute-attribute value views;

[0089] Step 4, using a vector concatenation method to integrate the entity neighbor view, relationship view and attribute-attribute value view of the two original knowledge graphs to obtain an entity fusion embedding representation of the two original knowledge graphs;

[0090] Step 5: Introduce graph enhancement technology to process the two original knowledge graphs to generate enhanced knowledge graphs, and obtain entity fusion embedding representations of the two enhanced knowledge graphs;

[0091] Step 6: Perform margin distance-based comparative learning on the entity fusion embedding representation between the two enhanced knowledge graphs, and obtain a trained heterogeneous knowledge graph entity alignment model by performing anti-interference-based comparative learning between the enhanced knowledge graph and the original knowledge graph; based on the trained heterogeneous knowledge graph entity alignment model, calculate the distance between the entity fusion embedding representations of the two original knowledge graphs.

[0092] In this embodiment, the step 1 is specifically as follows.

[0093] Step 11: Assume the input heterogeneous knowledge graph

[0094]

[0095]

[0096] The following is an example. The original knowledge graph G1 includes 50,307 relationship triples, 44,987 attribute triples, 9,161 entities, 21 attributes, and 44,987 attribute values. The knowledge graph G2 includes 158,357 relationship triples, 11,467 attribute triples, 9,164 entities, 19 attributes, and 11,467 attribute values. The heterogeneous knowledge graph contains a total of 33 relationships, 35 attributes, and 46,227 attribute values.

[0097] Step 12: Use Xavier to initialize the vector of the entity text "dry cough, meningioma, renal obstruction,...", the relationship text "label, site of onset, related examination,...", the attribute "department of treatment, susceptible population, Chinese name,...", and the attribute value text "respiratory medicine, female, adolescent,..." to obtain the original knowledge graph G1 initialization entity vector [E1] 9161×256 , initialize the relationship vector [R1] 33×128 , initialize the attribute vector [A1] 35×128 , initialize the attribute value vector [V1] 46227×128 And the original knowledge graph G2 initializes the entity vector [E2] 9164×256 , initialize the relationship vector [R2] 33×128 , initialize the attribute vector [A2] 35×128 , initialize attribute value vector [V2] 46227×128 .

[0098] In this embodiment, the step 2 is specifically as follows.

[0099] Step 21, input the original knowledge graphs G1 and G2, and construct the entity neighbor adjacency matrix [adj1] respectively 9161×9161 , entity relationship adjacency matrix [rel_adj1] 9161×33 , entity attribute adjacency matrix [attr_adj1] 9161×35 , entity attribute value adjacency matrix [val_adj1] 9161×46227 and entity neighbor adjacency matrix [adj2] 9164×9164 , entity relationship adjacency matrix [rel_adj2] 9164×33 , 9164 rows and 35 columns of entity attribute adjacency matrix [attr_adj2] 9164×35 , 9164 rows and 46227 columns of entity attribute value adjacency matrix [val_adj2] 9164×46227 .

[0100] Step 22, for initializing entity vector [E1] 9161×256 and [E2] 9164×256 and the entity neighbor adjacency matrix [adj1] 9161×9161 and[adj2] 9164×9164 , get the entity neighbor view and

[0101] Step 23, for initializing the relationship vector [R1] 33×256 and [R2] 33×256 And the entity relationship adjacency matrix [rel-adj1] 9161×33 and [rel_adj2] 9164×33, get the relationship view and

[0102] Step 24, for initializing attribute vector [A1] 35×128 and [A2] 35×128 and the entity attribute adjacency matrix [attr_adj1] 9161×35 and [attr_adj2] 9164×35 , get the attribute view and

[0103] Step 25, for the initialization attribute value vector [V1] 46227×128 and [V2] 46227×128 And the entity attribute value adjacency matrix [val_adj1] 9164×46227 and [val_adj2] 9164×46227 , get the attribute value view and

[0104] In this embodiment, step 3 is specifically as follows.

[0105] Step 31, for the attribute view and and the property value view and Get attribute-attribute value vector and

[0106] Step 32, for the attribute-attribute value vector and Properties View and and the property value view and Get the attribute-attribute value view and

[0107] In this embodiment, step 4 is specifically as follows.

[0108] For entity view and Relationship View and and the attribute-attribute value view and Get the knowledge graph entity fusion embedding representation and

[0109] In this embodiment, step 5 is specifically as follows.

[0110] Step 51: Randomly select relations and attributes from the original knowledge graphs G1 and G2 for deletion. This time, 3217 relations and 2877 attributes are randomly deleted from G1, and 397 relations and 19 attributes are randomly deleted from G2. Finally, an enhanced knowledge graph containing 47242 relation triples and 42631 attribute triples is obtained. and an enhanced knowledge graph containing 157,960 relation triples and 11,467 attribute triples

[0111] Step 52: Enhanced knowledge graph and To enhance the knowledge graph and enhanced knowledge graph As input, perform the same processing as steps 1 to 4 to obtain the entity fusion embedding representation of the enhanced knowledge graph and

[0112] In this embodiment, step 6 is specifically as follows.

[0113] Step 61: Entity fusion embedding representation for enhanced knowledge graph and The margin distance based alignment loss is calculated and the threshold ρ of this module is set to 0.01.

[0114] Step 62: Enhanced knowledge graph and Entity fusion embedding representation of original knowledge graphs G1 and G2 and enhanced knowledge graphs and And knowledge graph entity fusion embedding representation and Compute the contrast loss based on interference rejection.

[0115] Step 63, calculate the total loss The balance of this module is based on the alignment loss of the margin distance and contrast loss based on interference rejection The weight λ is set to 100.

[0116] Step 64, for any two entities "malignant malaria" and "cerebral malaria", the distance calculated is 0.46367, the threshold parameter ε is 0.7, and after comparison, it is determined that "malignant malaria" and "cerebral malaria" are an aligned entity pair.

[0117] The above is only a specific implementation of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial changes to the present invention using this concept shall be deemed as an infringement of the protection scope of the present invention.

Claims

1. A heterogeneous knowledge graph entity alignment method based on multi-view and graph enhancement, characterized in that: include: Step 1: Use the Xavier initialization method to embed the entities, relationships, attributes and attribute values ​​of the two heterogeneous original knowledge graphs into vectors, and obtain their respective initialization vectors including the initialization entity vector, initialization relationship vector, initialization attribute vector and initialization attribute value vector; Step 2, respectively constructing the entity neighbor adjacency matrix, entity relationship adjacency matrix, entity attribute adjacency matrix and entity attribute value adjacency matrix of the two original knowledge graphs, and sending the respective initialization vectors, entity neighbor adjacency matrix, entity relationship adjacency matrix, entity attribute adjacency matrix and entity attribute value adjacency matrix to the view construction module to obtain the entity neighbor view, relationship view, attribute view and attribute value view; Step 3, respectively fusing the attribute view and attribute value view of the two original knowledge graphs through a multi-head attention mechanism to form their own attribute-attribute value views; Step 4, using a vector concatenation method to integrate the entity neighbor view, relationship view and attribute-attribute value view of the two original knowledge graphs to obtain an entity fusion embedding representation of the two original knowledge graphs; Step 5: Introduce graph enhancement technology to process the two original knowledge graphs to generate enhanced knowledge graphs, and obtain entity fusion embedding representations of the two enhanced knowledge graphs; Step 6: Perform margin distance-based comparative learning on the entity fusion embedding representation between the two enhanced knowledge graphs, and obtain a trained heterogeneous knowledge graph entity alignment model by performing anti-interference-based comparative learning between the enhanced knowledge graph and the original knowledge graph; based on the trained heterogeneous knowledge graph entity alignment model, calculate the distance between the entity fusion embedding representations of the two original knowledge graphs.

2. According to claim 1, the entity alignment method for heterogeneous knowledge graphs based on multi-view and graph enhancement is characterized in that: The step 1 specifically includes: Step 11, the two heterogeneous original knowledge graphs G1 and G2 are respectively expressed as follows: in, represents the i-th head entity in the original knowledge graph G1, represents the i-th relationship in the original knowledge graph G1, represents the i-th tail entity in the original knowledge graph G1, represents the i-th attribute in the original knowledge graph G1, Represents the i-th attribute value in the original knowledge graph G1; represents the i-th head entity in the original knowledge graph G2, represents the i-th relationship in the original knowledge graph G2, represents the i-th tail entity in the original knowledge graph G2, represents the i-th attribute in the original knowledge graph G2, Represents the i-th attribute value in the original knowledge graph G2; i = 1, 2, ..., n, where the size of n is related to the computing power of the processor; Step 12: Use Xavier to initialize the vector and obtain the initial entity vector of the original knowledge graph g1 Initialize the relationship vector Initialize the attribute vector and initialize the attribute value vector And the initialization entity vector of the original knowledge graph G2 Initialize the relationship vector Initialize the attribute vector and initialize the attribute value vector 3. The heterogeneous knowledge graph entity alignment method based on multi-view and graph enhancement according to claim 2 is characterized in that: The calculation formula for each initialization vector is as follows: Where W represents the generated initialization vector; represents uniform distribution; d in Represents the dictionary length of each concept in the knowledge graph; d out Represents the output dimension of each concept vector of the knowledge graph.

4. The heterogeneous knowledge graph entity alignment method based on multi-view and graph enhancement according to claim 2 is characterized in that: The step 2 specifically includes: Step 21, construct the entity neighbor adjacency matrix adj1, entity relationship adjacency matrix rel_adj1, entity attribute adjacency matrix attr_adj1 and entity attribute value adjacency matrix val_adj1 of the original knowledge graph G1, and construct the entity neighbor adjacency matrix adj2, entity relationship adjacency matrix rel_adj2, entity attribute adjacency matrix attr_adj2 and entity attribute value adjacency matrix val_adj2 of the original knowledge graph G2; Step 22, perform multi-head attention calculation on the initialized entity vectors E1 and E2 and the entity neighbor adjacency matrices adj1 and adj2 to obtain the aggregated neighbor entity vectors of E1 and E2 respectively. The formula is as follows: Wherein, the subscript k takes the value of 1 or 2; Represents the initialization entity vector The aggregated neighbor entity representation vector at layer l, Represents the initialization entity vector The set of neighbor entities of Represents the initialization entity vector and neighbor entities At the lth layer, the attention weight is calculated as follows: Where, subscript j = 1, 2, ..., n, w = 1, 2, ..., n, Represents the initialization entity vector Aggregate neighbor entity representation vector at level l; represents the learnable attention mechanism weight vector; W g represents a learnable weight matrix used to transform the entity representation vector to a new space; Represents the initialization entity vector The aggregated neighbor entity representation vector at the l-1 layer; LeakyReLU represents the LeakyReLU activation function, which is used to calculate the nonlinear transformation in the attention weight; exp is the exponential function, which is used to calculate the normalization of the attention weight; Represents a vector connection operation, which connects the entity and neighbor entities Connect together; The aggregated neighbor entity representation vector of the lth layer is normalized, and the vector aggregation and splicing are performed based on the residual connection. The calculation formula is as follows: Among them, ||·||2 represents the two-norm, Represents the entity vector after aggregation and splicing, range is the residual connection range of multi-head attention, and Concatenate represents the vector aggregation and splicing function; Next, we apply a multi-head attention mechanism to the aggregated entity vector to integrate the information of all layers and obtain the entity neighbor view. and The calculation formula is as follows: in, The subscript k is 1 or 2, indicating the entity neighbor view of the original knowledge graph G1 Or the entity neighbor view of the original knowledge graph G2 MultiHead represents the core operation of the multi-head attention mechanism; Step 23, for the initialization relationship vectors R1 and R2 and the entity relationship adjacency matrices rel_adj1 and rel_adj2, first sum the entity relationship adjacency matrices, then multiply them with the initialization relationship vectors and normalize them to obtain the relationship view and The calculation formula is as follows: in, represents the sum of the rth row of the entity relationship adjacency matrix, represents the rth initialization relationship vector, It means that the sum of the rth row of the adjacency matrix is ​​matrix multiplied with the rth initialized relationship vector; Step 24: for the initialization attribute vectors A1 and A2 and the entity attribute adjacency matrices attr_adj1 and attr_adj2, first sum the entity attribute adjacency matrices, then multiply them with the initialization attribute vectors and normalize them to obtain the attribute view and The calculation formula is as follows: in, represents the sum of the rth row of the entity attribute adjacency matrix, represents the rth initialization attribute vector, It means that the sum of the rth row of the adjacency matrix is ​​matrix multiplied with the rth initialized attribute vector; Step 25: For the initialization attribute value vectors V1 and V2 and the entity attribute value adjacency matrices val_adj1 and val_adj2, first sum the entity attribute value adjacency matrices, then multiply them with the initialization attribute value vectors and normalize them to obtain the final attribute value view. and The calculation formula is as follows: in, represents the sum of the rth row of the adjacency matrix of the entity attribute value, represents the rth initialized attribute value vector, It represents the matrix multiplication of the sum of the r-th row of the adjacency matrix and the r-th initialized attribute value vector.

5. According to claim 4, the entity alignment method for heterogeneous knowledge graphs based on multi-view and graph enhancement is characterized in that: The step 3 specifically includes: Step 31, for the attribute view and and the property value view and Fusion into attribute-attribute value vectors through highway gates and The calculation formula is as follows: in, represents the attribute view, W q is the weight matrix, b q represents the bias vector, σ represents the sigmoid function, which limits the value between 0 and 1, and ⊙ represents the Hadamard product; Step 32, for the attribute-attribute value vector and Properties View and and the property value view and Fusion into attribute-attribute value view through multi-head attention mechanism and The calculation formula is as follows:

6. The heterogeneous knowledge graph entity alignment method based on multi-view and graph enhancement according to claim 5 is characterized in that: The step 4 specifically includes: For entity view and Relationship View and and the attribute-attribute value view and Using the vector concatenation method, each view is integrated to obtain the entity fusion embedding representation of the original knowledge graph. and The calculation formula is as follows: Among them, Concat represents the vector concatenation method.

7. The heterogeneous knowledge graph entity alignment method based on multi-view and graph enhancement according to claim 6 is characterized in that: The step 5 specifically includes: Step 51: Randomly delete relations and attributes from the original knowledge graphs G1 and G2. The deletion decision is to determine whether an entity has two or more neighbor entities or attribute values, thereby obtaining an enhanced knowledge graph. and Step 52: Enhanced knowledge graph and Perform the same process as steps 2 to 4 to obtain the entity fusion embedding representation of the enhanced knowledge graph and 8. The heterogeneous knowledge graph entity alignment method based on multi-view and graph enhancement according to claim 7 is characterized in that: The step 6 specifically includes: Step 61: Entity fusion embedding representation for enhanced knowledge graph and Calculate the alignment loss based on margin distance The calculation formula is as follows: Among them, (e i ,e j )∈S represents a positively aligned entity pair; represents the negative sample pairs constructed from the positive aligned entity pairs; ρ is a hyperparameter; [·] + It is a corrective operation; Step 62: Enhance the knowledge graph and Entity fusion embedding representation of original knowledge graphs G1 and G2 and enhanced knowledge graphs and And knowledge graph entity fusion embedding representation and Calculation of contrast loss based on interference rejection The calculation formula is as follows: Among them, E z ={G1,G2} represents all entities in the original knowledge graphs G1 and G2, e i ∈E z Indicates E z An entity in , symmetric contrast loss The calculation formula is as follows: Symmetric contrast loss The calculation formula is as follows: in, is the i-th embedding representation of the knowledge graph entity fusion embedding representation, The fusion embedding representation of heterogeneous knowledge graph entities is the i-th embedding representation, Heterogeneous knowledge graph entity fusion embedding represents the oth embedding representation, proj is a projection function, which contains a linear transformation and an activation function, used to map a high-dimensional vector to a low-dimensional space; <·> represents the inner product operation, that is, the dot product of two vectors; Step 63, calculate the total loss The calculation formula is as follows: Among them, λ is a hyperparameter used to balance the marginal alignment loss and contrast loss The weight of Perform iterative optimization training to finally obtain a trained heterogeneous knowledge graph entity alignment model; Step 64: fuse the embedding representations of any two entities and The trained heterogeneous knowledge graph entity alignment model calculates the distance. The calculation formula is as follows: in, Represents the entity fusion embedding representation in the original knowledge graph G1 The i-th vector; Represents the entity fusion embedding representation in the original knowledge graph G2 The jth vector; e opt is an entity node in the original knowledge graph G2, indicating the entity closest to the i-th entity in the original knowledge graph G1; d opt Yes opt The distance corresponding to the i-th entity in the original knowledge graph G1 will be compared with the threshold parameter ε to determine whether the corresponding two entities are an aligned entity pair.

Citation Information

Patent Citations

  • Knowledge graph fusion method based on entity alignment

    CN110941722A

  • Heterogeneous knowledge graph fusion method and system

    CN114090783A