Entity alignment method and system based on global information aggregation

By adopting global information aggregation and graph diffusion enhancement technology in the entity alignment method, the problems of over-smoothing and insufficient utilization of semantic information in the entity alignment task in the knowledge graph are solved, and the accuracy and robustness of entity alignment are improved.

CN118586392APending Publication Date: 2024-09-03SHANDONG EVAYINFO TECH CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410716304.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-09-03

Smart Images

  • Figure CN118586392A
    Figure CN118586392A
Patent Text Reader

Abstract

The invention belongs to the technical field of natural language processing, and provides an entity alignment method and system based on global information aggregation, the relative importance of each entity in a triple in a whole knowledge graph can be calculated based on a PageRank algorithm, and the information of the whole knowledge graph can be better utilized. Meanwhile, a Personalized PageRank is adopted to carry out graph diffusion enhancement, an enhanced global view is generated, and the enhanced global view is used in an entity alignment task. Meanwhile, the graph diffusion enhancement and the random disturbance enhancement are compared through comparative learning, global information in a graph diffusion enhancement view and local information in a random disturbance view can be learned at the same time through a comparative learning mode, the accuracy and robustness of entity alignment are improved from the perspective of optimizing graph representation, and a good effect is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of natural language processing, and in particular relates to an entity alignment method and system based on global information aggregation. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] With the rapid development of information technology, knowledge graphs have been widely used as a structured tool for organizing and representing a large number of real-world facts. In knowledge graphs, facts are usually represented in the form of relationship triples (head entity, relationship, tail entity) or attribute triples (entity, attribute, value). However, since the construction of knowledge graphs often depends on different people, organizations, data sources and even languages, many knowledge graphs are often incomplete. This incompleteness limits the ability of a single knowledge graph to meet downstream application requirements. However, different knowledge graphs are usually complementary, so it is an urgent need to integrate knowledge from heterogeneous knowledge graphs.

[0004] Entity alignment, as a basic task in the process of knowledge graph fusion, aims to identify equivalent entities from different knowledge graphs. In recent years, embedding-based entity alignment methods have attracted widespread attention from researchers due to their good performance. These methods usually generate low-dimensional embedding representations for entities through knowledge graph encoders, and use known aligned entity pairs (i.e., seed entity pairs) to measure the similarity between unaligned entities, thereby achieving entity recognition and alignment.

[0005] Traditional embedding-based methods have been widely studied. Traditional models only focus on the information in the triples and ignore the information contained in the neighbor structure. Graph Convolutional Networks (GCN) generalize the convolution operation of traditional data to non-Euclidean data structures. The basic idea of ​​GCN is to enhance the self-representation of nodes by using neighbor information. GCN has strong structural learning capabilities, so most mainstream methods now use GCN to generate embedding representations of corresponding entities. Some existing work is to build better optimized alignment modules by optimizing alignment strategies or adding additional information. There are also some works that introduce other auxiliary information of entities to improve entity alignment, such as entity names, attributes or text descriptions.

[0006] At present, most entity alignment tasks generate embeddings that only rely on local neighborhood information of GCN aggregated knowledge graphs or utilize additional information or alignment strategies, but these methods have the following problems:

[0007] Most of them now rely on graph structure learning methods such as GCN. As the number of layers increases, each node aggregates information from a wider neighborhood, resulting in a decrease in the representation differences between different nodes, which in turn causes the problem of over-smoothing. Over-smoothing is particularly important in the entity alignment task because the task aims to distinguish and identify the same or similar entities across different knowledge graphs. If the entity representations are too smooth, that is, the distinction between them is too low, the model will find it difficult to perform this task effectively. Most current methods either cannot handle structured data well or lack the use of rich semantic information.

[0008] There are currently methods to add additional information or find reliable entity pairs in misaligned entities to help entity alignment, but the reliability and stability of these methods cannot be fully guaranteed. Summary of the invention

[0009] In order to solve the above problems, the present invention proposes an entity alignment method and system based on global information aggregation. The present invention is an entity alignment model that optimizes entity representation by aggregating global structural information. First, a global information encoder that aggregates the global information of the graph is constructed, and a graph attention network (GAT) is used to capture neighborhood structural information; in order to aggregate global information while minimizing over-smoothing, a PageRank-based method is used to create a global feature matrix. The matrix aggregates the global importance of entities and the semantic information of relationships in the knowledge graph. Recognizing the inherent asymmetry of entity relationships, the model of the present invention combines directional relationship information. In addition, the application of graph diffusion in entity alignment is explored, so that semantically rich graph diffusion enhancement is generated through the propagation and merging of global information in the knowledge graph. By comparing the graph diffusion perspective with the structural perturbation perspective, the structural diversity of the knowledge graph is further amplified, enabling entities to construct representations that embody global and local semantics.

[0010] According to some embodiments, a first solution of the present invention provides an entity alignment method based on global information aggregation, which adopts the following technical solution:

[0011] A method for entity alignment based on global information aggregation, comprising:

[0012] Obtain any two different knowledge graphs, namely, a first knowledge graph and a second knowledge graph;

[0013] Based on the pre-trained entity alignment network model, the two acquired knowledge graphs are aligned;

[0014] The entity alignment of the two acquired knowledge graphs based on the pre-trained entity alignment network model includes:

[0015] Based on the sizes of the two knowledge graphs, generate initial embeddings of knowledge graph entities and relationships, i.e., the first knowledge graph initial embedding and the second knowledge graph initial embedding;

