Method and system for entity alignment using credibility-aware iterative training strategy

Through the credibility-aware iterative training strategy and the relationship-aware interaction graph attention network, the self-supervision mechanism achieves entity alignment in the multi-source knowledge graph, solving the problems of high alignment seed tagging cost and noise impact, and improving model accuracy and alignment accuracy. sex.

CN118364906BActive Publication Date: 2024-08-23ANHUI INTERNET THINK TANK DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410792134.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-08-23
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

The existing technology relies on a large number of manually annotated alignment seeds in multi-source knowledge graph entity alignment, and the iterative strategy lacks a correct assessment of the quality of pseudo-alignment seeds, resulting in model performance degradation and noise impact.

Method used

Adopting a credibility-aware iterative training strategy, the semantic information and structural features are extracted through the relationship-aware interaction graph attention network, entity similarity is calculated and credibility is evaluated, and the self-supervision mechanism generates high-credibility pseudo-alignments in unlabeled data. Seeds are gradually added to the training set to reduce the impact of noise.

Benefits of technology

It accurately aligns entities without labeled data, improves model accuracy, reduces the impact of noise, and overcomes the problems of high alignment seed labeling costs and pseudo-alignment seed errors, and is suitable for cross-language entity alignment tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118364906B
    Figure CN118364906B
Patent Text Reader

Abstract

The present invention belongs to the field of artificial intelligence technology, and specifically relates to a method for realizing entity alignment by applying a credibility-aware iterative training strategy and a corresponding service recommendation system. The core of the scheme includes a relationship-aware interactive graph attention network and a self-supervision mechanism based on credibility-aware iterative training. Among them, the graph attention network is used to extract the embedded representations of entities and relationships in the knowledge graph, and can aggregate entity features and relationship features, and use the attention mechanism to reduce the impact of noise on entity embedding. In the self-supervision mechanism, the graph attention network first extracts the embedded representations of the two knowledge graphs to be aligned, and then continuously evaluates the credibility of each group of pre-aligned entity pairs in the two knowledge graphs, and gradually adds the entity pairs with high credibility as pseudo-alignment seeds. The present invention overcomes the defects of the existing scheme that it needs to rely on a large number of manually annotated pseudo-alignment seeds and is easily affected by noise, resulting in insufficient model accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and specifically relates to a method for realizing entity alignment by applying a credibility-aware iterative training strategy and a corresponding service recommendation system. Background Art

[0002] Knowledge graph (KG) is a data structure that uses a visual graph to vividly display complex information. This data expresses rich semantic information in a simple structure and is widely used in many fields such as search engines and recommendation systems. Knowledge graphs are usually built by different people or organizations based on different data sources, so there is heterogeneity and complementarity between multi-source knowledge graphs. Entity alignment (EA) aims to find entities that refer to the same thing in the real world from different knowledge graphs, and is a key step in fusing multiple knowledge graphs. Figure 1 The case of cross-language entity alignment centered on Da Vinci is demonstrated. Entity alignment aligns equivalent entities in the graph and guides multi-source graphs to fuse their respective knowledge information, thereby improving the integrity and practicality of the knowledge graph.

[0003] In recent years, representation learning-based methods have become the mainstream methods for entity alignment. These methods first embed entities into the same vector space and align entities according to the embedding similarity between entities. However, existing methods usually rely on using labeled alignment data to embed multi-source graphs into the same space. These labeled data are called alignment seeds. Due to the high cost of manually annotating alignment seeds, entity alignment tasks in the real world often lack labeled data. In order to expand the training data, some methods propose to use an iterative strategy to generate pseudo-labeled data during the training process. In the current iteration, a part of the aligned entity pairs are selectively regarded as pseudo-alignment seeds and added to the training set of the next iteration, which makes the model training achieve certain performance improvements.

[0004] In the training of network models, the existing iterative strategies lack the correct evaluation of the quality of pseudo-alignment seeds, resulting in the introduction of incorrectly aligned entities into the training set, and ultimately leading to a catastrophic performance degradation of the model. In addition to incorrect labels, noise information may also affect the accuracy of the model. This is due to the heterogeneity of different knowledge graphs. For a pair of equivalent entities, there may be entities in their neighbor entities that do not belong to each other's neighborhood. When aggregating neighborhood information, these entities cannot provide effective alignment information, such as Figure 1 In the alignment task shown, for the central entity "Da Vinci", "The Last Supper" in the Chinese knowledge graph and "Florence" in the English knowledge graph are not in each other's neighborhood. Aggregating this type of node information will introduce noise, resulting in a decrease in the similarity of the central entity. Summary of the invention

[0005] In order to solve the problem that the prior art needs to rely on a large number of manually labeled alignment seeds when using GNN to implement entity alignment tasks in multi-source knowledge graphs, the present invention provides a method for implementing entity alignment using a credibility-aware iterative training strategy and a corresponding service recommendation system.

[0006] The technical solution provided by the present invention is as follows:

[0007] A method for realizing entity alignment by applying a credibility-aware iterative training strategy, which is used to align specified entities in any two knowledge graphs, comprises:

[0008] S1: Obtain a sample data set including a large number of knowledge graphs, and index and number all entity and relationship information contained in each knowledge graph in the sample data set.

[0009] S2: Extract any two specified knowledge graphs in the sample dataset using the relationship-aware interaction graph attention network G 1 and G 2 The semantic information, relationship information and structural features of the knowledge graph are extracted, and each entity in the knowledge graph is generated based on the extracted information. e The final expression .

[0010] S3: Based on the final representation of each entity Computation belongs to the knowledge graph G 1 and G 2 The similarity between any two entities S , and evaluate the credibility of pre-aligned entity pairs consisting of entities from two different sources c The process is as follows:

[0011] S31: Take the opposite of the Manhattan distance between any two entities as the similarity between them, and calculate the similarity between them. G 1 and G 2 The similarity between any two entities constitutes a similarity matrix D .

[0012] S32: Similarity matrix D The entity corresponding to the best similarity ranking in the similarity ranking e i and e j as a pre-aligned entity pair.

