A large-scale entity alignment method using graph sampling training and matrix normalization
By employing graph sampling training and matrix normalization, this method addresses the issues of high computational overhead and information loss in large-scale knowledge graphs, achieving efficient and high-precision entity alignment, and is suitable for entity alignment tasks in large-scale knowledge graphs.
Patent Information
- Application Number
- CN202310817190.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-03
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-07-03
AI Technical Summary
Existing entity alignment methods based on graph neural networks have high computational overhead in large-scale knowledge graphs and cannot be effectively scaled. Furthermore, existing methods are prone to information loss when processing large-scale knowledge graphs and cannot effectively solve the centrality and isolation problems.
We employ graph sampling training and matrix normalization to obtain a subset of a large-scale knowledge graph, perform multi-level neighbor sampling to construct a feature matrix, and use sparse similarity matrix and Sinkhorn operation for entity alignment.
It reduces computational overhead, improves the efficiency and accuracy of entity alignment, solves the scalability problem of large-scale knowledge graphs, and generates efficient and high-precision alignment results.
Smart Images

Figure CN116882497B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of knowledge graph entity alignment, and particularly relates to a large-scale entity alignment method using graph sampling training and matrix normalization. BACKGROUND
[0002] A knowledge graph stores objects in the real world and their relationships in the form of triples, and is widely used in recommendation systems, question and answer systems, search engines, etc. However, the graphs constructed by different enterprises or institutions are not complete and one-sided in information, which affects the actual application effect of the knowledge graph. This phenomenon is particularly serious in network encyclopedia data. There are various encyclopedias on the Internet at present, including Baidu Encyclopedia, Sogou Encyclopedia, 360 Encyclopedia, as well as Wikipedia (Wikipedia) and Encyclopedia Britannica (Encyclopedia Britannica) maintained by foreign countries. Although these network encyclopedias can provide users with rich information, the quality and focus of the results provided by different network encyclopedias are not the same, and there are differences in the expression of different entries. For example, domestic encyclopedia data is mainly in Chinese, while foreign encyclopedias have more comprehensive information on English entries. Users often need to use multiple encyclopedias to find satisfactory answers. On the other hand, large language models have emerged rapidly at present, and the training data of large language models mainly comes from the Internet. Therefore, integrating network encyclopedia knowledge graphs can provide large language models with more content-rich and higher-quality corpus as training data. In view of the above, it is urgent to propose a method that can effectively integrate network encyclopedia data.
[0003] Entity alignment technology can find entities representing the same real-world object in different graphs, and realize the fusion of different source network encyclopedia knowledge graphs to expand the knowledge graph. With the emergence of graph neural networks, entity alignment methods based on neural networks have dominated the field with absolute performance advantages. Such methods learn entity features by integrating neighbor information of entities. However, the encyclopedia knowledge graph is huge, which brings great challenges to the entity alignment task in this field. Existing graph neural network-based entity alignment methods ignore the scalability of the algorithm and usually use full-graph training, which cannot cope with large-scale knowledge graphs. Some methods use graph partitioning techniques to solve this problem, but partitioning inevitably loses some information of the graph, affecting the accuracy. Therefore, how to realize the training of large-scale knowledge graphs without losing information is a highly challenging task.
[0004] In addition, the feature vectors of large-scale entity alignment have geometric properties, including centrality (some entities are the nearest neighbors of many other entities) and isolation (some entities are not the nearest neighbors of any other entities), which bring challenges to the corresponding process of existing network encyclopedia knowledge graph alignment methods. Some research works use normalization methods to alleviate this problem, but there is still a problem of poor scalability. Therefore, an extensible method is needed to solve the above problems. SUMMARY
[0005] In view of the deficiencies of the prior art, the embodiments of the present application provide a large-scale entity alignment method using graph sampling training and matrix normalization. In the training stage, the graph sampling technology is used to reduce the computational overhead. In the matching stage, sparse matrix operations are used to solve the centrality and isolation problems of feature vectors and improve the running efficiency.
[0006] According to a first aspect of the embodiments of the present application, a large-scale entity alignment method using graph sampling training and matrix normalization is provided, comprising:
[0007] obtaining a large-scale source network encyclopedia knowledge graph and a target network encyclopedia knowledge graph, wherein some entities in the source network encyclopedia knowledge graph and some entities in the target network encyclopedia knowledge graph have a paired relationship, and the entities are entries in the network encyclopedia;
[0008] based on the paired entities in the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph, dividing the entity set in the two knowledge graphs into subsets containing an equal number of entities, wherein the subsets obtained by dividing the two knowledge graphs have a paired relationship;
[0009] performing multi-layer neighbor sampling on the entities in each subset to obtain corresponding subgraphs, wherein the subgraphs obtained by sampling the subsets having a paired relationship have a paired relationship;
[0010] using an entity alignment model based on the structure of the knowledge graph to independently learn the structural features of the entities in each subset in each pair of subgraphs, and constructing a feature matrix;
[0011] for all entities of the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph, using the feature matrix to calculate the nearest neighbors, thereby constructing a sparse similarity matrix, and using Sinkhorn operation to process the sparse similarity matrix to obtain an entity alignment result.
[0012] Further, based on the paired entities in the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph, dividing the entity set in the two graphs into subsets containing an equal number of entities, comprising:
[0013] According to the computing power and memory size of the computing device, determine the subset size that can be loaded into the memory, according to the subset size, calculate the number of partitions;
[0014] According to the number of partitions, the entity set in the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph is divided, so that the proportion of entities with pairing relationship in each subset after division remains consistent before division.
[0015] Further, the entities in each subset are sampled by multiple layers of neighbors to obtain corresponding subgraphs, including:
[0016] For each entity in each subset, sample in two knowledge graphs respectively, that is, find the neighbor entities connected thereto and having a triple relationship;
[0017] For the found neighbor entities, continue to find the next layer of neighbor entities by sampling until a predetermined number of layers is found.
[0018] All entities sampled are constructed into an L-layer tree structure subgraph according to the connection relationship.
[0019] Further, the structure features of the entities in each pair of subgraphs are learned independently using a knowledge graph structure-based entity alignment model, and a feature matrix is constructed, including:
[0020] 4.1) Initialize the feature vectors of the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph;
[0021] 4.2) Based on the feature vectors of the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph, input the subgraph with paired relationship as input data into the knowledge graph structure-based entity alignment model for one round of training;
[0022] 4.3) Repeat step 4.2) to complete a predetermined number of training rounds, and combine the structure feature vectors of the entities in each subset before sampling in each subgraph obtained in the last round of training to obtain a feature matrix of all entities in the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph.
[0023] Further, for all entities in the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph, the nearest neighbor is calculated using the feature matrix, thereby constructing a sparse similarity matrix, and the sparse similarity matrix is processed using Sinkhorn operation to obtain an entity alignment result, including:
[0024] For all entities in the source network encyclopedia knowledge graph, find k feature approximate nearest neighbor entities in the target network encyclopedia knowledge graph based on the feature matrix, thereby constructing a sparse similarity matrix M s-t from the source network encyclopedia knowledge graph to the target network encyclopedia knowledge graph;
[0025] For all entities in the target network encyclopedia knowledge graph, based on the feature matrix, we search for k feature-approximate nearest neighbor entities in the source network encyclopedia knowledge graph, thereby constructing a sparse similarity matrix M from the target network encyclopedia knowledge graph to the source network encyclopedia knowledge graph. t-s ;
[0026] Will As the final similarity matrix, the Sinkhorn operation is performed to obtain the entity alignment result.
[0027] Furthermore, Sinkhorn(M)=lim n→∞ S n (M), where S 0 (M) = exp(M),
[0028] S k (M) = N c (N r (S k-1 (M)), where N c and N r Represents row and column normalization respectively.
[0029] According to a second aspect of an embodiment of the present application, a large-scale entity alignment apparatus using graph sampling training and matrix normalization is provided, comprising:
[0030] An acquisition module is configured to acquire a large-scale source web encyclopedia knowledge graph and a target web encyclopedia knowledge graph, wherein some entities in the source web encyclopedia knowledge graph and some entities in the target web encyclopedia knowledge graph have a pairing relationship, and the entities are entries in the web encyclopedia;
[0031] A partitioning module is used to partition the entity sets in the source web encyclopedia knowledge graph and the target web encyclopedia knowledge graph into subsets containing an equal number of entities based on the paired entities in the two knowledge graphs, wherein the subsets obtained by partitioning the two knowledge graphs have a pairwise relationship;
[0032] A sampling module is used to perform multi-layer neighbor sampling on the entities in each subset to obtain the corresponding subgraph, where the subgraph obtained by sampling the subset with pairwise relationships has pairwise relationships;
[0033] A construction module is used to independently learn the structural features of the entities in the corresponding subsets of each pair of subgraphs using an entity alignment model based on the knowledge graph structure and construct a feature matrix;
[0034] An entity alignment module is configured to calculate the nearest neighbor by using the feature matrix for all entities of the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph, to construct a sparse similarity matrix, and to obtain an entity alignment result by processing the sparse similarity matrix by using a Sinkhorn operation.
[0035] According to a third aspect of the embodiments of the present application, an electronic device is provided, comprising:
[0036] one or more processors;
[0037] a memory configured to store one or more programs;
[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to the first aspect.
[0039] According to a fourth aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores computer instructions, and the instructions are executed by a processor to implement the steps of the method according to the first aspect.
[0040] The technical solutions provided by the embodiments of the present application can include the following beneficial effects:
[0041] As can be seen from the above embodiments, the present application proposes a sampling training method for large-scale network encyclopedia knowledge graph alignment tasks, which can effectively reduce the computational overhead of the training process and does not destroy the structure information of the graph. In addition, the method is a general tool that can integrate existing knowledge methods and improve the scalability of these methods. Finally, to solve the centrality and isolation problems of the feature matrix of the large-scale network encyclopedia knowledge graph, a sparse matrix normalization method is proposed, and the optimal transport theory is applied to entity alignment to generate an efficient and high-precision alignment result.
[0042] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0043] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application.
[0044] Figure 1 is a flowchart of a large-scale entity alignment method using graph sampling training and matrix normalization according to an exemplary embodiment.
[0045] Figure 2 A subset division and invention framework schematic diagram according to an exemplary embodiment.
[0046] Figure 3A neighbor node sampling process diagram is shown according to an example embodiment.
[0047] Figure 4 A large-scale entity alignment device using graph sampling training and matrix normalization is shown according to an example embodiment.
[0048] Figure 5 A schematic diagram of an electronic device is shown according to an example embodiment. DETAILED DESCRIPTION
[0049] The example embodiments will be described in detail herein with reference to the attached drawings. The description below concerns the drawings, unless otherwise indicated, in which like numbers represent analogous or similar elements throughout the various figures. The implementations described in the following example embodiments are not meant to represent all implementations consistent with the present disclosure.
[0050] The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in the present disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0051] It will be understood that, although the terms first, second, third, etc. can be used herein to describe various information, these terms are not intended to denote a particular order or hierarchy. These terms are used only to distinguish one from another. For example, a first information can be termed a second information, and, similarly, a second information can be termed a first information, without departing from the scope of the present disclosure. Depending on the context, the word "if' as used herein can be interpreted as meaning "when" or "in response to determining."
[0052] Figure 1 A large-scale entity alignment method using graph sampling training and matrix normalization is shown according to an example embodiment, as shown in Figure 1 the method is applied in a computing device, and can include the following steps:
[0053] (1) obtaining a large-scale source network knowledge graph G s and a target network knowledge graph G t , wherein some entities in the source network knowledge graph and some entities in the target network knowledge graph have a pairing relationship;
[0054] (2) Based on the paired entities in the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph, the entity set in the two graphs is divided into independent subsets according to the device performance;
[0055] (3) Sampling each segmented subset in the two knowledge graphs, that is, finding the connected entities;
[0056] (4) Using a knowledge graph structure-based entity alignment model to independently learn the structural features of the entities in each pair of subsets, and constructing a feature matrix;
[0057] (5) For all entities in the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph, use the feature matrix to calculate the nearest neighbor, thereby constructing a sparse similarity matrix, and use the Sinkhorn operation to process the coefficient similarity matrix to obtain the entity alignment result.
[0058] From the above embodiments, it can be seen that the present application proposes a sampling training method for large-scale knowledge graph alignment tasks, which can effectively reduce the computational overhead of the training process and does not destroy the structure information of the graph. In addition, this method is a general tool that can integrate existing knowledge graph entity alignment methods based on graph neural networks such as GCN-Align, RREA, Dual-AMN, etc., and improve the scalability of these methods. Finally, for the centrality and isolation problems of the feature matrix of large-scale knowledge graphs, a sparse matrix normalization method is proposed, and the optimal transport theory is applied to entity alignment to generate an efficient and high-precision alignment result.
[0059] Step (1): Obtain a large-scale source network encyclopedia knowledge graph G s and a target network encyclopedia knowledge graph G t , wherein some entities in the source network encyclopedia knowledge graph and some entities in the target network encyclopedia knowledge graph have a pairing relationship;
[0060] Specifically, the knowledge graph can be represented as G(E, R, T). Where E is the set of entities, R is the set of relationships. T {(h, r, t) | h, t E, r E} is a set of triples. The entity alignment task is to find G s =(E s ,R s ,T s ) and G t =(E t ,R t ,T t ) in which the entities representing the same real-world object are φ = [(e s ,e t ) E s x E t |es ≡e t}, wherein e s ∈E s , e t ∈E t . Generally, there are some known paired entity pairs in two knowledge graphs as training samples; in the network encyclopedia knowledge graph, a specific entry is called an entity. For example, "West Lake", "Hangzhou City", etc. There are interactions between different entries, such as (West Lake, located in, Hangzhou City). Generally, if there is a relationship between two entities in the network encyclopedia field, there may be mutual links between them, so that network users can better understand the encyclopedia content.
[0061] Step (2): Based on the paired entities in the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph, the entity set in the two knowledge graphs is divided into an equal number of subsets, wherein the subsets obtained by dividing the two knowledge graphs have a paired relationship. The size of the subset is automatically adapted according to the user's computing resources; the number of subsets of the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph after construction is equal, and there is a one-to-one correspondence between the subsets of the two sets of entities. There is no intersection in different subsets, and the union of all subsets is the entity set of the source network encyclopedia knowledge graph (target network encyclopedia knowledge graph), specifically:
[0062] 2.1) According to the computing power and memory size of the computing device, design a subset division size that can be loaded into memory, and calculate the division number according to the subset size, division number = total number of entity set elements / subset size;
[0063] Specifically, this is done to enable the entities in the subset and the subsequent sampled subgraph to be loaded into memory.
[0064] 2.2) Divide the entity set in the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph according to the division number, so that the proportion of training samples in each subset after division remains consistent before division, and for one knowledge graph (source or target network encyclopedia knowledge graph), the size of each subset is as consistent as possible, in order to make the computational load uniform, otherwise the large subset will have a longer computing time and consume more memory, which is unreasonable.
[0065] As Figure 2 shown. The subset after division contains entities from G s and entities from G t . Among them, a small part of the entities have known corresponding relationships, and the other entities are unknown corresponding entities to be aligned.
[0066] Step (3): Multi-layer neighbor sampling is performed on the entities in each subset to obtain the corresponding subgraph, wherein the subgraph sampled from the subset with a pair of relations exists a pair of relations, as shown in Figure 3 It should be noted that the subset in step (2) is pair-wise constructed, and therefore, the sampled subgraph still maintains a one-to-one correspondence of pairs. This step can include the following sub-steps:
[0067] 3.1) For each entity in the subset, sampling is performed in the two knowledge graphs respectively, that is, finding the entities connected thereto and having a triple relationship;
[0068] Specifically, according to the size of the user's computer memory, the upper limit f of the number of neighbor entities that each entity can sample is set, denoted as f. For an entity, the neighbor entities connected thereto in the network encyclopedia knowledge graph need to be sampled. If the number of neighbor entities is less than f, all are recorded. If the number of neighbor entities is greater than the set number f, f entities are randomly selected. In this way, the number of nodes of the subgraph obtained by sampling is ensured to be less than the memory limit.
[0069] 3.2) For the found neighbor entities, the next layer of neighbor entities is found by sampling, until a predetermined number of layers L are found, wherein L is the number of layers required by the training model;
[0070] Specifically, the number of L is determined by the number of layers of the graph neural network. The larger L is, the deeper the sampling layer is, and the farther the information transmission distance of each entity is. However, too large L will also cause the representation of entities to gradually converge
[0071] 3.3) All entities sampled are constructed into an L-layer tree-like hierarchical subgraph according to the connection relationship, as shown in Figure 3 on the right, as the input of the next step.
[0072] Step (4): The feature vectors of the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph are initialized. The entity alignment model based on the structure of the knowledge graph is used to independently learn the structural features of the entities in each pair of subgraphs, and a feature matrix is constructed; specifically:
[0073] 4.1) The feature vectors of the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph are initialized;
[0074] Specifically, the feature vectors F s and F t of the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph can be initialized using the Glorot initialization method. wherein D is the dimension of the entity feature vector. If the entity name of the network encyclopedia knowledge graph contains semantic information, a language model can also be used for initialization.
[0075] 4.2) Based on the feature vectors of the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph, the subgraph with a pair relationship is taken as input data to the knowledge graph structure-based entity alignment model for one round of training;
[0076] Specifically, any knowledge graph structure-based entity alignment model can be used, such as a graph convolutional neural network model on a knowledge graph, a graph attention network model, to learn the feature vectors of entities. The subset before the subgraph sampling is the root node of the tree-shaped subgraph, which is also the target entity to be learned. The specific learning process is as follows: the initialized feature f e F is used to represent the feature vector of the entity at the leaf node in the subgraph. Then, the entities at each layer are represented from bottom to top, and L steps are performed until the feature vector of the target entity is obtained. If the entity v is at the i-th layer, its feature is where σ is an activation function. G is an aggregation function that aggregates the features of entities connected to v in the i+1-th layer. Different entity alignment models use different activation functions and aggregation functions. In the entity alignment model, a loss function is used to make the vector features of the corresponding entities close. Specifically, a triple loss function such as a contrast loss function, a margin loss function, etc. can be used.
[0077] 4.3) Repeat step 4.2) to complete the predetermined number of training rounds, and combine the structural feature vectors of the entities in the subset before each subgraph sampling obtained in the last round of training to obtain the feature matrix of all entities of the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph;
[0078] Specifically, the predetermined number of training rounds can be set by experience. Through the predetermined number of training rounds, the feature matrix of all entities of the source network encyclopedia knowledge graph and the feature matrix of all entities of the target network encyclopedia knowledge graph
[0079] Step (5): For all entities of the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph, use the feature matrix to calculate the nearest neighbor to construct a sparse similarity matrix Use the Sinkhorn operation to process the sparse similarity matrix to obtain the entity alignment result;
[0080] 5.1) For all entities of the source network encyclopedia knowledge graph, use the FAISS (Facebook AI Similarity Search) library to quickly find the feature k approximate nearest neighbor entities in the target network encyclopedia knowledge graph based on the feature matrix, thereby constructing a sparse similarity matrix M from the source network encyclopedia knowledge graph to the target network encyclopedia knowledge graph s-t ;
[0081] Specifically, when finding approximate nearest neighbors, the Manhattan distance formula, Euclidean distance formula, or cosine distance formula can be used to calculate feature distances. Users can choose the appropriate distance formula based on their needs. The value of k is typically in the range of 50-100, selecting 50-100 approximate nearest neighbors. When constructing the similarity matrix, only the similarities of these k nearest neighbors are calculated, creating a sparse similarity matrix. This significantly reduces computational complexity and storage space.
[0082] 5.2) For all entities in the target web encyclopedia knowledge graph, based on the feature matrix, find the k entities with the most similar features in the source web encyclopedia knowledge graph, thereby constructing a sparse similarity matrix M from the target web encyclopedia knowledge graph to the source web encyclopedia knowledge graph. t-s ;
[0083] Specifically, this step is the same as step 5.1) and will not be described in detail here.
[0084] 5.3) As the final similarity matrix, the Sinkhorn operation is then performed to obtain the final entity alignment result.
[0085] Specifically, Sinkhorn(M)=lim n→∞ S n (M), S 0 (M) = exp(M), S k (M) = N c (N r (S k-1 (M)). Where N c and N r Represents the normalization of rows and columns respectively. In practice, a smaller number of iterations can achieve high-precision alignment results. Usually, the number of iterations can be set to 10.
[0086] Corresponding to the aforementioned embodiment of the large-scale entity alignment method using graph sampling training and matrix normalization, the present application also provides an embodiment of a large-scale entity alignment device using graph sampling training and matrix normalization.
[0087] Figure 4 FIG1 is a block diagram of a large-scale entity alignment apparatus using graph sampling training and matrix normalization according to an exemplary embodiment. Figure 4 , the apparatus may include:
[0088] An acquisition module 21 is configured to acquire a large-scale source web encyclopedia knowledge graph and a target web encyclopedia knowledge graph, wherein some entities in the source web encyclopedia knowledge graph and some entities in the target web encyclopedia knowledge graph have a pairing relationship;
[0089] The dividing module 22 is configured to divide entity sets in the two knowledge graphs into subsets containing an equal number of entities based on the entities that have been paired in the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph, wherein the subsets obtained by dividing the two knowledge graphs have a pairing relationship;
[0090] The sampling module 23 is configured to perform multi-layer neighbor sampling on the entities in each subset to obtain corresponding subgraphs, wherein the subgraphs obtained by sampling the subsets having a pairing relationship have a pairing relationship;
[0091] The constructing module 24 is configured to independently learn the structural features of the entities in the corresponding subsets in each pair of subgraphs using an entity alignment model based on the structure of the knowledge graph, and construct a feature matrix.
[0092] The entity alignment module 25 is configured to calculate the nearest neighbors using the feature matrix for all entities in the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph, thereby constructing a sparse similarity matrix, and processing the sparse similarity matrix using a Sinkhorn operation to obtain an entity alignment result.
[0093] As to the apparatus in the above-described embodiments, the specific manners in which various modules perform operations have been described in detail in the embodiments of the method, and thus will not be described here in detail.
[0094] For the apparatus embodiments, since they basically correspond to the method embodiments, the relevant parts are described in the part of the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purposes of the present application according to actual needs. Those skilled in the art can understand and implement it without creative labor.
[0095] Correspondingly, the present application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the large-scale entity alignment method using graph sampling training and matrix normalization as described above. As shown in the Figure 5 The present application also provides a hardware structure diagram of a device with data processing capability for a large-scale entity alignment method using graph sampling training and matrix normalization, in addition to Figure 5In addition to the processor, the memory, and the network interface shown, any data processing capable device in which the apparatus of the embodiments is implemented can also include other hardware according to the actual functions of the data processing capable device, which will not be described herein.
[0096] Correspondingly, the application further provides a computer readable storage medium, which stores computer instructions, and the instructions are executed by a processor to implement the large-scale entity alignment method using graph sampling training and matrix normalization as described above. The computer readable storage medium can be an internal storage unit of any data processing capable device, such as a hard disk or a memory. The computer readable storage medium can also be an external storage device, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. Further, the computer readable storage medium can include both the internal storage unit and the external storage device of any data processing capable device. The computer readable storage medium is used to store the computer program and other programs and data required by the data processing capable device, and can also be used to temporarily store data that has been output or will be output.
[0097] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the application embrace any and all variations of the application that fall within the scope of the general inventive concept as defined by the appended claims and their equivalents.
Claims
1. A large-scale entity alignment method using graph sampling training and matrix normalization, characterized in that, The method comprises the following steps: Obtain a large-scale source network encyclopedia knowledge graph and a target network encyclopedia knowledge graph, wherein some entities in the source network encyclopedia knowledge graph and some entities in the target network encyclopedia knowledge graph have a pairing relationship, and the entities are entries in the network encyclopedia; Divide the entity sets in the two knowledge graphs into subsets containing an equal number of entities based on the entities that have been paired in the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph, wherein the subsets obtained by dividing the two knowledge graphs have a pairing relationship; Sample the entities in each subset in multiple layers of neighbors to obtain corresponding subgraphs, wherein the subgraphs obtained by sampling the subsets having a pairing relationship have a pairing relationship; Independently learn the structural features of the entities in each pair of subgraphs using a knowledge graph structure-based entity alignment model to construct a feature matrix; For all entities of the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph, calculate the nearest neighbors using the feature matrix to construct a sparse similarity matrix, and process the sparse similarity matrix using the Sinkhorn operation to obtain an entity alignment result.
2. The method of claim 1, wherein, Divide the entity sets in the two knowledge graphs into subsets containing an equal number of entities based on the entities that have been paired in the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph, comprising: Determine the subset division size that can be loaded into the memory according to the computing power and memory size of the computing device, and calculate the division number according to the subset size; Divide the entity sets in the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph according to the division number, so that the proportion of entities having a pairing relationship in each subset after division remains consistent before division.
3. The method of claim 1, wherein, Sample the entities in each subset in multiple layers of neighbors to obtain corresponding subgraphs, comprising: Sample the entities in each subset in the two knowledge graphs respectively, i.e., find the neighbor entities connected thereto and having a triple relationship; For the found neighbor entities, continue to find the next layer of neighbor entities by sampling until a predetermined number of layers are found; Construct an L-layer tree-like hierarchical subgraph according to the connection relationship of all the entities sampled.
4. The method of claim 1, wherein, Independently learn the structural features of the entities in each pair of subgraphs using a knowledge graph structure-based entity alignment model to construct a feature matrix, comprising: 4.1) Initialize the feature vectors of the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph; 4.2) Based on the feature vectors of the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph, input the subgraphs having a pairing relationship into the knowledge graph structure-based entity alignment model as input data for one round of training; 4.3) Repeat step 4.2) to complete a predetermined number of rounds of training, and combine the structural feature vectors of the entities in each subset before sampling in the last round of training to obtain the feature matrix of all entities of the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph.
5. The method of claim 1, wherein, For all entities of the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph, the nearest neighbor is calculated using the feature matrix, a sparse similarity matrix is constructed, the sparse similarity matrix is processed using a Sinkhorn operation, and an entity alignment result is obtained, including: For all entities of the source network knowledge graph, k characteristic approximate nearest neighbor entities are found in the target network knowledge graph based on the characteristic matrix, thereby constructing a sparse similarity matrix M of the source network knowledge graph to the target network knowledge graph s-t ; For all entities in the target network encyclopedia knowledge graph, k characteristic approximate nearest neighbor entities are found in the source network encyclopedia knowledge graph based on the feature matrix, thereby constructing a sparse similarity matrix M of the target network encyclopedia knowledge graph to the source network encyclopedia knowledge graph t-s ; The As the final similarity matrix, Sinkhorn operation is performed to obtain the entity alignment result.
6. The method of claim 5, wherein, Sinkhorn (M) = lim n→∞ S n (M), where S 0 (M) = exp(M), S k (M) = N c (N r (S k-1 (M)), where N c and N r represent the row and column normalization, respectively.
7. A device for large scale entity alignment using graph sampling training and matrix normalization, comprising: including: An acquisition module is configured to acquire a large-scale source network encyclopedia knowledge graph and a target network encyclopedia knowledge graph, wherein some entities in the source network encyclopedia knowledge graph and some entities in the target network encyclopedia knowledge graph have a pairing relationship, and the entities are entries in a network encyclopedia; A division module is configured to divide entity sets in the two knowledge graphs into subsets containing an equal number of entities based on the entities that have been paired in the source network encyclopedia knowledge graph and the target network encyclopedia knowledge graph, wherein the subsets obtained by dividing the two knowledge graphs have a pairing relationship; A sampling module is configured to perform multi-layer neighbor sampling on the entities in each subset to obtain corresponding subgraphs, wherein the subgraphs obtained by sampling the subsets having a pairing relationship have a pairing relationship; A construction module is configured to independently learn structural features of the entities in each subset in each pair of subgraphs using an entity alignment model based on the structure of the knowledge graph to construct a feature matrix; An entity alignment module is configured to calculate the nearest neighbor for all entities of the target network encyclopedia knowledge graph and the source network encyclopedia knowledge graph using the feature matrix, construct a sparse similarity matrix, process the sparse similarity matrix using a Sinkhorn operation, and obtain an entity alignment result.
8. An electronic device, comprising: including: One or more processors; Memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-6.
9. A computer readable storage medium having stored thereon computer instructions, wherein, The instructions are executed by the processor to implement the steps of the method of any one of claims 1-6.