[0016] Convert the relationship triplets of the two knowledge graphs into adjacency matrices, namely, the first adjacency matrix and the second adjacency matrix respectively;

[0017] Perform graph diffusion based on the first adjacency matrix and the second adjacency matrix, and combine the generated graph diffusion matrix with the initialization embedding of the two knowledge graphs to obtain the corresponding graph diffusion enhanced graph;

[0018] Based on the two knowledge graphs, we filter entities according to the number of edges directly connected to them and obtain the corresponding structural perturbation enhancement graph.

[0019] The encoder is used to embed the domain information, relationship direction and global features of the two knowledge graphs into the corresponding graph diffusion enhanced graph and structure perturbation enhanced graph, respectively, to obtain the corresponding graph diffusion enhanced embedding vector and graph perturbation enhanced embedding vector;

[0020] The alignment relationship between two entities is determined based on the Euclidean distance between the graph diffusion enhanced embedding vectors and the graph perturbation enhanced embedding vectors of the two knowledge graphs, and finally the entity alignment result is obtained.

[0021] According to some embodiments, a second solution of the present invention provides an entity alignment system based on global information aggregation, which adopts the following technical solution:

[0022] An entity alignment system based on global information aggregation, comprising:

[0023] A knowledge graph acquisition module is configured to acquire any two different knowledge graphs, namely, a first knowledge graph and a second knowledge graph;

[0024] An entity alignment module is configured to perform entity alignment on the two acquired knowledge graphs based on a pre-trained entity alignment network model;

[0025] The entity alignment of the two acquired knowledge graphs based on the pre-trained entity alignment network model includes:

[0026] Based on the sizes of the two knowledge graphs, generate initial embeddings of knowledge graph entities and relationships, i.e., the first knowledge graph initial embedding and the second knowledge graph initial embedding;

[0027] Convert the relationship triplets of the two knowledge graphs into adjacency matrices, namely, the first adjacency matrix and the second adjacency matrix respectively;

[0028] Perform graph diffusion based on the first adjacency matrix and the second adjacency matrix, and combine the generated graph diffusion matrix with the initialization embedding of the two knowledge graphs to obtain the corresponding graph diffusion enhanced graph;

[0029] Based on the two knowledge graphs, we filter entities according to the number of edges directly connected to them and obtain the corresponding structural perturbation enhancement graph.

[0030] The encoder is used to embed the domain information, relationship direction and global features of the two knowledge graphs into the corresponding graph diffusion enhanced graph and structure perturbation enhanced graph, respectively, to obtain the corresponding graph diffusion enhanced embedding vector and graph perturbation enhanced embedding vector;

[0031] The alignment relationship between two entities is determined based on the Euclidean distance between the graph diffusion enhanced embedding vectors and the graph perturbation enhanced embedding vectors of the two knowledge graphs, and finally the entity alignment result is obtained.

[0032] The graph diffusion is performed based on the first adjacency matrix and the second adjacency matrix, and the generated graph diffusion matrix is ​​combined with the initialization embedding of the two knowledge graphs to obtain the corresponding graph diffusion enhanced graph, which is specifically:

[0033] Based on the first adjacency matrix and the second adjacency matrix, PersonalizedPageRank is used to perform graph diffusion to form a dense diffusion matrix, namely the first diffusion matrix and the second diffusion matrix;

[0034] The first diffusion matrix and the second diffusion matrix are respectively combined with the first knowledge graph initialization embedding and the second knowledge graph initialization embedding to obtain the first graph diffusion enhancement graph and the second graph diffusion enhancement graph.

[0035] Furthermore, based on the two knowledge graphs, the corresponding structural perturbation enhancement graph is obtained by screening according to the number of edges directly connected to the entities, specifically:

[0036] Based on the two knowledge graphs, traverse all triples of the knowledge graphs;

[0037] Filter the entities in the triple according to the number of edges directly connected to them, retain the entities with a number less than 2, and obtain the filtered triples;

[0038] A processed knowledge graph is obtained based on the remaining triple relations and entities after screening, and a new adjacency matrix is ​​converted based on the relation triplets in the processed knowledge graph;

[0039] The new adjacency matrix is ​​combined with the initialized embedding of the knowledge graph to construct a structure perturbation enhanced graph, and the first structure perturbation enhanced graph and the second structure perturbation enhanced graph are obtained.

[0040] Furthermore, the encoder is used to embed the domain information, relationship direction and global features of the two knowledge graphs into the corresponding graph diffusion enhanced graph and the structure perturbation enhanced graph, respectively, to obtain the corresponding graph diffusion enhanced embedding vector and the graph perturbation enhanced embedding vector, specifically:

[0041] Based on the graph diffusion enhancement graph and the structure perturbation enhancement graph in the two knowledge graphs, the PageRank algorithm is used to aggregate global information and perform feature transformation to obtain the corresponding global embedding vector;

[0042] Connect the relationship direction information of the graph diffusion enhancement graph and the structure perturbation enhancement graph of the two knowledge graphs to obtain the corresponding direction embedding vector;

[0043] The graph attention network is used to convolve the two graph diffusion enhancement graphs with the corresponding knowledge graph adjacency matrix to obtain the corresponding graph diffusion convolution embedding vectors;

[0044] The graph attention network is used to convolve the two knowledge graph initialization embeddings with the corresponding structure perturbation enhancement graph to obtain the corresponding graph perturbation convolution embedding vectors;