[0013] S33: From the similarity matrix D Filter out one of the entities in the pre-aligned entity pair e i In addition to another knowledge graph e j The suboptimal similarity of the remaining entities except . And the other entity in the pre-aligned entity pair e j In addition to another knowledge graph e i The suboptimal similarity for entities other than .

[0014] S34: Calculate the difference between the best similarity and the two suboptimal similarities respectively, and record the calculation result as one-way credibility.

[0015] S35: Taking the mean of two one-way credibility as the evaluation entity e i and e j The credibility of whether an aligned entity pair can be formed.

[0016] S36: Repeat steps S32-S35, and convert the similarity matrix D Each group of entities whose similarity is greater than a specified similarity threshold is taken as a pre-aligned entity pair, and the credibility of each pre-aligned entity pair is calculated.

[0017] S4: When the credibility of any two entities belonging to two knowledge graphs exceeds a preset credibility threshold, a pseudo-label is added between the two entities to indicate that the two entities are equivalent.

[0018] S5: Use the sample dataset to iteratively train the relationship-aware interaction graph attention network, and use the pseudo-labels obtained in each round as supervision information in the subsequent training process to improve the training effect of the relationship-aware interaction graph attention network.

[0019] S6: Save the trained relation-aware interaction graph attention network and use it to align specified entities in any two knowledge graphs.

[0020] As a further improvement of the present invention, in step S1, the knowledge graph is a graph structure data, which contains multiple triples, and the format of each triple is: ( h , r , t ).in, h Represents the head entity, t Represents the tail entity, r Represents the relationship between the head entity and the tail entity; in a triple, the relationship is directional.

[0021] As a further improvement of the present invention, in step S2, any entitye i The final expression Represented by the embedding of the current entity , the aggregate embedding representation of the multi-hop neighbor entities of the current entity , and the aggregate embedding representation of the single-hop relationship of the current entity The expression is as follows:

[0022] ,

[0023] In the above formula, Indicates the maximum level of the specified neighbor entity.

[0024] As a further improvement of the present invention, In the above example, the embedding representation of the current entity is itself, which is recorded as: .

[0025] Aggregate single-hop relationship of the current entity Embedded by the relationship between the current entity and each first-level neighbor entity Aggregated.

[0026] As a further improvement of the present invention, the relationship between any entity and its neighbor entities is embedded as The calculation method is as follows:

[0027] First, each triple in the relationship graph ( h , r , t ) and the head and tail entities in it are swapped to construct a new triple ( t , r -1 , h ); Use new triples to expand the knowledge graph. In the new triples, r -1 express r The inverse relationship.

[0028] Then, based on the amplified knowledge graph, the following formula is used to calculate :

[0029] ,

[0030] In the above formula, Representing relationships r i The number of times it appears in each triple in the knowledge graph; Representation and Relationship r i The head entity in the corresponding triple.

[0031] As a further improvement of the present invention, the calculation method of the aggregated embedding representation of the multi-hop neighbor entities of the current entity is as follows:

[0032] (1) Use the relationship-aware interactive attention mechanism in the relationship-aware interactive graph attention network to extract the alignment information in the neighborhood of the knowledge graph and obtain the attention scores of the center entity and the tail entity or relationship. . The expression is as follows:

[0033] ,

[0034] In the above formula, Represents the sigmoid function; W Represents the dynamically updated transformation matrix; Represents the aggregate embedding of the current head entity; h t Represents tail entity embedding or relation embedding; represents element-wise multiplication; According to the transformation matrix W Some features of the extracted original features; Represents a mapping matrix.

[0035] (2) Attention score After using the activation function and normalization, the relationship weights between the central entity and each neighbor entity are obtained :

[0036] ,

[0037] In the above formula, LeakyReLU represents the activation function; N i Represents the set of neighbor entities of the central entity; Represents the central entity e i With neighbor entities e k The attention score.

[0038] (3) According to the hierarchical relationship of each entity in the knowledge graph, the relationship and neighbor nodes are aggregated in the same way using the following formula to obtain the aggregate embedding of neighbor entities at all levels:

[0039] .

[0040] As a further improvement of the present invention, in step S31, any two entities in different knowledge graphs e i and e j Similarity The calculation formula is as follows:

[0041] ,

[0042] In the above formula, Representing Entities e i The final expression of Representing Entities e j The final expression of Represents a function that finds the Manhattan distance between two entities.

[0043] As a further improvement of the present invention, in step S3, it is assumed that the entity e i From the knowledge graph G 1 ,entity e j From the knowledge graph G 2 , then the pre-aligned entity pair ( e i , e j ) c ( e i , e j ) is calculated as follows:

[0044] ,

[0045] In the above formula, express e i One-way credibility; express e j One-way credibility; express G 1 Medium e i Other entities other than express G 2 Medium e j Other entities other than express e i and similarity; express and e j The similarity.

[0046] As a further improvement of the present invention, in step S5, contrast loss is selected as the loss function of the iterative training process. L , whose expression is:

[0047] ,

[0048] In the above formula, express e i The loss function of express e j The loss function of express e i With negative samples The similarity between express e i and negative samples The similarity between express e j With negative samples The similarity between express e j and negative samples The similarity between express G 1 The k nearest neighbor negative samples in ; Indicated in G 2 The k nearest neighbor negative samples in ; P represents the set of pseudo-label aligned entity pairs.

[0049] The present invention also includes a service recommendation system, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the memory executes the computer program, the steps of the method for realizing entity alignment by applying the credibility-aware iterative training strategy as described above are implemented to obtain a trained relationship-aware interaction graph attention network, which is used to align specified entities in any two knowledge graphs.

[0050] The technical solution provided by the present invention has the following beneficial effects:

[0051] The scheme provided in this paper for realizing entity alignment based on the credibility-aware iterative training strategy will build a self-supervisory mechanism based on the relationship-aware mutual graph attention network, which can find the most similar entity pairs in two knowledge graphs without using any labeled data, and accurately evaluate the credibility of the aligned entity pairs between the two. In the iterative training of the scheme of the present invention, the high-credibility entity pairs found will be gradually added as pseudo-alignment seeds to help the next iterative training, thereby continuously improving the model accuracy.

