Entity alignment method in time sequence knowledge graph based on adversarial learning and label propagation
Through adversarial learning and label propagation methods, iteratively learn entity semantic information in the timing knowledge graph and eliminate degree perception, the problem of insufficient entity alignment accuracy and robustness in the prior art is solved, and a more efficient entity alignment effect is achieved.
Patent Information
- Application Number
- CN202411622375.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2024-12-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing timing knowledge graph entity alignment methods fail to fully capture the dynamic changes of entities over time and relationships, resulting in inaccurate alignment results, and rely on pseudo-label quality and label sample quality, and cumulative errors affect accuracy.
Using an adversarial learning and label propagation method, by iterating the semantic information of entities in relation and time dimensions, eliminating the degree perception in entity embedding, generating the final entity embedding vector, and performing semi-supervised learning for entity alignment.
It improves the accuracy and robustness of entity alignment in the timing knowledge graph, fully considers the dynamic evolution characteristics of entities, and reduces the negative impact of degree perception on the alignment task.
Smart Images

Figure CN119150974A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge expression, and in particular to an entity alignment method in a temporal knowledge graph based on adversarial learning and label propagation. Background Art
[0002] A temporal knowledge graph is a knowledge graph that contains time information. It records the changes in entities and relationships over time and is clear, concise, and easy to process in terms of knowledge expression. In recent years, temporal knowledge graphs have been widely used in many fields, such as recommendation systems, event prediction, and question-answering systems. Most applications of temporal knowledge graphs require entity alignment.
[0003] Existing entity alignment methods are mainly divided into two categories. The first is the entity alignment method based on text description, which uses the text description information of the entity, such as entity name, description, etc., to perform entity alignment through text similarity calculation. The second is the entity alignment method based on structural information, which uses the structural information of the entity in the knowledge graph, such as the relationship and path between entities, to perform entity alignment through structural similarity calculation. However, most of the existing methods ignore the dynamic evolution characteristics of entities in the temporal knowledge graph, and fail to solve the impact of entity degree perception on the entity alignment task, resulting in low accuracy and robustness when dealing with entity alignment problems in temporal knowledge graphs.
[0004] The Chinese patent document with publication number CN115658927A proposes an unsupervised entity alignment method and device for time series knowledge graphs, the method comprising: obtaining two time series knowledge graphs, each of which includes a number of quadruplets containing time information; constructing two time feature matrices by graph convolution forward transmission according to the entities and corresponding time information in each time series knowledge graph, generating two entity alignment matrices by adopting a bidirectional strategy, and obtaining pre-aligned pseudo labels in an unsupervised manner in a matching manner; training the graph neural network model expanded with time information by using the quadruplets of the time series knowledge graph as the training data set and the pre-aligned pseudo labels as untrained data labels, and obtaining a relational feature matrix; fusing the relational feature matrix and the two time feature matrices in a weighted manner to obtain the distance between the two time series knowledge graphs, and obtaining the corresponding entity alignment matrix by minimizing the distance, thereby obtaining the entity alignment result. The method has the following shortcomings: 1. The method aligns entities by graph convolution and time feature matrix, and fails to fully capture the dynamic changes of entities over time and relationships. Entities will change over time and relationships, resulting in inaccurate alignment results. 2. This method uses a bidirectional strategy to generate entity alignment matrices and uses these alignment matrices to generate pseudo labels. The quality of the pseudo labels directly affects the accuracy of the final alignment results. If the generated pseudo labels are not accurate or complete, the relational feature matrix generated during the training process and the final entity alignment results may be negatively affected.
[0005] The Chinese patent document with publication number CN118690845A proposes a model training method, entity alignment method, device, equipment, medium and product. Its entity alignment method includes: obtaining at least one labeled sample for entity pre-alignment of at least two knowledge graphs, wherein the knowledge graphs in the at least two knowledge graphs are knowledge graphs to be entity aligned; generating first loss information and first entity alignment information for a first initial entity alignment model according to the at least one labeled sample; generating a reallocated label set according to the first entity alignment information; generating second loss information for a second initial entity alignment model according to the reallocated label set; performing model training for the first initial entity alignment model and the second initial entity alignment model according to the first loss information and the second loss information to generate a first entity alignment model and a second entity alignment model. Obtain at least two target knowledge graphs; perform entity alignment for the at least two target knowledge graphs using the pre-trained first entity alignment model and the second entity alignment model to obtain entity alignment results. This method has the following shortcomings: 1. Two entity alignment models need to be trained separately. The second entity alignment model depends on the label set reallocated by the first entity alignment model. The accumulated error is amplified and introduced into the entity alignment result, affecting the accuracy of entity alignment. 2. This method completely relies on feature learning of labeled samples, and the alignment accuracy is heavily dependent on the label quality of the labeled samples. 3. This method also does not pay attention to the dynamic changes of entities over time and relationships, and the entity alignment effect needs to be improved. Summary of the invention
[0006] The purpose of the present invention is to provide an entity alignment method in a temporal knowledge graph based on adversarial learning and label propagation to improve the accuracy and robustness of entity alignment in order to address all or part of the above-mentioned problems.
[0007] The technical solution adopted by the present invention is as follows: A method for entity alignment in a temporal knowledge graph based on adversarial learning and label propagation, comprising: For the time series knowledge graphs to be aligned, iteratively learn entity labels containing relational and temporal semantic information from the entity-relational and time adjacency matrices in the time series knowledge graphs, respectively, to obtain the label entity embedding vectors of the two time series knowledge graphs; Based on adversarial learning, the degree perception of entities in the embedding vectors of each label entity is eliminated respectively, and the final entity embedding vectors of the two temporal knowledge graphs are obtained; Based on semi-supervised learning of equivalent entities in pre-aligned temporal knowledge graph samples, entity alignment is performed between the two final entity embedding vectors.
[0008] Furthermore, the method for constructing the adjacency matrix of entities, relations and time in the temporal knowledge graph includes: According to the {head entity, relationship, tail entity, timestamp} four-tuple contained in the time series knowledge graph , construct the entity-relationship adjacency matrix and the entity-time adjacency matrix , Indicates the number of head entities or tail entities, represents the number of relations, Indicates the number of timestamps; The entity-relationship adjacency matrix and the entity-time adjacency matrix Divided into head entity-relation adjacency matrix , relation-tail entity adjacency matrix , head entity-tail entity adjacency matrix , head entity-timestamp adjacency matrix and timestamp-tail entity adjacency matrix .
[0009] Furthermore, the iterative learning of entity labels containing relational and temporal semantic information includes: Based on the learning of entity labels containing relational and temporal semantic information of the pre-aligned temporal knowledge graph samples, from the adjacency matrix of entities, relations and time in the temporal knowledge graph to be aligned, Iteratively learn the label vectors of entity labels at the relational level and the temporal level respectively; Perform weighted fusion on the label vectors at the relationship level and the label vectors at the time level.
[0010] Furthermore, the iterative learning of the label vectors of the entity labels at the relational level and the time level respectively includes: The propagation method of the label vector at the relationship level is: , ; In the formula, Indicates the propagation level, Represents the label matrix of entities at the relation level, , Indicated in Random sampling is performed on the hypersphere. The label matrix representing the relationship, represents the dot product, is a zero matrix; Concatenate the label matrices of all layers propagated at the relation level to obtain the label vector of the entity label at the relation level; The propagation method of the label vector at the time level is: , ; In the formula, Represents the label matrix of the entity at the time level, , A label matrix representing timestamps, is a zero matrix; The label matrices of all layers propagated at the time level are concatenated to obtain the label vector of the entity label at the time level.
[0011] Furthermore, the degree perception of the entity in the embedding vector of each label entity is eliminated based on adversarial learning, which is eliminated by using a generative adversarial network; The generative adversarial network is trained using the pre-aligned temporal knowledge graph samples. During training, the generative adversarial network performs adversarial learning to eliminate degree perception on entities with different degree perception categories in the pre-aligned temporal knowledge graph samples; The generative adversarial network comprises a generator, a first discriminator and a second discriminator, wherein the generator generates a corresponding final label entity vector according to the label entity embedding vector of the entity, the first discriminator classifies the final label entity vectors corresponding to entities with high and medium degree perception, and the second discriminator classifies the final label entity vectors corresponding to entities with medium and low degree perception; After training, the generative adversarial network uses a generator to generate a corresponding final label entity vector based on the label entity embedding vector of the entity in the temporal knowledge graph to be aligned.
[0012] Furthermore, a method for classifying degree-aware categories of entities in the pre-aligned temporal knowledge graph sample includes: In the time series knowledge graph, entities with a degree perception higher than the first threshold are classified into a high degree category, entities with a degree perception between the second threshold and the first threshold are classified into a medium degree category, and entities with a degree perception lower than the second threshold are classified into a low degree category; wherein, The first threshold is: avg+std, and the second threshold is: avg-std; wherein avg is the average value of the degree perception of all entities in the pre-aligned temporal knowledge graph sample, and std is the standard deviation of the degree perception of all entities in the pre-aligned temporal knowledge graph sample.
[0013] Furthermore, the loss function of the first discriminator during training is: , In the formula, The first discriminator of loss, represents a collection of highly categorical entities, represents the number of entities in the highly categorical entity set, represents a set of medium-class entities, represents the number of entities in the medium category entity set, represents the first discriminator The generator of the generative adversarial network is Entities Generated entity embeddings The probability of being classified into the height category; The loss function of the second discriminator during training is: , In the formula, The second discriminator of loss, represents a set of low-degree category entities, represents the number of entities in the low-degree category entity set, represents the second discriminator The generator of the generative adversarial network is Entities Generated entity embeddings The probability of being classified as a low-degree class.
[0014] Furthermore, the iterative learning process of entity labels containing relational and temporal semantic information and the adversarial learning process of eliminating the degree perception of entities in the embedding vectors of each label entity are trained using the adversarial joint training method, including: With the goal of minimizing the adversarial learning objective function, based on the pre-aligned temporal knowledge graph samples, iteratively perform an iterative learning process of entity labels containing relational and temporal semantic information, and an adversarial learning process of respectively eliminating the degree perception of entities in the embedding vectors of each label entity; in the adversarial learning process, the first discriminator and the second discriminator are trained alternately with the goal of minimizing the loss of the first discriminator and the second discriminator; The adversarial learning objective function is: , In the formula, represents the iterative learning loss of entity labels containing relational and temporal semantic information, is the joint learning weight set.
[0015] Furthermore, the semi-supervised learning based on equivalent entities in the pre-aligned time-series index graph samples includes: With the goal of minimizing the semi-supervised loss function, two translation matrices are learned from the final entity embedding vectors of each pair of equivalent entities in the pre-aligned temporal index graph samples. The two translation matrices transfer one final entity embedding vector to the space of another final entity embedding vector respectively.
[0016] Furthermore, the semi-supervised loss function is: , In the formula, represents the semi-supervised loss, and Represent two translation matrices respectively, represents the alignment seed set, and Represent the two final entity embedding vectors, Represents the use of translation matrix Embed the final entity into a vector Transfer to the final entity embedding vector space, Represents the use of translation matrix Embed the final entity into a vector Transfer to the final entity embedding vector space, It means to find the L2 norm.
[0017] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: The present invention fully considers the dynamic evolution characteristics of entities in the time series knowledge graph through iterative learning of entity features in the relationship and time series dimensions, making up for the defect that entities will change over time and relationships, which affects the accuracy of entity alignment. In addition, the present invention eliminates the degree perception (i.e., entity degree) of the iteratively propagated entity embedding vector, solves the negative impact of degree perception on the entity alignment task, and improves the accuracy and robustness of entity alignment in the time series knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The present invention will now be described by way of example with reference to the accompanying drawings, in which: Figure 1 This is the architecture diagram of the temporal knowledge graph entity alignment model.
[0019] Figure 2 It is a flowchart of entity alignment in temporal knowledge graph. DETAILED DESCRIPTION
[0020] All features disclosed in this specification, or steps in all methods or processes disclosed, except mutually exclusive features and / or steps, can be combined in any manner.
[0021] Any feature disclosed in this specification (including any additional claims and abstract), unless otherwise stated, may be replaced by other alternative features that are equivalent or have similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.
[0022] See also Figure 1 and Figure 2 , the embodiment of the present application provides a method for entity alignment in a temporal knowledge graph based on adversarial learning and label propagation, comprising the following steps: Step 1: For the time series knowledge graphs to be aligned (entity alignment), iteratively learn the entity labels containing relational and temporal semantic information from the adjacency matrices of entities, relations and time in the time series knowledge graphs, and obtain the label entity embedding vectors of the two time series knowledge graphs.
[0023] The pre-aligned temporal knowledge graph sample is assumed to be the first temporal knowledge graph and the second temporal knowledge graph , each element in the temporal knowledge graph is presented in the form of a quadruple, expressed as ,in Represents the head entity, Indicates relationship, Represents the tail entity, Indicates a timestamp. The time series knowledge graph to be aligned is also stored in this element format. In the embodiment of the present application, for the pre-aligned time series knowledge graph, an alignment seed set is provided. ,in Indicates equivalence, That is, it represents the entities in two pre-aligned temporal knowledge graph samples and The task of entity alignment is to train the first temporal knowledge graph based on the alignment seed set. and the second temporal knowledge graph Find new equivalent entity pairs in .
[0024] In step one, the following sub-steps are included: 1) Data preprocessing.
[0025] In this data preprocessing stage, the adjacency matrix of entities, relations and time in the time series knowledge graph is constructed, which is the same for the pre-aligned time series knowledge graph samples or the time series knowledge graph to be aligned. Specifically, it includes the following processes: According to the four ancestors of the temporal knowledge graph , construct the entity-relationship adjacency matrix and the entity-time adjacency matrix , Indicates the size of the entity set, that is, the number of head entities or tail entities (the two are equal), represents the number of relations, Represents the number of timestamps. For example, the build process includes: Initialize the entity-relationship adjacency matrix For one The zero matrix of And every relationship , if there is a relationship Connect the entity pairs, then set Increase by 1. If the relationship of the temporal knowledge graph is symmetrical, then Increase by 1, and normalize each row after construction. For the entity-time adjacency matrix , the construction process is the same, that is, the relationship between Replace with timestamp .
[0026] In constructing the entity-relationship adjacency matrix and the entity-time adjacency matrix Based on this, the two adjacency matrices are divided into head entity-relation adjacency matrices , relation-tail entity adjacency matrix , head entity-tail entity adjacency matrix , head entity-timestamp adjacency matrix and timestamp-tail entity adjacency matrix .
[0027] 2) Iterative propagation learning.
[0028] This sub-step requires using entity labels at both the relational and temporal levels to update entity, relational, and temporal labels. Specifically, it includes the following processes: Based on the learning of entity labels containing relational and temporal semantic information of pre-aligned temporal knowledge graph samples, the adjacency matrix between entities, relations and time in the temporal knowledge graph to be aligned is obtained. Iteratively learn the label vectors of entity labels at the relational level and the temporal level respectively; Perform weighted fusion on the label vectors at the relationship level and the label vectors at the time level.
[0029] In some embodiments, the method for propagating the label vector at the relationship level is: , ; In the formula, Indicates the propagation level, Represents the label matrix of entities at the relation level, , Indicated in dimensional hypersphere, where Represents the sampling dimension used to approximate the initial unique hot label vector of the entity, that is, in the iterative learning process, for each entity Randomly assign an initialized Dimensional label vector Since the training is to learn the entity labels containing relational and temporal semantic information of the pre-aligned temporal knowledge graph samples, during training, for each pair of equivalent entities ,have . The label matrix representing the relationship, represents the dot product, because there is no equivalent relationship pair in the pre-aligned temporal knowledge graph samples, so The label matrix is initialized to a zero matrix.
[0030] Entity As an example, according to the above method, the label matrix of the entity at the relationship level can be iteratively propagated at multiple propagation levels to obtain Then concatenate the label matrices of all layers propagated at the relational level to obtain the label vector of the entity label at the relational level. : .
[0031] The propagation method of label vectors at the time level is: , ; In the formula, Represents the label matrix of the entity at the time level, , The label matrix representing the timestamp, because there is no equivalent time pair in the pre-aligned temporal knowledge graph samples, The label matrix is initialized to a zero matrix.
[0032] According to the above method, the label matrix of the entity at the time level can be iteratively propagated at multiple propagation levels to obtain Similarly, concatenating the label matrices of all layers propagated at the time level obtains the label vector of the entity label at the time level : .
[0033] Perform weighted fusion on the label vectors at the relationship level and the label vectors at the time level: , In the formula, is the fusion weight of the label vector at the relationship level, which is a hyperparameter.
[0034] Step 2: Based on adversarial learning, the degree perception of entities in the embedding vectors of each label entity is eliminated to obtain the final entity embedding vectors of the two time series knowledge graphs.
[0035] For entity alignment, entities with similar semantic information should be closer, regardless of the influence of entity degree perception. Therefore, in step 2 of the embodiment of the present application, the influence of entity degree perception in each tag entity embedding vector on entity alignment is eliminated. The entity degree perception is the degree perception of the entity in the entity-relationship adjacency matrix. The number of non-zero elements in the row corresponding to the entity in .
[0036] In some embodiments, a generative adversarial network is used to eliminate the degree perception of entities in each label entity embedding vector, and the generative adversarial network is trained using pre-aligned temporal knowledge graph samples.
[0037] Generate adversarial network for pre-aligned temporal knowledge graph samples ( or ), design two discriminators to In the embodiment of the present application, the degree perception of the entity is divided into three levels, namely: high category, medium category and low category. The goal of the generative adversarial network is to transform the label entity embedding vector by its generator so that the discriminator of the generative adversarial network cannot accurately classify the entity according to the degree perception of the entity, thereby eliminating the degree perception of the entity from the label entity embedding vector and obtaining the final entity embedding vector.
[0038] For the classification of the perception of entities in the pre-aligned temporal knowledge graph samples, in some embodiments, the method includes: Calculate the average avg and standard deviation std of the degree perception of all entities in the pre-aligned temporal knowledge graph samples, define the first threshold: avg+std, and the second threshold: avg-std, obviously the second threshold is lower than the first threshold. Use the first threshold and the second threshold to classify each entity into a high-degree category, a medium-degree category, or a low-degree category: in the pre-aligned temporal knowledge graph samples, entities with a degree perception higher than the first threshold are classified into a high-degree category, entities with a degree perception between the second threshold and the first threshold are classified into a medium-degree category, and entities with a degree perception lower than the second threshold are classified into a low-degree category.
[0039] In step 2, during training, a generative adversarial network is used to perform adversarial learning to eliminate degree-aware entities of different degree-aware categories in the pre-aligned temporal knowledge graph samples. In some embodiments, the generative adversarial network includes a generator and two discriminators: a first discriminator and the second discriminator , where the generator generates the corresponding final label entity vector according to the label entity embedding vector of the entity, and the first discriminator The second discriminator classifies the final label entity vectors corresponding to entities with high and medium degree perception. The final label entity vectors corresponding to entities with medium and low degree perception are classified.
[0040] In some embodiments, each discriminator adopts a cascade structure of three fully connected layers, the initial input layer contains 128 nodes, and the dimension is reduced to 32 nodes layer by layer after two hidden layers. Each hidden layer uses ReLU (Rectified Linear Unit) activation function to introduce the nonlinear mapping ability of the model. The relationship between the layers is described as follows: , , ; in, represents the 128-dimensional entity embedding vector input from the generator, and Respectively The weights and biases of the fully connected layers, For the The activation value of the fully connected layer.
[0041] In the output layer of the discriminator, the Softmax activation function is used to configure two output neurons to generate the probability distribution of the corresponding entity category.
[0042] In some embodiments, for both discriminators, a sparse cross entropy loss function is used as the loss function for training.
[0043] The loss function of the first discriminator during training is: , In the formula, The first discriminator of loss, represents a collection of highly categorical entities, represents the number of entities in the highly categorical entity set, represents a set of medium-class entities, represents the number of entities in the medium category entity set, represents the first discriminator The generator of the generative adversarial network is Entities Generated entity embeddings The probability of being classified as a high class is The first discriminator The generator of the generative adversarial network is Entities Generated entity embeddings The probability of being classified as moderate.
[0044] The loss function of the second discriminator during learning is: , In the formula, The second discriminator of loss, represents a set of low-degree category entities, represents the number of entities in the low-degree category entity set, represents the second discriminator The generator of the generative adversarial network is Entities Generated entity embeddings The probability of being classified as a low-degree class, That means the second discriminator The generator of the generative adversarial network is Entities Generated entity embeddings The probability of being classified as moderate.
[0045] Both discriminators learn by minimizing the loss function during training.
[0046] For the iterative learning of entity labels in step 1 and the adversarial learning of eliminating entity degree perception in step 2, since both are the processing process of entity embedding before entity alignment, that is, both serve the generation of the final entity label vector, in the embodiment of the present application, the iterative learning process of entity labels containing relational and temporal semantic information and the adversarial learning process of eliminating the degree perception of entities in the embedding vectors of each label entity are trained using the adversarial joint training method. That is, iterative learning and adversarial learning are completed in the same round of iteration.
[0047] Specifically, the process includes: With the goal of minimizing the adversarial learning objective function, based on the pre-aligned temporal knowledge graph samples (i.e. as the training data set), the iterative learning process of the entity labels containing relational and temporal semantic information and the adversarial learning process of eliminating the degree perception of the entity in the embedding vector of each label entity are iteratively carried out. In the adversarial learning process, the first discriminator and the second discriminator are trained alternately with the goal of minimizing their losses. The adversarial learning objective function is: , In the formula, represents the iterative learning loss of entity labels containing relational and temporal semantic information, namely, label propagation loss, Expressed as ,in represents the initial label entity embedding vector, Represents the label entity embedding vector obtained after i rounds of iterations; Expressed as or ; Expressed as or ; is the joint learning weight set.
[0048] The goals of adversarial joint learning are: .
[0049] In this way, in the adversarial joint training process of iterative learning and adversarial learning with minimizing the adversarial learning objective function, the label propagation loss and the adversarial loss are optimized simultaneously during the generator training process.
[0050] Through step one and step two, the final entity embedding vectors of the temporal knowledge graph to be aligned are obtained respectively.
[0051] Step 3: Based on the semi-supervised learning of (the final entity embedding vectors of) equivalent entities in the pre-aligned temporal knowledge graph samples, entity alignment is performed between the final entity embedding vectors of the two temporal knowledge graphs to be aligned.
[0052] In some embodiments, the process of semi-supervised learning aims to minimize the semi-supervised loss function, and learns two translation matrices from equivalent entities in two final entity embedding vectors. The two translation matrices respectively transfer one final entity embedding vector to the space of another final entity embedding vector, that is, one translation matrix transfers the previous final entity embedding vector to the space of the next final entity embedding vector, and the other translation matrix transfers the next final entity embedding vector to the previous final entity embedding vector.
[0053] The semi-supervised loss function is defined as: , In the formula, represents the semi-supervised loss, and Represent two translation matrices respectively, and Represent the two final entity embedding vectors, Represents the use of translation matrix Embed the final entity into a vector Transfer to the final entity embedding vector space, Represents the use of translation matrix Embed the final entity into a vector Transfer to the final entity embedding vector space, It means to find the L2 norm and normalize the entity embedding vector.
[0054] That is, according to the embodiment of the present application, in the design of the alignment seed combination Based on the pre-aligned temporal knowledge graph samples (sets), the entity labels containing relational and temporal semantic information of each pre-aligned temporal knowledge graph sample are iteratively learned, and adversarial learning is performed with the goal of eliminating the entity degree perception of each pre-aligned temporal knowledge graph sample. Preferably, iterative learning and adversarial learning sampling adversarial joint training are performed. Semi-supervised learning is performed on the equivalent entity pairs in the pre-aligned temporal knowledge graph samples to obtain two translation matrices. In this way, for the temporal knowledge graphs to be aligned, the label entity embedding vectors of the two temporal knowledge graphs can be obtained respectively based on the results of iterative learning, and then based on the results of adversarial learning, the final entity embedding vector with degree perception eliminated is generated from the label entity embedding vector. Finally, the two final entity embedding vectors are aligned using the two learned translation matrices.
[0055] In some embodiments, during the semi-supervised learning process, an SGD (Stochastic Gradient Descent) optimizer is used for optimization to align equivalent entities in the alignment seed set at a point where the semi-supervised loss function is minimized.
[0056] The embodiment of the present application also verifies the performance of the provided method. This embodiment uses two benchmark datasets DICEWS-1K / 200 and YAGO-wiki50k-5k / 1K to evaluate the entity alignment results. DICEWS-1K / 200 is built based on the event knowledge graph ICEWS05-15 containing events from 2005 to 2015. It consists of two subsets with different alignment seeds 1K / 200. YAGO-WIKI50k-5k / 1K extracts equivalent entities with time information from YAGO and Wikidata, and has two subsets, one with 5K alignment seeds and the other with 1K alignment seeds.
[0057] The evaluation indicators of the model are: and (Percentage of correct test results ranked in the top 1 / 3 / 10). It is the average reciprocal ranking, and the specific calculation method is as follows: , in, is a set of four tuples, is the number of quadruple sets, For the The predicted ranking of the entity of the quadruple is the number of the true value in the prediction list.
[0058] It refers to the average proportion of quadruplets ranked less than n in link prediction. The specific calculation method is as follows: , in, It is an indicator function. If the condition is true, the function value is 1, otherwise it is 0.
[0059] In order to evaluate the effectiveness of the model, this paper uses a variety of representative temporal knowledge graph entity alignment methods as benchmark models. This method selects a variety of models for comparison, mainly MTransE, AlignE, JAPE, GCN-Align, MRAEA, LighrEA and TEA-GNN. The comparison results are shown in Table 1.
[0060] Table 1 Comparison of model indicators (values before decimal point 0 omitted)
[0061] As shown in Table 1, this technical solution has achieved good performance in most cases. On the DICEWS-1K dataset, compared with the comparison method, the method of the embodiment of the present application is 1.2%, 2.0%, and 0.4% higher than the best performance model in the three evaluation indicators of MRR, Hits@1, and Hits@10, respectively; on the DICEWS-200 dataset, compared with the comparison method, the three evaluation indicators of MRR, Hits@1, and Hits@10 are improved by 1.7%, -3.3%, and 1.7%, respectively, and the Hits@1 evaluation indicator is slightly lower, but compared with other benchmark models, there is a certain improvement; on the YAG On the O-WIKI50k-5k dataset, compared with the comparative method, the method of the embodiment of the present application is 0.6%, 0.7%, and -1.4% higher than the best performing model in the three evaluation indicators of MRR, Hits@1, and Hits@10, respectively, and slightly lower in the Hits@10 evaluation indicator, but has certain improvements compared with other benchmark models; it can be seen that the present application iteratively learns the semantic influence of temporal relationships on entities, and uses adversarial learning to ignore the influence of degree perception on entity embedding, thereby effectively improving the accuracy and robustness of the temporal knowledge graph entity alignment task.
[0062] The present invention is not limited to the above-mentioned specific embodiments, but extends to any new features or any new combination disclosed in this specification, as well as any new method or process steps or any new combination disclosed.
Claims
1. A method for entity alignment in temporal knowledge graphs based on adversarial learning and label propagation, characterized in that: include: For the time series knowledge graphs to be aligned, iteratively learn entity labels containing relational and temporal semantic information from the entity-relational and time adjacency matrices in the time series knowledge graphs, respectively, to obtain the label entity embedding vectors of the two time series knowledge graphs; Based on adversarial learning, the degree perception of entities in the embedding vectors of each label entity is eliminated respectively, and the final entity embedding vectors of the two temporal knowledge graphs are obtained; Based on semi-supervised learning of equivalent entities in pre-aligned temporal knowledge graph samples, entity alignment is performed between the two final entity embedding vectors.
2. The entity alignment method in the temporal knowledge graph based on adversarial learning and label propagation according to claim 1, characterized in that: The methods for constructing the adjacency matrix of entities, relationships and time in the temporal knowledge graph include: According to the {head entity, relationship, tail entity, timestamp} four-tuple contained in the time series knowledge graph , construct the entity-relationship adjacency matrix and the entity-time adjacency matrix , Indicates the number of head entities or tail entities, represents the number of relations, Indicates the number of timestamps; The entity-relationship adjacency matrix and the entity-time adjacency matrix Divided into head entity-relation adjacency matrix , relation-tail entity adjacency matrix , head entity-tail entity adjacency matrix , head entity-timestamp adjacency matrix and timestamp-tail entity adjacency matrix .
3. The entity alignment method in the temporal knowledge graph based on adversarial learning and label propagation as claimed in claim 2, characterized in that: The iterative learning of entity labels containing relational and temporal semantic information includes: Based on the learning of entity labels containing relational and temporal semantic information of the pre-aligned temporal knowledge graph samples, from the adjacency matrix of entities, relations and time in the temporal knowledge graph to be aligned, Iteratively learn the label vectors of entity labels at the relational level and the temporal level respectively; Perform weighted fusion on the label vectors at the relationship level and the label vectors at the time level.
4. The entity alignment method in the temporal knowledge graph based on adversarial learning and label propagation as claimed in claim 3 is characterized in that: The iterative learning of the label vectors of the entity labels at the relational level and the temporal level respectively includes: The propagation method of the label vector at the relationship level is: , ; In the formula, Indicates the propagation level, Represents the label matrix of entities at the relation level, , Indicated in Random sampling is performed on the hypersphere. The label matrix representing the relationship, represents the dot product, is a zero matrix; Concatenate the label matrices of all layers propagated at the relation level to obtain the label vector of the entity label at the relation level; The propagation method of the label vector at the time level is: , ; In the formula, Represents the label matrix of the entity at the time level, , A label matrix representing timestamps, is a zero matrix; The label matrices of all layers propagated at the time level are concatenated to obtain the label vector of the entity label at the time level.
5. The entity alignment method in the temporal knowledge graph based on adversarial learning and label propagation as claimed in claim 2, characterized in that: The degree perception of entities in the embedding vectors of each label entity is eliminated based on adversarial learning, and the elimination is performed using a generative adversarial network; The generative adversarial network is trained using the pre-aligned temporal knowledge graph samples. During training, the generative adversarial network performs adversarial learning to eliminate degree perception on entities with different degree perception categories in the pre-aligned temporal knowledge graph samples; The generative adversarial network comprises a generator, a first discriminator and a second discriminator, wherein the generator generates a corresponding final label entity vector according to the label entity embedding vector of the entity, the first discriminator classifies the final label entity vectors corresponding to entities with high and medium degree perception, and the second discriminator classifies the final label entity vectors corresponding to entities with medium and low degree perception; After training, the generative adversarial network uses a generator to generate a corresponding final label entity vector based on the label entity embedding vector of the entity in the temporal knowledge graph to be aligned.
6. The entity alignment method in the temporal knowledge graph based on adversarial learning and label propagation as claimed in claim 5, characterized in that: The method for classifying the degree-aware categories of entities in the pre-aligned temporal knowledge graph sample includes: In the time series knowledge graph, entities with a degree perception higher than the first threshold are classified into a high degree category, entities with a degree perception between the second threshold and the first threshold are classified into a medium degree category, and entities with a degree perception lower than the second threshold are classified into a low degree category; wherein, The first threshold is: avg+std, and the second threshold is: avg-std; wherein avg is the average value of the degree perception of all entities in the pre-aligned temporal knowledge graph sample, and std is the standard deviation of the degree perception of all entities in the pre-aligned temporal knowledge graph sample.
7. The entity alignment method in the temporal knowledge graph based on adversarial learning and label propagation as claimed in claim 5, characterized in that: The loss function of the first discriminator during training is: , In the formula, The first discriminator of loss, represents a collection of highly categorical entities, represents the number of entities in the highly categorical entity set, represents a set of medium-class entities, represents the number of entities in the medium category entity set, represents the first discriminator The generator of the generative adversarial network is Entities Generated entity embeddings The probability of being classified into the height category; The loss function of the second discriminator during training is: , In the formula, The second discriminator of loss, represents a set of low-degree category entities, represents the number of entities in the low-degree category entity set, represents the second discriminator The generator of the generative adversarial network is Entities Generated entity embeddings The probability of being classified as a low-degree class.
8. The entity alignment method in the temporal knowledge graph based on adversarial learning and label propagation as claimed in claim 7, characterized in that: The iterative learning process of entity labels containing relational and temporal semantic information and the adversarial learning process of eliminating the degree perception of entities in the embedding vectors of each label entity are trained using the adversarial joint training method, including: With the goal of minimizing the adversarial learning objective function, based on the pre-aligned temporal knowledge graph samples, iteratively perform an iterative learning process of entity labels containing relational and temporal semantic information, and an adversarial learning process of respectively eliminating the degree perception of entities in the embedding vectors of each label entity; in the adversarial learning process, the first discriminator and the second discriminator are trained alternately with the goal of minimizing the loss of the first discriminator and the second discriminator; The adversarial learning objective function is: , In the formula, represents the iterative learning loss of entity labels containing relational and temporal semantic information, is the joint learning weight set.
9. The entity alignment method in a temporal knowledge graph based on adversarial learning and label propagation as claimed in claim 1, characterized in that: The semi-supervised learning based on equivalent entities in pre-aligned time-series index graph samples includes: With the goal of minimizing the semi-supervised loss function, two translation matrices are learned from the final entity embedding vectors of each pair of equivalent entities in the pre-aligned temporal index graph samples. The two translation matrices transfer one final entity embedding vector to the space of another final entity embedding vector respectively.
10. The entity alignment method in the temporal knowledge graph based on adversarial learning and label propagation according to claim 9, characterized in that: The semi-supervised loss function is: , In the formula, represents the semi-supervised loss, and Represent two translation matrices respectively, represents the alignment seed set, and Represent the two final entity embedding vectors, Represents the use of translation matrix Embed the final entity into a vector Transfer to the final entity embedding vector space, Represents the use of translation matrix Embed the final entity into a vector Transfer to the final entity embedding vector space, It means to find the L2 norm.
Citation Information
Patent Citations
Unsupervised entity alignment method and device for time sequence knowledge graph
CN115658927A
Model training method, entity alignment method, device, equipment, medium and product
CN118690845A