[0045] The two global embedding vectors, the two directional embedding vectors and the two graph diffusion convolution embedding vectors are used to obtain the corresponding graph diffusion enhanced embedding vector, and the two global embedding vectors, the two directional embedding vectors and the two graph perturbation convolution embedding vectors are used to obtain the corresponding graph perturbation enhanced embedding vector.

[0046] Furthermore, the relationship direction information of the graph diffusion enhancement graph and the structure perturbation enhancement graph of the two knowledge graphs are connected to obtain the corresponding direction embedding vector, specifically:

[0047] Obtain the relational adjacency matrices of the two graph diffusion enhanced graphs and the two structure perturbation enhanced graphs respectively;

[0048] The forward and reverse relations of the four relation adjacency matrices are collected using the mean aggregator;

[0049] The forward relationship set and the reverse relationship set of the relationship adjacency matrix are concatenated to obtain the corresponding directional embedding vector.

[0050] Furthermore, based on the graph diffusion enhancement graph and the structure perturbation enhancement graph in the two knowledge graphs, the PageRank algorithm is used to aggregate global information and perform feature transformation to obtain the corresponding global embedding vector, specifically:

[0051] The PageRank-based method is used to calculate the relative importance of each entity in the triples of the graph diffusion enhancement graph and the structure perturbation enhancement graph in the two knowledge graphs in the entire knowledge graph, and obtain the entity importance weight;

[0052] Calculate the PageRank score of each entity in the triple relative to the entire encoder, use the PageRank score of the entity related to the triple to weight the relationship frequency, and obtain the relationship probability matrix;

[0053] Multiply the entity importance weights and the relationship probability matrix to obtain the feature matrices of the graph diffusion enhanced graph and the structure perturbation enhanced graph in the two knowledge graphs, that is, the global embedding vectors corresponding to the two knowledge graphs.

[0054] According to some embodiments, a third aspect of the present invention provides a computer-readable storage medium.

[0055] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in the entity alignment method based on global information aggregation as described in the first aspect above.

[0056] According to some embodiments, a fourth aspect of the present invention provides a computer device.

[0057] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the entity alignment method based on global information aggregation as described in the first aspect above are implemented.

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

[0059] The PageRank-based algorithm of the present invention can calculate the relative importance of each entity in the triple in the entire knowledge graph, which will make better use of the information of the entire knowledge graph. At the same time, Personalized PageRank is used to perform graph diffusion enhancement, generate an enhanced global view, and use it in the entity alignment task. At the same time, by contrastive learning to compare graph diffusion enhancement and random perturbation enhancement, the model of the present invention can simultaneously learn the global information in the graph diffusion enhancement view and the local information in the random perturbation view by contrastive learning. From the perspective of optimizing graph representation, the accuracy and robustness of entity alignment are improved and better results are achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0061] Figure 1 is a flow chart of an entity alignment method based on global information aggregation in an embodiment of the present invention;

[0062] Figure 2It is a model architecture diagram of an entity alignment method based on global information aggregation in an embodiment of the present invention;

[0063] Figure 3 This is a diagram of the Encoder architecture in an embodiment of the present invention;

[0064] Figure 4 is a global relationship feature matrix diagram in an embodiment of the present invention. DETAILED DESCRIPTION

[0065] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0066] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0067] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0068] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0069] Embodiment 1

[0070] like Figure 1 As shown, this embodiment provides an entity alignment method based on global information aggregation. This embodiment uses the method applied to a server as an example for illustration. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network servers, cloud communications, middleware services, domain name services, security services CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. In this embodiment, the method includes the following steps:

[0071] Obtain any two different knowledge graphs, namely, a first knowledge graph and a second knowledge graph;

[0072] Based on the pre-trained entity alignment network model, the two acquired knowledge graphs are aligned;

[0073] The entity alignment of the two acquired knowledge graphs based on the pre-trained entity alignment network model includes:

[0074] Based on the sizes of the two knowledge graphs, generate initial embeddings of knowledge graph entities and relationships, i.e., the first knowledge graph initial embedding and the second knowledge graph initial embedding;

[0075] Convert the relation triplets of the two knowledge graphs into adjacency matrices, namely, the first adjacency matrix and the second adjacency matrix respectively;

[0076] Perform graph diffusion based on the first adjacency matrix and the second adjacency matrix, and combine the generated graph diffusion matrix with the initialization embedding of the two knowledge graphs to obtain the corresponding graph diffusion enhanced graph;

[0077] Based on the two knowledge graphs, we filter entities according to the number of edges directly connected to them and obtain the corresponding structural perturbation enhancement graph.

[0078] The encoder is used to embed the domain information, relationship direction and global features of the two knowledge graphs into the corresponding graph diffusion enhanced graph and structure perturbation enhanced graph, respectively, to obtain the corresponding graph diffusion enhanced embedding vector and graph perturbation enhanced embedding vector;

[0079] The alignment relationship between two entities is determined based on the Euclidean distance between the graph diffusion enhanced embedding vectors and the graph perturbation enhanced embedding vectors of the two knowledge graphs, and finally the entity alignment result is obtained.

[0080] Based on the two knowledge graphs, the corresponding structural perturbation enhancement graph is obtained by screening according to the number of edges directly connected to the entities, which is specifically:

[0081] Based on the two knowledge graphs, traverse all triples of the knowledge graphs;