[0052] In the solution of the present invention, the designed relation-aware mutual graph attention network can simultaneously aggregate entities and relations in the neighborhood. The network effectively reduces the impact of neighborhood noise through the attention mechanism and aggregates structural information to learn entity representation. This overcomes the impact of insufficient noise filtering on model performance in existing solutions.

[0053] The present invention combines a newly designed credibility-aware iteration strategy to achieve self-supervision. On the one hand, it can automatically generate pseudo-alignment seeds from unlabeled data, overcoming the problem of high alignment seed labeling cost in the prior art. On the other hand, it ensures the reliability of pseudo-alignment seeds and overcomes the degradation of model performance caused by erroneous seeds.

[0054] In addition, the solution of the present invention can also adaptively embed entities in multi-source knowledge graphs into a unified space while avoiding contrast loss. Therefore, this solution is particularly suitable for processing cross-language entity alignment tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 This is a typical case of entity alignment between knowledge graphs introduced in the background technology.

[0056] Figure 2 This is a schematic diagram of the principle architecture of the method for implementing entity alignment using a credibility-aware iterative training strategy provided in Example 1 of the present invention.

[0057] Figure 3 This is a flowchart of the steps of the method for implementing entity alignment using a credibility-aware iterative training strategy provided in Example 1 of the present invention.

[0058] Figure 4 The figure is a comparison between the pseudo alignment seed generation strategy of the present invention and the generation strategy of the prior art.

[0059] Figure 5 For the dataset DBP ZH-EN and SRPRS DE-EN On the dataset, the Hits@K index of the four models CAIT, RAGA, AGEA, and CPL-OT changes with the proportion of entity pairs in the training set.

[0060] Figure 6 Graph showing how the Hits@K index and the number of erroneous pseudo-labels in the solution of the present invention change with the confidence threshold on three types of DBP15K datasets.

[0061] Figure 7 This is a graph showing the total number of samples of pseudo-aligned seeds, the number of erroneous samples, and the change in the Hits@K index during the iteration process of the CAIS strategy of the present invention and the traditional BIS strategy in the test experiment. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0063] Example 1

[0064] This embodiment provides a method for implementing entity alignment by applying a credibility-aware iterative training strategy, which is used to align specified entities in any two knowledge graphs. The overall framework of the solution is as follows: Figure 2 As shown, the core of the solution includes a relation-aware interactive graph attention network (RMGAT) and a self-supervisory mechanism based on confidence-aware iterative training. Among them, RMGAT is used to extract embedded representations of entities and relationships in knowledge graphs. As an improvement to the GNN network, the RMGAT designed in this embodiment is a relation-aware graph attention model based on semantic features, which can aggregate entity features and relationship features, and use the attention mechanism to reduce the impact of noise on entity embedding. Since RMGAT can use semantic features to aggregate alignment information from the neighborhood, it can reduce noise interference and enhance the entity embedding representation generated by RMGAT.

[0065] It can also be seen from the accompanying drawings that a prominent feature of the scheme of this embodiment is that it can complete the training of RMGAT without using any alignment label data, and is used to perform entity alignment tasks. In general, the strategy for implementing the self-supervision mechanism in the scheme of the present invention is: first, RMGAT extracts the embedded representations of the two knowledge graphs to be aligned, and then CAIT is used to guide RMGAT to perform iterative training. During the training process, CAIT will continuously evaluate the credibility of each group of pre-aligned entity pairs in the two knowledge graphs, and gradually add entity pairs with high credibility as pseudo-alignment seeds to assist in the next round of training and guide the network to generate correct entity embedding representations. In the scheme of this embodiment, CAIT can automatically mine alignment samples from unlabeled data and generate pseudo-label data on the one hand, and on the other hand, it can also combine the designed credibility calibration strategy to accurately eliminate erroneous pseudo-labels and reduce the impact of erroneous pseudo-labels on entity representation learning in RMGAT.

[0066] In detail, Figure 3 As shown, the method for implementing entity alignment by applying a credibility-aware iterative training strategy provided in this embodiment includes the following steps:

[0067] S1: Obtain a sample data set including a large number of knowledge graphs, and index and number all entity and relationship information contained in each knowledge graph in the sample data set.

[0068] Knowledge graph is a typical graph structure data. Figure 1 Take the knowledge graph of as an example. The knowledge graph contains nodes composed of several entities and edges composed of the relationships between entities. And because the relationship between each entity is directional, the knowledge graph is essentially a directed graph.

[0069] In this embodiment, a knowledge graph belonging to a directed graph is described by a number of triples. Specifically, each knowledge graph contains multiple triples, and the format of each triple is: ( h , r , t ).in, h Represents the head entity, t Represents the tail entity, r Represents the relationship between the head entity and the tail entity; for example, from Figure 1In the knowledge graph on the left, we can see that there is a triple (Leonardo da Vinci, birthplace, Italy). In this triple, Leonardo da Vinci belongs to the head entity, Italy belongs to the tail entity, and the relationship between the head entity and the tail entity is the birthplace. The semantics of this triple is "Leonardo da Vinci was born in Italy". In addition, considering that the relationship in the triple is directional. This semantics can also be converted into another expression, that is, "Italy is the birthplace of Leonardo da Vinci". In the triple generated by the latter, Italy is the head entity and Leonardo da Vinci is the tail entity.

[0070] In the scheme of this embodiment, in order to facilitate the use of RMGAT to perform feature learning and feature extraction on the knowledge graph, this embodiment converts all entities (including head entities and tail entities) and relationships in triples into corresponding index numbers, where the original triples contain semantic information and the index numbers are digital information.

[0071] S2: Use the Relation-aware Interaction Graph Attention Network (RMGAT) to extract any two specified knowledge graphs in the sample dataset G 1 and G 2 The semantic information, relationship information and structural features of the knowledge graph are extracted, and each entity in the knowledge graph is generated based on the extracted information. e The final expression .