[0082] Filter the entities in the triple according to the number of edges directly connected to them, retain the entities with a number less than 2, and obtain the filtered triples;

[0083] A processed knowledge graph is obtained based on the remaining triple relations and entities after screening, and a new adjacency matrix is ​​converted based on the relation triplets in the processed knowledge graph;

[0084] The new adjacency matrix is ​​combined with the initialized embedding of the knowledge graph to construct a structure perturbation enhanced graph, and the first structure perturbation enhanced graph and the second structure perturbation enhanced graph are obtained.

[0085] Specifically, the encoder is used to embed the domain information, relationship direction and global features of the two knowledge graphs into the corresponding graph diffusion enhanced graph and the structure perturbation enhanced graph, respectively, to obtain the corresponding graph diffusion enhanced embedding vector and the graph perturbation enhanced embedding vector, specifically:

[0086] Based on the graph diffusion enhancement graph and the structure perturbation enhancement graph in the two knowledge graphs, the PageRank algorithm is used to aggregate global information and perform feature transformation to obtain the corresponding global embedding vector;

[0087] Connect the relationship direction information of the graph diffusion enhancement graph and the structure perturbation enhancement graph of the two knowledge graphs to obtain the corresponding direction embedding vector;

[0088] The graph attention network is used to convolve the two graph diffusion enhancement graphs with the corresponding knowledge graph adjacency matrix to obtain the corresponding graph diffusion convolution embedding vectors;

[0089] The graph attention network is used to convolve the two knowledge graph initialization embeddings with the corresponding structure perturbation enhancement graph to obtain the corresponding graph perturbation convolution embedding vectors.

[0090] The two global embedding vectors, the two directional embedding vectors and the two graph diffusion convolution embedding vectors are used to obtain the corresponding graph diffusion enhanced embedding vector, and the two global embedding vectors, the two directional embedding vectors and the two graph perturbation convolution embedding vectors are used to obtain the corresponding graph perturbation enhanced embedding vector.

[0091] The relationship direction information of the graph diffusion enhancement graph and the structure perturbation enhancement graph of the two knowledge graphs are connected to obtain the corresponding direction embedding vector, specifically:

[0092] Obtain the relational adjacency matrices of the two graph diffusion enhanced graphs and the two structure perturbation enhanced graphs respectively;

[0093] The forward and reverse relations of the four relation adjacency matrices are collected using the mean aggregator;

[0094] The forward relationship set and the reverse relationship set of the relationship adjacency matrix are concatenated to obtain the corresponding directional embedding vector.

[0095] Based on the graph diffusion enhancement graph and the structure perturbation enhancement graph in the two knowledge graphs, the PageRank algorithm is used to aggregate global information and perform feature transformation to obtain the corresponding global embedding vector, specifically:

[0096] The PageRank-based method is used to calculate the relative importance of each entity in the triples of the graph diffusion enhancement graph and the structure perturbation enhancement graph in the two knowledge graphs in the entire knowledge graph, and obtain the entity importance weight;

[0097] Calculate the PageRank score of each entity in the triple relative to the entire encoder, use the PageRank score of the entity related to the triple to weight the relationship frequency, and obtain the relationship probability matrix;

[0098] Multiply the entity importance weights and the relationship probability matrix to obtain the feature matrices of the graph diffusion enhanced graph and the structure perturbation enhanced graph in the two knowledge graphs, that is, the global embedding vectors corresponding to the two knowledge graphs.

[0099] The method proposed in this embodiment, during the training phase, specifically includes:

[0100] Step 1: First, collect two knowledge graphs G1 and G2 that need to be aligned, including relationship triples and entity pairs S = {(e1, e2)∈E1×E2|e1≡e2} pre-aligned between the two knowledge graphs, where e1 and e2 are pre-aligned entity pairs in the first knowledge graph and the second knowledge graph, respectively.

[0101] Step 2: Construct a data set based on the information collected in step 1, and divide the supervised data into training set, validation set, and test set according to the ratio of 20%:10%:70%.

[0102] Step 3: If Figure 2 As shown, the graph enhancement module inputs two graphs into the graph enhancement module for graph enhancement. This embodiment pays special attention to how to effectively use graph enhancement technology to promote the application of graph contrast learning in entity alignment tasks. To this end, two specific graph enhancement strategies are adopted, one is graph diffusion enhancement and the other is structural perturbation enhancement. Graph diffusion enhancement measures the similarity between any two entities from the perspective of global probability transfer through graph propagation, and injects high-order topological information into graph adjacency to produce an enhanced global view. Through graph diffusion enhancement, the transfer of information in KG can be promoted, thereby enhancing the global context representation of entities.

[0103] Based on the size of the knowledge graph, generate initial embeddings of knowledge graph entities and relationships, i.e., initial embeddings of the first knowledge graph G1 and initial embeddings of the second knowledge graph G2;

[0104] Convert the relation triplets of the knowledge graph into adjacency matrices, namely the first adjacency matrix A1 and the second adjacency matrix A2;

[0105] For the process of graph diffusion enhancement, such as Figure 3 As shown in the figure, based on the adjacency matrix corresponding to the knowledge graph, PersonalizedPageRank is used to perform graph diffusion:

[0106] S = α(I-(1-α)D -1 / 2 AD-1 / 2 ) -1 (1);

[0107] Among them, A is the adjacency matrix, I is the identity matrix, D is the degree matrix, and α∈(0,1) is the adjustable parameter of the random walk teleportation probability.

[0108] Graph diffusion is to diffuse the adjacency matrix formed by the graph using the algorithm to form a dense diffusion matrix, namely the first diffusion matrix S1 and the second diffusion matrix S2.

[0109] The first diffusion matrix S1 and the second diffusion matrix S2 are respectively combined with the first knowledge graph G1 initialization embedding and the second knowledge graph G2 initialization embedding to obtain the first graph diffusion enhancement graph And the second figure diffusion enhancement figure

[0110] After KG is enhanced by graph diffusion, a dense diffusion matrix will be generated, which represents the similarity between any two node pairs. In order to ultimately enhance the sparsity of the graph, a threshold E is set after diffusion, that is, elements below E are set to zero. Finally, the generated graph diffusion matrix is ​​combined with the embedding of the graph spectrum to obtain a graph diffusion enhanced graph for entity alignment. Graph diffusion is to diffuse the adjacency matrix formed by the graph spectrum using this algorithm to form a dense diffusion matrix, which is then combined with the initial embedding of the graph spectrum to form an embedding containing global information.

[0111] Unlike other methods that directly replace the original adjacency matrix with a graph diffusion matrix, this embodiment combines the generated graph diffusion matrix with the graph initialization embedding, and uses the diffusion matrix to transform the embedding, which is actually using the topological structure of the graph to optimize the embedding. This not only preserves the information in the original embedding, but also introduces information about distant neighbor nodes through graph diffusion, thereby enhancing the representation ability of node embedding. This is particularly effective for capturing complex relationships and dependencies between nodes. On the contrary, if only the graph diffusion matrix is ​​used as an enhanced graph, the information of the entity itself will be lost, resulting in excessive smoothing of the graph.

[0112] The process of structural disturbance enhancement is as follows:

[0113] Based on the training set, traverse all triples of the knowledge graph;

[0114] Filter the entities in the triple according to the number of edges directly connected to them, retain the entities with a number less than 2, and obtain the filtered triples;

[0115] A processed knowledge graph is obtained based on the remaining triple relations and entities after screening, and a new adjacency matrix is ​​converted based on the relation triplets in the processed knowledge graph;

[0116] Combine the new adjacency matrix with the initial embedding of the knowledge graph to construct a structural perturbation enhancement graph and obtain the first structural perturbation enhancement graph and the second structural perturbation enhancement diagram

[0117] That is to say, all the triplets in the graph are traversed, and a certain proportion of the triplets are randomly deleted. In addition to giving an initial value for this proportion p, the subsequent p is randomly generated, and the p of the two graphs is random respectively; the degree of the head and tail entities in the selected triples must be greater than 2 to prevent isolated nodes from being generated after deletion. The degree refers to the number of edges directly connected to the entity; entities with node degrees less than 2 are retained during the random deletion process. By randomly deleting triplets in the knowledge graph, the situation of information loss can be simulated, thereby encouraging the model to learn a more robust local structure representation. Then the remaining triplets are reconstructed into a new adjacency matrix and relationship adjacency matrix, and the newly constructed adjacency matrix is ​​combined with the initialization embedding mentioned above to form an enhanced graph of structural perturbations.

[0118] Step 4: Graphs G1 and G2 are enhanced to obtain and Input into Encoder to get the embedding of the graph. Figure 2 The embedding module in Figure 3 demonstrates the proposed KG encoder, which integrates multiple structural contexts to generate embeddings that incorporate global information from the knowledge graph.

[0119] Diffusion enhancement of the first image and the first structural perturbation enhancement diagram Second picture diffusion enhancement picture and the second knowledge graph Input them into KG Encoder for embedding to get the entity embedding;

[0120] The KG Encoder is divided into three parts, generating embeddings containing three structural contexts for each augmented graph, and finally connecting the three together:

[0121] First, the enhanced graph obtained in step 3 is passed through the graph attention network to aggregate the neighborhood information of the entity. This method is based on the structural assumption that equivalent entities often have similar neighborhood structures in different knowledge graphs. To achieve this goal, a graph attention network (GAT) is used to aggregate this neighborhood information.

[0122] Specifically, the hidden layer h iIt can be obtained by aggregating the information of the one-hop neighbors of the central entity. GAT learns the importance of different neighbors of the central entity through the attention mechanism, which allows the model to weight each neighbor according to its importance when aggregating neighborhood information. By stacking multiple layers of GAT, it is possible to capture and integrate the information of neighbors in different ranges, thereby obtaining a wider neighborhood context:

[0123]

[0124] Among them, a ij is the surrounding entity e j For the central entity e i The importance of is calculated by self-attention:

[0125]

[0126] Among them, || represents the concatenation operation, a and W represent shared learnable parameters, and h i and h j Represents entity e i and entity e j The embedding represents the embedding of the lth layer that incorporates neighborhood information, represents the embedding of the l-1th layer that incorporates the neighborhood information. Finally, the above operation generates the embedding h of the graph containing the neighborhood context n ;

[0127] Next, in the encoding, not only the relation information is considered, but also the reverse relation is added to the KG to capture rich relational semantic information through relational direction information. The relational adjacency matrix of the enhanced graph obtained in step 3 is directly used to collect the positive and reverse relations in the relational adjacency matrix using two mean aggregators to provide supplementary alignment signals for heterogeneous knowledge graphs:

[0128]

[0129] in, It is entity e i Positive relationship set, It is entity e i Finally, the above operations generate the embedding h containing the relationship direction information of the graph. r ;