[0072] In the solution of this embodiment, any entity extracted by RMGAT e i The final expression Represented by the embedding of the current entity , the aggregate embedding representation of the multi-hop neighbor entities of the current entity , and the aggregate embedding representation of the single-hop relationship of the current entity The expression is as follows:

[0073] ,

[0074] In the above formula, Indicates the maximum level of the specified neighbor entity.

[0075] Specifically, the final representation extracted by RMGAT In the above example, the embedding representation of the current entity is itself, which is recorded as: .

[0076] Aggregate single-hop relationship of the current entity Embedded by the relationship between the current entity and each first-level neighbor entity The relationship between any entity and its neighboring entities is embedded in The calculation method is as follows:

[0077] First, each triple in the relationship graph ( h , r , t ) and the head and tail entities in it are swapped to construct a new triple ( t , r -1 , h ); Use new triples to expand the knowledge graph. In the new triples, r -1 express r The inverse relationship.

[0078] Then, based on the amplified knowledge graph, the following formula is used to calculate :

[0079] ,

[0080] In the above formula, Representing relationships r i The number of times it appears in each triple in the knowledge graph; Representation and Relationship r i The head entity in the corresponding triple.

[0081] Furthermore, the calculation method of the aggregate embedding representation of the multi-hop neighbor entities of the current entity is as follows:

[0082] (1) Use the relationship-aware interactive attention mechanism in the relationship-aware interactive graph attention network to extract the alignment information in the neighborhood of the knowledge graph and obtain the attention scores of the central entity and the tail entity or relationship. . The expression is as follows:

[0083] ,

[0084] In the above formula, Represents the sigmoid function; W Represents the dynamically updated transformation matrix; Represents the aggregate embedding of the current head entity; h t Represents tail entity embedding or relation embedding; represents element-wise multiplication; According to the transformation matrix W Some features of the extracted original features; Represents a mapping matrix.

[0085] (2) Attention score After using the activation function and normalization, the relationship weights between the central entity and each neighbor entity are obtained :

[0086] ,

[0087] In the above formula, LeakyReLU represents the activation function; N i Represents the set of neighbor entities of the central entity; Represents the central entity e i With neighbor entities e k The attention score.

[0088] (3) According to the hierarchical relationship of each entity in the knowledge graph, the relationship and neighbor nodes are aggregated in the same way using the following formula to obtain the aggregate embedding of neighbor entities at all levels:

[0089] .

[0090] S3: Based on the final representation of each entity Computation belongs to the knowledge graph G 1 and G 2 The similarity between any two entities S , and evaluate the credibility of pre-aligned entity pairs consisting of entities from two different sources c .

[0091] Specifically, in the CAIT mechanism, the credibility of the pre-aligned entities in the two knowledge graphs is c The calculation process is as follows:

[0092] S31: Take the opposite of the Manhattan distance between any two entities as the similarity between them, and calculate the similarity between them. G 1 and G 2 The similarity between any two entities constitutes a similarity matrix D .

[0093] Any two entities in different knowledge graphs e i and e j Similarity The calculation formula is as follows:

[0094] ,

[0095] In the above formula, Representing Entitiese i The final expression of Representing Entities e j The final expression of Represents a function that finds the Manhattan distance between two entities.

[0096] For example, suppose two knowledge graphs G 1 and G 2 The number of entities in are 7 and 8 respectively, then we can get a 7×8 similarity matrix D ,matrix D Each element in That is, it belongs to the knowledge graph G 1 Entities in e i and belongs to the knowledge graph G 2 Entities in e j Among them, i =1…7, j =1…8.

[0097] S32: Similarity matrix D The corresponding entities with the highest similarity ranking e i and e j as a pre-aligned entity pair.

[0098] That is: D middle The corresponding two entities are used as pre-aligned entities in the current two knowledge graphs.

[0099] S33: From the similarity matrix D Filter out one of the entities in the pre-aligned entity pair e i In addition to another knowledge graph e j The suboptimal similarity of the remaining entities except . And the other entity in the pre-aligned entity pair e j In addition to another knowledge graph e i The suboptimal similarity for entities other than .

[0100] In this embodiment, it is assumed that The corresponding two entities are e i and e j ,e i ∈ G 1 , e j ∈ G 2 , at this time, according to the similarity matrix D The two suboptimal similarity matrices calculated are e i The suboptimal similarity matrix and e j The suboptimal similarity matrix of . Among them, e i The suboptimal similarity matrix is e i and G 2 Medium e j The maximum similarity of each entity other than is denoted as . e j The suboptimal similarity matrix refers to e j and G 1 Medium e i The maximum similarity of all entities other than .

[0101] S34: Calculate the difference between the best similarity and the two suboptimal similarities respectively, and record the calculation result as one-way credibility.

[0102] In this embodiment, the pre-aligned entity pair is still used as e i and e j For example, two one-way credibility is divided into e i One-way credibility and e j One-way credibility , and the calculation formulas for the two are as follows:

[0103] ,

[0104] In the above formula, express G 1 Medium e i Other entities other than express G 2 Medium e j Other entities other than expresse i and similarity; express and e j The similarity.

[0105] S35: Taking the mean of two one-way credibility as the evaluation entity e i and e j Whether it can constitute the credibility of the aligned entity pair. Then the pre-aligned entity pair ( e i , e j ) c ( e i , e j ) is calculated as follows:

[0106] .

[0107] S36: In this embodiment, steps S32-S35 are repeated to calculate the credibility c of several groups of pre-aligned entity pairs with the second highest or even lower similarity in the similarity matrix in turn according to the principle of decreasing similarity.

[0108] It should be emphasized that in the solution of this embodiment, a similarity threshold s0 is usually set. In order to improve data processing efficiency, this embodiment only targets the similarity matrix D The corresponding credibility is calculated for several pre-aligned pairs whose similarity is greater than the threshold.

[0109] S4: When the credibility of any two entities belonging to two knowledge graphs exceeds a preset credibility threshold, a pseudo-label is added between the two entities to indicate that the two entities are equivalent.