[0130] Then, when processing KG relationship triples, the triple information is converted into a feature matrix. In order to make full use of the information of the entire graph, the global information of KG is incorporated into the construction of the feature matrix. A PageRank-based method is proposed to calculate the relative importance of each entity in the triple in the entire knowledge graph, and to integrate the global information of KG. When processing relationship triple information, the frequency of occurrence of each relationship is calculated to evaluate the importance of the relationship. Next, the PageRank score of each entity in the triple relative to the entire KG is calculated and used as an indicator of the global importance of the entity. In this way, the characteristics of each entity now include its relationship importance and its relative importance score in the entire graph. The implementation of the PageRank method is based on its classic formula, and its basic form is:

[0131]

[0132] Among them, PR(u) is the PageRank score of node u, d is the damping factor, which indicates the probability of the random walk continuing to randomly jump to the next node along the outgoing link of the current graph at each step, and B u is the set of in-degrees of node u, and L(v) is the number of out-degrees of node v. For each triple in KG The relationship frequencies are weighted using the PageRank scores of the entities associated with the triples. This weighting method means that in the feature matrix, relationships associated with important entities (i.e. entities with high PageRank scores) are given greater weights. Therefore, when using this feature matrix to train an entity alignment model, the model can not only consider the direct relationships between entities, but also take advantage of the relative position and importance of the entities in the entire knowledge graph. In this way, a feature vector containing the most important relationship frequency and global importance score is generated for each entity. The above operations can be used to obtain the embedding h of the graph containing global features. g ;

[0133] Finally, after capturing the context of the entity based on the neighborhood structure, relationship direction, and global semantic information, we concatenate the three as the final output representation h of the KG Encoder:

[0134] h=h n +h r +h g (6).

[0135] Specifically, GAT is used to aggregate neighborhood information around entities. The relation triples in the knowledge graph are converted into a relation feature matrix, and the knowledge graph embedding is enhanced by integrating additional global information into the constructed relation feature matrix using our proposed PageRank-based method, as Figure 4As shown. In addition, both the relations and their inverse relations in the knowledge graph are considered to collect rich semantic information about the relations. This enables the encoder of this embodiment to not only capture the local structural features of the entities, but also synthesize the global importance of the entities and the semantic information of the relations, thereby providing a rich and expressive embedding representation for the entity alignment task. Through this step, the encoder is able to capture not only the local structural features of the entities, but also synthesize the global importance of the entities and the semantics of the relations, thereby providing an informative and expressive embedding representation for the entity alignment task.

[0136] Step 5: After embedding in step 4, we get and After that, the two are compared and learned separately to obtain the contrast loss like Figure 2 As shown in Figure 2. Using the cross entropy loss function to compare different views of the same graph can help the model improve the accuracy and robustness of entity alignment. By maximizing the consistency of global (graph diffusion view) and local (random perturbation view) structural representations, the model can simultaneously learn the global structural information and local feature information of the knowledge graph, thereby enhancing the representation of the knowledge graph.

[0137] Step 6: Negative sampling is performed using the pre-aligned entity pair S given in step 1. This patent constructs a negative sample set by destroying the aligned entity pair, keeping one entity in S unchanged, and using the nearest neighbor algorithm in another graph to find the entity most similar to the aligned entity for replacement. Repeat this operation to obtain a negative sample set S′.

[0138] Step 7: In order to make full use of the local information of the knowledge graph in the entity alignment process and prevent the model from overfitting, this patent chooses to embed the embedding vector obtained in step 4 and As the embedding for entity alignment. During the training process, the aligned entity pair set S obtained in step 1 is used as the positive sample and the negative sample set S′ obtained in step 6. In order to optimize the alignment performance of the model, this patent adopts a margin-based alignment loss Its goal is to minimize the embedding distance of positive samples while maximizing the embedding distance of negative samples.

[0139] The specific formula for this loss is:

[0140]

[0141] where λ is a margin hyperparameter, [x] + = max{0,x} ensures that the output is non-negative, S is the pre-aligned entity pair, S′ is the set of negative samples generated by the truncated negative sampling strategy, ||·|| L2 represents the L2 distance.

[0142] Step 8: Alignment loss and contrast loss Perform joint optimization to obtain a trained entity alignment model.

[0143] Step 9: Figure 2 As shown, the alignment module uses the Euclidean distance to determine the alignment relationship between two entities, calculates the alignment relationship between each entity in G1 and G2 according to the nearest neighbor algorithm, and finally obtains the entity alignment result.

[0144] After performing graph augmentation on two KGs and obtaining entity representations through embedding methods, the alignment relationship of entities in the two KGs can be inferred by measuring the distance between the entities.

[0145] In this work, Euclidean distance is used as the metric. Specifically, to find the entity e in G1 i Align entities with e, traverse all entities in G2, and use the nearest neighbor algorithm to search for entities that are aligned with e i The nearest entity e j ,Right now:

[0146]

[0147] in is the entity e in the first knowledge graph G1 i The embedding is the embedding of the entity in G2;

[0148] In this way, a best-matching alignment entity can be found for each entity in ej, thereby constructing an alignment relationship between the two knowledge graphs.

[0149] Embodiment 2

[0150] This embodiment provides an entity alignment system based on global information aggregation, including:

[0151] A knowledge graph acquisition module is configured to acquire any two different knowledge graphs, namely, a first knowledge graph and a second knowledge graph;