[0110] In this embodiment, for two knowledge graphs, assuming that there is at least one set of pre-aligned entity pairs, its credibility is recorded as credibility c ( e i , e j ), the credibility threshold is set to λ, then only when c ( e i , e j )>λ, then e i and e j A pseudo label is added between them to indicate that they are equivalent.

[0111] Figure 4 The figure shows a comparison of the generation method of pseudo-alignment seeds in the existing strategy and the strategy of this embodiment. It can be seen from the figure that in previous iterative strategies, technicians usually only add labels to different pre-aligned entity pairs according to the size of the similarity. This strategy does not fully consider the alignment credibility problem, often introduces erroneous pseudo-alignment seeds, and the errors will be superimposed and amplified during the iteration, resulting in the corresponding entities unable to be embedded in the correct position in the vector space.

[0112] In the scheme of this embodiment, the similarity between entities is first calculated based on the entity embedding generated by the model. When a pair of entities are each other's most similar entities (meaning that the similarity between the two exceeds the similarity threshold), they are regarded as potential pseudo-alignment seeds. The similarity between this pair of entities and other entities is further analyzed. If this pair of entities is not similar to other entities (meaning that the credibility of the two exceeds the credibility threshold), it means that this pair of entities has no other potential alignment entities, and the pair of entities is regarded as highly credible alignment entities. This embodiment only adds pre-aligned entity pairs with high similarity and high credibility to pseudo-alignment seeds to assist in the next round of training; alignment entities that do not meet the above conditions are abandoned and not included in pseudo-alignment seeds.

[0113] S5: Select the remaining knowledge graphs in the sample dataset, repeat steps S3-S4, iteratively train the relationship-aware interaction graph attention network, and use the pseudo-labels obtained in each round as supervision information in the subsequent training process to improve the training effect of the relationship-aware interaction graph attention network.

[0114] In RMGAT, in order to embed multi-source knowledge graphs into the same vector space, this embodiment uses Manhattan distance to measure the distance between two entities. On this basis, in order to guide model learning, this embodiment further uses contrastive loss function. In order to unify the vector space of the knowledge graph as much as possible, this embodiment regards each pair of entities in the pseudo-alignment seed as a positive sample. For a pair of positive samples ( e i , e j ), e i ∈ G 1 , e j ∈ G 2 , using the nearest neighbor sampling strategy from G 1 , G 2 Sample K nearest neighbor samples as negative samples. Finally, combine the positive samples and negative samples to gete i The loss function ,as well as e j The loss function . And weight the two to get the final loss function number L , whose expression is:

[0115] ,

[0116] In the above formula, express e i The loss function of express e j The loss function of express e i With negative samples The similarity between express e i and negative samples The similarity between express e j With negative samples The similarity between express e j and negative samples The similarity between express G 1 The k nearest neighbor negative samples in ; Indicated in G 2 The k nearest neighbor negative samples in ; P represents the set of pseudo-label aligned entity pairs.

[0117] S6: Save the trained relation-aware interaction graph attention network and use it to align specified entities in any two knowledge graphs.

[0118] Example 2

[0119] The scheme of embodiment 1 can be used to realize the alignment of entities in different knowledge graphs. In practical applications, the scheme can be run in the form of a computer program. On this basis, this embodiment further provides a service recommendation system, which includes a memory, a processor, and a computer program stored in the memory and can be run on the processor. When the memory executes the computer program, the steps of the method for realizing entity alignment by applying the credibility-aware iterative training strategy in embodiment 1 are implemented to obtain a trained relationship-aware interaction graph attention network, which is used to align specified entities in any two knowledge graphs.

[0120] The service recommendation system in this embodiment is essentially a computer device, which includes a memory, a processor, and a computer program stored in the memory and can be run on the processor. The computer device provided in this embodiment can be an intelligent terminal, a tablet computer, a laptop computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. that can execute programs. The computer device in this embodiment includes at least but is not limited to: a memory and a processor that can communicate with each other through a system bus.

[0121] In this embodiment, the memory (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device.

[0122] In other embodiments, the memory may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device. Of course, the memory may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory is generally used to store the operating system and various application software installed on the computer device. In addition, the memory may also be used to temporarily store various data that have been output or are to be output.

[0123] The processor may be a central processing unit (CPU), a graphics processing unit (GPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor is generally used to control the overall operation of a computer device. In this embodiment, the processor is used to run program codes stored in a memory or process data.

[0124] Test experiment

[0125] In order to verify the effectiveness of the method provided by the present invention for implementing entity alignment by applying the credibility-aware iterative training strategy, the technicians specified an experimental plan and used the Pytorch framework to simulate and test the solution of the present invention. The test experiment was conducted on an Ubuntu server equipped with an NVIDIA A100 (40GB memory) GPU; the experimental process included the following:

[0126] 1. Dataset

[0127] This example conducts experiments on two widely used cross-lingual datasets (DBP15K and SRPRS) and one monolingual dataset (DWY15K). The following is a brief introduction to the three datasets:

[0128] 1.1、DBP15K:

[0129] The dataset consists of three cross-language subsets established by DBpedia: ZH-EN (Chinese-English), DBP JA-EN (Japanese-English) and DBP FR-EN (French-English). Each subset contains 15,000 aligned entity pairs.

[0130] 1.2 SRPRS

[0131] The dataset consists of two cross-lingual subsets: SRPRS DE-EN (German-English) and SRPRS FR-EN (French-English). Compared to DBP15K, this dataset has a sparser graph structure and thus fewer relations and triples. Each subset contains 15,000 aligned entity pairs.

[0132] 1.3, DWY15K

[0133] The dataset is constructed from DBpedia (DBP), Wiki-data (WD), and YAGO3 (YG), and includes four monolingual subsets: DWY DBP-WD-V1 、DWY DBP-YG-V1 、DWY DBP-WD-V2 、DWY DBP-YG-V2 Each monolingual subset contains 13,500 aligned entity pairs.

[0134] Table 1: Detailed statistics of each dataset.

[0135]

[0136] 2. Comparison Scheme

[0137] In order to comprehensively evaluate the effectiveness of the scheme of the present invention, this experiment also selected several existing schemes as control groups and compared them with the experimental group (CAIT) of the scheme of the present invention to determine the performance differences of each scheme. Among them, the control group schemes can be divided into the following three categories:

[0138] 2.1 Non-iterative method

[0139] This type of scheme adopts the common setting of entity alignment dataset, that is, 30% of the labeled entity pairs in the dataset are used as training sets, and the remaining 70% are used as test sets. The schemes include: RDGCN, HGCN, NMN, RAGA, RALG, SDEA, RAEA, SVNM-GAT.

[0140] 2.2 Iteration method

[0141] These schemes use the same dataset setup as the non-iterative methods. In addition, they use an iterative strategy to automatically generate pseudo-alignment seeds during training. The schemes include: Transege, MRAEA, RNM, Dual-AMN, PSR, BNGNN, RHMN.

[0142] 2.3 Self-supervision method

[0143] This type of solution does not use any training set data, but instead generates pseudo-alignment seeds for self-supervised entity alignment. Solutions include: EVA, SEU(w), selfKG, AGEA, UPLR, CPL-OT.

[0144] 3. Evaluation Indicators and Experimental Process

[0145] This experiment uses Hits@K and mean reciprocal ranking (MRR) as performance evaluation indicators. Hits@K and MRR are two commonly used evaluation indicators in the fields of information retrieval and artificial intelligence. Hits@K represents the proportion of correct answers ranked first in all queries. MRR represents the average sum of the reciprocals of all correct query rankings.

[0146] This experiment uses pre-trained word embeddings GloVe and BERT to initialize entity embeddings. For GloVe word embeddings, technicians translated non-English entity names into English through Google Translate. The quality of translation has a great impact on the quality of entity embeddings. To ensure fairness and rigor in the comparison, the translation version of the previous scheme was used in the experiment. For entity names out of the vocabulary, technicians randomly initialized their embeddings, and for BERT word embeddings, technicians used the settings of CPL-OT. Technicians first looked up 768-dimensional pre-trained embeddings through BERT, and then used principal component analysis (PCA) to reduce the dimensionality of the embeddings from 768 to 300.

[0147] The technicians also used the Sinkhorn algorithm to generate bidirectional alignment results. The hyperparameters were set as follows: the number of graph neural network (GNN) layers 1 = 2, the credibility threshold = 0.95, the credibility decrement value d = 0.05, the number of epochs for executing the iteration strategy = 10, the number of negative samples k = 20, the convergence value of the Sinkhorn algorithm e = 0.001, and the learning rate used by Adam was set to 0.001. The reported results are the average of 5 independent experiments.

[0148] 4. Experimental Results and Analysis

[0149] The technicians tested the scheme of the present invention and the control group scheme on different data sets, obtained corresponding experimental results, and respectively counted the performance of different schemes on the three data sets of DBP15K, SRPRS and DWY15K as shown in Tables 2 to 4.

[0150] Most of the data in Tables 2 and 3 come from the original papers of each solution, and the other results come from a review survey. The experiments in Table 4 use 30% of the labeled entity pairs for training and initialize the entity embedding through GloVe. The experimental results are generated from the source code of the paper.

[0151] Table 2: Performance of different solutions on the DBP15K dataset

[0152]

[0153] In this experiment, DBP15K is a dataset widely used in entity alignment tasks. The experimental results are divided into three parts: non-iterative method, iterative method and self-supervisory method. Analyzing the experimental data in Table 2, we can find that:

[0154] In the experimental results of the iteration method and the self-supervision method, the scheme of the present invention achieved the best performance on all subsets. Compared with the other two subsets, all methods performed better in DBP. ZH-ENThe performance on DBP is relatively poor. This is mainly due to the huge language gap between Chinese and English. In the self-supervised environment, AGEA, CPL-OT, SREA and UPLR use different strategies to generate pseudo-alignment seeds, and their performance is not as good as the solution of the present invention. ZH-EN On the data set, the solution of the present invention is 3% higher than the second-ranked method.

[0155] It is worth noting that even in the self-supervised environment, the scheme of the present invention still outperforms all methods in the supervised environment, which proves the effectiveness of the self-supervised strategy adopted in the scheme of the present invention. In the iterative environment, BNGNN includes both entity names and attributes to enhance entity representation. However, the scheme of the present invention still outperforms BNGNN by more than 3% when only using entity name information, which further verifies the robustness of the scheme of the present invention.

[0156] Table 3: Performance of different schemes on the SRPRS dataset

[0157]

[0158] Compared with DBP15K, the SRPRS dataset has fewer relations and triples, and its graph structure is relatively sparse. Analyzing the data in Table 3, we can find that:

[0159] The solution of the present invention still outperforms all control solutions. However, it is worth noting that the performance of all Glove word embedding-based methods has declined. In the case of the present invention, BERT-based entity embedding improves the performance by 4.0%-11.8%, which is mainly attributed to the out-of-vocabulary (OOV) problem. FR-EN The experimental performance of was particularly affected by this problem, and technicians found that more than 2,000 entities failed to obtain initial embeddings from Glove, which is 4 times the number of entities that failed to obtain embeddings in DBP15K. The present invention and CPT-OT solve this problem by using BERT to initialize embeddings, while SDEA combines attribute information to enrich entity representations. Both methods have achieved good results, which shows that semantic information plays a key role in sparse datasets, while structural information can only play a limited role. The poor performance of Transedge and MRAEA on SRPRS further verifies this because they only use structural information.

[0160] Table 4: Performance of different solutions on the DWY15K dataset

[0161]

[0162] The DWY15K dataset can be divided into two groups: DWYDBP-WD and DWY DBP-YG , each version contains two subsets. Wikidata entities are in DWY DBP-WD The digital identifiers are used in the representation, so they cannot provide useful semantic information for entity alignment. Analyzing the experimental data in Table 4, we can find that:

[0163] Due to the lack of semantic information, in DWY DBP-WD It is difficult to perform entity alignment on DWY. DBP-WD All experiments perform worse on the V1 dataset than on the V2 dataset, which shows the challenges of aligning entities on sparse datasets.

[0164] The solution of the present invention is to remove DWY DBP-YG-V2 The performance on all subsets except DWY is better than other methods. DBP-WD On the dataset, the proposed scheme improves the performance by 7.8%-8.8% on the Hits@1 index and 5.1%-5.7% on the MMR index compared with AGEA, which shows that the proposed scheme has stronger capabilities in generating pseudo-aligned seeds and learning graph structure information. DBP-YG-V2 The dataset has richer semantic information, and SREA is good at capturing semantic information but weak in capturing structural information. Therefore, SREA performs slightly better than the present invention on this dataset, but performs worse than the present invention on all other datasets.

[0165] V. Ablation Experiment

[0166] In order to verify the impact of the relationship-aware interaction graph attention network used in the front end and the credibility-aware iterative training strategy used in the back end on the performance of the final solution in the solution of the present invention, the technicians also conducted an ablation study on the solution in a self-supervised environment. In the ablation study, the control groups include: -CA means that the self-supervised strategy is replaced by a solution that does not perform credibility analysis; -MA means that RMGAT is replaced by GCN that does not contain an attention layer. -MHE means that the solution uses the average sum instead of connection to connect the embeddings of different layers. -S means that the solution does not use the Sinkhom algorithm. The experimental results obtained are shown in Table 5:

[0167] Table 5: Performance of different schemes in ablation experiments

[0168]

[0169] Analyzing the data in Table 5, we can find that removing any component will lead to different degrees of performance degradation of the method. It is worth noting that among these components, MHE and CA make significant contributions. The reason why they play a prominent role is that MHE makes it easier to distinguish entities by explicitly connecting the embeddings of different layers. CA evaluates the credibility of aligned entity pairs and avoids putting low-credibility entity pairs into pseudo-alignment seeds, thus effectively preventing the accumulation of errors.

[0170] 6. Supplementary Experiments

[0171] Combined with the above, it can be seen that the ratio of training set entity pairs and the credibility threshold are set in the scheme of the present invention, among which the ratio of training set entity pairs will affect the number of training set entity pairs, and the credibility threshold will affect the number of pseudo-alignment seeds finally produced. The setting of these two parameters may affect the performance of the model. Based on this, the experimental group further tests the impact of different values ​​of the two parameters on the scheme.

[0172] 6.1. Sensitivity to the ratio of entity pairs in the training set.

[0173] This experiment sets different training set entity pair ratios, ranging from 10% to 50%, with a step size of 10%. In order to make a fair comparison, this experiment uses Glove to initialize entity embedding. Finally, CAIT, RAGA, AGEA, and CPL-OT perform better in DBP. ZH-EN and SRPRS DE-EN The performance on the dataset is as follows Figure 5 As shown:

[0174] analyze Figure 5 The experimental results show that the results of all methods improve with the increase of training set entity pairs, because more labeled entity pairs are conducive to embedding KG into a more unified space. Compared with other methods, CAIT's performance improvement is more stable and performs better, especially when the training set entity pairs are limited. This also verifies the robustness of the scheme of the present invention and its effectiveness in generating high-quality pseudo-aligned seeds.

[0175] 6.2. Sensitivity to credibility threshold.

[0176] In order to explore the impact of the confidence threshold, this experiment further studied the performance of the solution of the present invention on the DBP15K dataset with a confidence level ranging from 0 to 0.8.

[0177] This experiment analyzes the false pseudo-alignment seeds and Hits@1 when the best results are achieved. When the credibility is set to 0, it means that there is no restriction on the credibility, and the strategy degenerates into a bidirectional iterative strategy. Figure 6As shown in Figure 2, with the increase of confidence, the number of false pseudo-alignment seeds decreases significantly and Hits@1 also improves. Therefore, CAIS effectively limits the number of false pseudo-alignment seeds and greatly improves the performance.

[0178] 6.3. Error accumulation analysis compared with traditional strategies.

[0179] In order to further analyze the error accumulation process, the technicians also compared the credibility-aware iteration strategy (CAIS) used in the present invention with the bidirectional iteration strategy (BIS) widely used in the comparison scheme. The experimental results under different strategies are shown in Figure 2. Figure 7 shown.

[0180] analyze Figure 7 It can be found that: since the BIS strategy directly selects pseudo-alignment seeds without distinguishing them, in each round of iteration, the BIS strategy can always generate more pseudo-alignment seeds than the CAIS strategy. However, unlike the CAIS strategy of the present invention, the pseudo-alignment seeds generated by the BIS strategy contain a large number of erroneous pseudo-alignment seeds, and these erroneous pseudo-alignment seeds will lead to erroneous entity alignment. In addition, errors will propagate and accumulate during the training process. Therefore, the accuracy of the BIS strategy method will improve in the early stage, but will then drop significantly. The CAIS strategy of the present invention can strictly identify credible alignment entity pairs, and then gradually incorporate highly credible pairs into pseudo-alignment seeds, thereby limiting the negative impact of error accumulation and continuously improving the accuracy of the model.

[0181] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention. For example, the sequence of each step in the scheme introduced in the above embodiment is only one way to implement the scheme. The scheme of the present invention can also be implemented by adopting the same actions in different sequences. Such modified embodiments still belong to the protection scope of the present invention.

Claims

1. A method for entity alignment using a credibility-aware iterative training strategy. It is characterized in that It is used to align specified entities in any two knowledge graphs, including: S1: Obtain a sample data set including a large number of knowledge graphs, wherein the sample data set adopts a cross-language data set, and indexes and numbers all entity and relationship information contained in each knowledge graph in the sample data set; S2: Use the relationship-aware interaction graph attention network to extract any two specified knowledge graphs in the sample dataset G 1 and G 2 The semantic information, relationship information and structural features of the knowledge graph are extracted, and each entity in the knowledge graph is generated based on the extracted information. e The final expression ; Any entity e i The final expression Represented by the embedding of the current entity , the aggregate embedding representation of the multi-hop neighbor entities of the current entity , and the aggregate embedding representation of the current entity's one-hop relationship The expression is as follows: , In the above formula, Indicates the maximum level of the specified neighbor entity; S3: Based on the final representation of each entity Computation belongs to the knowledge graph G 1 and G 2 The similarity between any two entities S , and evaluate the credibility of pre-aligned entity pairs consisting of entities from two different sources c ; The process is as follows: S31: Take the opposite of the Manhattan distance between any two entities as the similarity between them, and calculate the similarity between them. G 1 and G 2 The similarity between any two entities constitutes a similarity matrix D ; S32: The similarity matrix D The corresponding entities with the highest similarity ranking e i and e j as a pair of pre-aligned entities; S33: From the similarity matrix D Filter out one of the entities in the pre-aligned entity pair e i In addition to another knowledge graph e j The suboptimal similarity of the remaining entities except e j In addition to another knowledge graph e i Suboptimal similarity for entities other than ; S34: respectively calculating the difference between the optimal similarity and the two suboptimal similarities, and the calculation result is recorded as the one-way credibility; S35: Taking the mean of two one-way credibility as the evaluation entity e i and e j Whether it can constitute the credibility of the aligned entity pair; S36: Repeat steps S32-S35, and sequentially convert the similarity matrix D Each group of entities whose similarity is greater than a specified similarity threshold is taken as a pre-aligned entity pair, and the credibility of the pre-aligned entity pair is calculated; S4: When the credibility of any two entities belonging to two knowledge graphs exceeds a preset credibility threshold, a pseudo label is added between the two entities to indicate that the two entities are equivalent; S5: Select the remaining knowledge graphs in the sample data set, repeat steps S3-S4, iteratively train the relationship-aware interaction graph attention network, and use the pseudo labels obtained in each round as supervision information in the subsequent training process to improve the training effect of the relationship-aware interaction graph attention network; S6: Save the trained relation-aware interaction graph attention network and use it to align specified entities in any two knowledge graphs.

2. The method for implementing entity alignment by applying a credibility-aware iterative training strategy as claimed in claim 1, Features: In step S1, the knowledge graph is a graph structure data, which contains multiple triples, and the format of each triple is: ( h , r , t ); in, h Represents the head entity, t Represents the tail entity, r Represents the relationship between the head entity and the tail entity, and the relationship is directional.

3. The method for implementing entity alignment by applying a credibility-aware iterative training strategy as claimed in claim 2, It is characterized in that exist In the above example, the embedding representation of the current entity is itself, which is recorded as: ; Aggregate single-hop relationship of the current entity Embedded by the relationship between the current entity and each first-level neighbor entity Aggregated.

4. The method for implementing entity alignment by applying a credibility-aware iterative training strategy as claimed in claim 3, It is characterized in that Relation embedding between any entity and its neighboring entities The calculation method is as follows: First, each triple in the relationship graph ( h , r , t ) and the head and tail entities are swapped to construct a new triple ( t , r -1 , h ); using new triples to expand the knowledge graph; wherein, r -1 express r The inverse relationship of Then, based on the amplified knowledge graph, the following formula is used to calculate : , In the above formula, Representing relationships r i The number of times it appears in each triple in the knowledge graph; Representation and Relationship r i The head entity in the corresponding triple.

5. The method for implementing entity alignment by applying a credibility-aware iterative training strategy as claimed in claim 4, Features: The aggregate embedding representation of the multi-hop neighbor entities of the current entity is calculated as follows: (1) Use the relationship-aware interactive attention mechanism in the relationship-aware interactive graph attention network to extract the alignment information in the neighborhood of the knowledge graph and obtain the attention scores of the center entity and the tail entity or relationship. , the expression is as follows: , In the above formula, represents the sigmoid function, W represents the dynamically updated transformation matrix, represents the aggregate embedding of the current head entity, h t represents the tail entity embedding or relation embedding, Represents element-wise multiplication; According to the transformation matrix W Some features of the extracted original features; Represents a mapping matrix; (2) For the attention score After using the activation function and normalization, the relationship weights between the central entity and each neighbor entity are obtained : , In the above formula, LeakyReLU represents the activation function, N i represents the set of neighbor entities of the central entity, Represents the central entity e i With neighbor entities e k Attention score; (3) According to the hierarchical relationship of each entity in the knowledge graph, the relationship and neighbor nodes are aggregated in the same way using the following formula to obtain the aggregate embedding of neighbor entities at all levels: 。 6. The method for implementing entity alignment by applying a credibility-aware iterative training strategy as claimed in claim 1, Features: In step S31, any two entities in different knowledge graphs e i and e j Similarity The calculation formula is as follows: , In the above formula, Representing Entities e i The final expression of Representing Entities e j The final expression of Represents a function that finds the Manhattan distance between two entities.

7. The method for implementing entity alignment by applying a credibility-aware iterative training strategy as claimed in claim 1, Features: In step S3, it is assumed that the entity e i From the knowledge graph G 1 ,entity e j From the knowledge graph G 2 , then the pre-aligned entity pair ( e i , e j ) c ( e i , e j ) is calculated as follows: , In the above formula, express e i One-way credibility, express e j One-way credibility, express G 1 Medium e i Entities other than express G 2 Medium e j Entities other than express e i and The similarity of express and e j The similarity.

8. The method for implementing entity alignment by applying a credibility-aware iterative training strategy as claimed in claim 1, Features: In step S5, contrast loss is selected as the loss function of the iterative training process. L , whose expression is: , In the above formula, express e i The loss function is express e j The loss function is express e i With negative samples The similarity between express e i and negative samples The similarity between express e j With negative samples The similarity between express e j and negative samples The similarity between express G 1 The k nearest neighbor negative samples in , Indicated in G 2 where P is the k nearest neighbor negative samples in , and P represents the set of pseudo-label aligned entity pairs.

9. A service recommendation system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the memory executes the computer program, the steps of the method for realizing entity alignment by applying a credibility-aware iterative training strategy as described in any one of claims 1 to 8 are implemented to obtain a trained relationship-aware interaction graph attention network, which is used to align specified entities in any two knowledge graphs.