[0152] An entity alignment module is configured to perform entity alignment on the two acquired knowledge graphs based on a pre-trained entity alignment network model;

[0153] The entity alignment of the two acquired knowledge graphs based on the pre-trained entity alignment network model includes:

[0154] Based on the sizes of the two knowledge graphs, generate initial embeddings of knowledge graph entities and relationships, i.e., the first knowledge graph initial embedding and the second knowledge graph initial embedding;

[0155] Convert the relationship triplets of the two knowledge graphs into adjacency matrices, namely, the first adjacency matrix and the second adjacency matrix respectively;

[0156] Perform graph diffusion based on the first adjacency matrix and the second adjacency matrix, and combine the generated graph diffusion matrix with the initialization embedding of the two knowledge graphs to obtain the corresponding graph diffusion enhanced graph;

[0157] Based on the two knowledge graphs, we filter entities according to the number of edges directly connected to them and obtain the corresponding structural perturbation enhancement graph.

[0158] The encoder is used to embed the domain information, relationship direction and global features of the two knowledge graphs into the corresponding graph diffusion enhanced graph and structure perturbation enhanced graph, respectively, to obtain the corresponding graph diffusion enhanced embedding vector and graph perturbation enhanced embedding vector;

[0159] The alignment relationship between two entities is determined based on the Euclidean distance between the graph diffusion enhanced embedding vectors and the graph perturbation enhanced embedding vectors of the two knowledge graphs, and finally the entity alignment result is obtained.

[0160] The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment 1. It should be noted that the above modules as part of the system can be executed in a computer system such as a set of computer executable instructions.

[0161] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0162] The proposed system can be implemented in other ways. For example, the system embodiment described above is only illustrative, and the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.

[0163] Embodiment 3

[0164] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the entity alignment method based on global information aggregation as described in the first embodiment above are implemented.

[0165] Embodiment 4

[0166] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the entity alignment method based on global information aggregation as described in the first embodiment above are implemented.

[0167] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0168] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0169] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0171] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0172] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. An entity alignment method based on global information aggregation, characterized in that: include: Obtain any two different knowledge graphs, namely, a first knowledge graph and a second knowledge graph; Based on the pre-trained entity alignment network model, the two acquired knowledge graphs are aligned; The entity alignment of the two acquired knowledge graphs based on the pre-trained entity alignment network model includes: Based on the sizes of the two knowledge graphs, generate initial embeddings of knowledge graph entities and relationships, i.e., the first knowledge graph initial embedding and the second knowledge graph initial embedding; Convert the relationship triplets of the two knowledge graphs into adjacency matrices, namely, the first adjacency matrix and the second adjacency matrix respectively; Perform graph diffusion based on the first adjacency matrix and the second adjacency matrix, and combine the generated graph diffusion matrix with the initialization embedding of the two knowledge graphs to obtain the corresponding graph diffusion enhanced graph; Based on the two knowledge graphs, we filter entities according to the number of edges directly connected to them and obtain the corresponding structural perturbation enhancement graph. The encoder is used to embed the domain information, relationship direction and global features of the two knowledge graphs into the corresponding graph diffusion enhanced graph and structure perturbation enhanced graph, respectively, to obtain the corresponding graph diffusion enhanced embedding vector and graph perturbation enhanced embedding vector; The alignment relationship between two entities is determined based on the Euclidean distance between the graph diffusion enhanced embedding vectors and the graph perturbation enhanced embedding vectors of the two knowledge graphs, and finally the entity alignment result is obtained.

2. The entity alignment method based on global information aggregation according to claim 1, characterized in that: The graph diffusion is performed based on the first adjacency matrix and the second adjacency matrix, and the generated graph diffusion matrix is ​​combined with the initialization embedding of the two knowledge graphs to obtain the corresponding graph diffusion enhanced graph, which is specifically: Based on the first adjacency matrix and the second adjacency matrix, PersonalizedPageRank is used to perform graph diffusion to form a dense diffusion matrix, namely the first diffusion matrix and the second diffusion matrix; The first diffusion matrix and the second diffusion matrix are respectively combined with the first knowledge graph initialization embedding and the second knowledge graph initialization embedding to obtain the first graph diffusion enhancement graph and the second graph diffusion enhancement graph.

3. The entity alignment method based on global information aggregation according to claim 1, characterized in that: Based on the two knowledge graphs, the corresponding structural perturbation enhancement graph is obtained by screening according to the number of edges directly connected to the entities, which is specifically: Based on the two knowledge graphs, traverse all triples of the knowledge graphs; Filter the entities in the triple according to the number of edges directly connected to them, retain the entities with a number less than 2, and obtain the filtered triples; A processed knowledge graph is obtained based on the remaining triple relations and entities after screening, and a new adjacency matrix is ​​converted based on the relation triplets in the processed knowledge graph; The new adjacency matrix is ​​combined with the initialized embedding of the knowledge graph to construct a structure perturbation enhanced graph, and the first structure perturbation enhanced graph and the second structure perturbation enhanced graph are obtained.

4. The entity alignment method based on global information aggregation according to claim 1, characterized in that: The encoder is used to embed the domain information, relationship direction and global features of the two knowledge graphs into the corresponding graph diffusion enhanced graph and the structure perturbation enhanced graph, respectively, to obtain the corresponding graph diffusion enhanced embedding vector and the graph perturbation enhanced embedding vector, specifically: Based on the graph diffusion enhancement graph and the structure perturbation enhancement graph in the two knowledge graphs, the PageRank algorithm is used to aggregate global information and perform feature transformation to obtain the corresponding global embedding vector; Connect the relationship direction information of the graph diffusion enhancement graph and the structure perturbation enhancement graph of the two knowledge graphs to obtain the corresponding direction embedding vector; The graph attention network is used to convolve the two graph diffusion enhancement graphs with the corresponding knowledge graph adjacency matrix to obtain the corresponding graph diffusion convolution embedding vectors; The graph attention network is used to convolve the two knowledge graph initialization embeddings with the corresponding structure perturbation enhancement graph to obtain the corresponding graph perturbation convolution embedding vectors; The two global embedding vectors, the two directional embedding vectors and the two graph diffusion convolution embedding vectors are used to obtain the corresponding graph diffusion enhanced embedding vector, and the two global embedding vectors, the two directional embedding vectors and the two graph perturbation convolution embedding vectors are used to obtain the corresponding graph perturbation enhanced embedding vector.

5. The entity alignment method based on global information aggregation as claimed in claim 4, characterized in that: The relationship direction information of the graph diffusion enhancement graph and the structure perturbation enhancement graph of the two knowledge graphs are connected to obtain the corresponding direction embedding vector, specifically: Obtain the relational adjacency matrices of the two graph diffusion enhanced graphs and the two structure perturbation enhanced graphs respectively; The forward and reverse relations of the four relation adjacency matrices are collected using the mean aggregator; The forward relationship set and the reverse relationship set of the relationship adjacency matrix are concatenated to obtain the corresponding directional embedding vector.

6. The entity alignment method based on global information aggregation as claimed in claim 4, characterized in that: Based on the graph diffusion enhancement graph and the structure perturbation enhancement graph in the two knowledge graphs, the PageRank algorithm is used to aggregate global information and perform feature transformation to obtain the corresponding global embedding vector, which is specifically: The PageRank-based method is used to calculate the relative importance of each entity in the triples of the graph diffusion enhancement graph and the structure perturbation enhancement graph in the two knowledge graphs in the entire knowledge graph, and obtain the entity importance weight; Calculate the PageRank score of each entity in the triple relative to the entire encoder, use the PageRank score of the entity related to the triple to weight the relationship frequency, and obtain the relationship probability matrix; Multiply the entity importance weights and the relationship probability matrix to obtain the feature matrices of the graph diffusion enhanced graph and the structure perturbation enhanced graph in the two knowledge graphs, that is, the global embedding vectors corresponding to the two knowledge graphs.

7. The entity alignment method based on global information aggregation according to claim 1, characterized in that: The two entity alignment relationships are determined based on the Euclidean distance between the graph diffusion enhanced embedding vectors and the graph perturbation enhanced embedding vectors of the two knowledge graphs, and the entity alignment result is finally obtained, which is specifically: Determine the best matching alignment entity by calculating the Euclidean distance between a single entity in the graph diffusion enhanced embedding vector of the first knowledge graph and all entities in the graph diffusion enhanced embedding vector of the second knowledge graph and the graph perturbation enhanced embedding vector of the second knowledge graph; The Euclidean distance between a single entity in the graph perturbation augmented embedding vector of the first knowledge graph and the graph diffusion augmented embedding vector of the second knowledge graph and all entities in the graph perturbation augmented embedding vector of the second knowledge graph is calculated to determine the best matching aligned entity.

8. An entity alignment system based on global information aggregation, characterized in that: include: A knowledge graph acquisition module is configured to acquire any two different knowledge graphs, namely, a first knowledge graph and a second knowledge graph; An entity alignment module is configured to perform entity alignment on two acquired knowledge graphs based on a pre-trained entity alignment network model; The entity alignment of the two acquired knowledge graphs based on the pre-trained entity alignment network model includes: Based on the sizes of the two knowledge graphs, generate initial embeddings of knowledge graph entities and relationships, i.e., the first knowledge graph initial embedding and the second knowledge graph initial embedding; Convert the relationship triplets of the two knowledge graphs into adjacency matrices, namely, the first adjacency matrix and the second adjacency matrix respectively; Perform graph diffusion based on the first adjacency matrix and the second adjacency matrix, and combine the generated graph diffusion matrix with the initialization embedding of the two knowledge graphs to obtain the corresponding graph diffusion enhanced graph; Based on the two knowledge graphs, we filter entities according to the number of edges directly connected to them and obtain the corresponding structural perturbation enhancement graph. The encoder is used to embed the domain information, relationship direction and global features of the two knowledge graphs into the corresponding graph diffusion enhanced graph and structure perturbation enhanced graph, respectively, to obtain the corresponding graph diffusion enhanced embedding vector and graph perturbation enhanced embedding vector; The alignment relationship between two entities is determined based on the Euclidean distance between the graph diffusion enhanced embedding vectors and the graph perturbation enhanced embedding vectors of the two knowledge graphs, and finally the entity alignment result is obtained.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the entity alignment method based on global information aggregation as described in any one of claims 1 to 7 are implemented.

10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the entity alignment method based on global information aggregation as described in any one of claims 1-7 are implemented.

Citation Information

Cited By

  • Knowledge graph representation method and device based on similarity diffusion

    CN119443223A

  • Building construction enterprise operation data management method and system

    CN120336537A

  • A construction enterprise operation data management method and system

    CN120336537B

  • Metadata persistence method, electronic equipment, storage medium and program product

    CN120523785A