Methods, devices, equipment, and media for self-supervised learning of knowledge graph entity alignment
Patent Information
- Application Number
- CN202410220176.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-28
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2044-02-28
AI Technical Summary
当前大多数知识图谱对其模型的主要不足之处在于:(1)没有充分利用图结构信息进行高效融合,忽略了关系信息、属性信息在实体对齐中发挥的重要作用,导致对齐性能不佳;(2)无法在自监督的实体对齐框架中充分利用与整合图结构信息
[0082]综上所述,与现有技术相比,本发明具有如下有益效果:本发明充分利用图结构信息进行高效融合,利用关系信息和属性信息与实体进行嵌入融合,经注意力机制与标准化后,送入图卷积网络,获得实体图嵌入向量集合,将实体图嵌入向量集合进行交互对比学习与迭代优化,生成最优的正实体对集合,进而得到训练好的知识图谱实体对齐模型。该知识图谱实体对齐方法充分考虑知识图谱的多视图信息,利用图神经网络和知识图谱嵌入技术的多视图图像分类技术,有效地整合不同视角之间的信息,提高分类精度。在自监督的实体对齐框架中,本发明充分利用与整合图结构信息进行高效融合,提高了知识图谱中实体对齐的准确度与通用性,具有极高的应用价值。
Smart Images

Figure CN118036728B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing methods, and more specifically, to a method, apparatus, device, and medium for self-supervised learning of knowledge graph entity alignment. Background Technology
[0002] Knowledge graph entity alignment is a crucial and challenging task in natural language processing. Its purpose is to align equivalent entities from different knowledge graphs, enabling multiple knowledge graphs to complement each other and thus improve the quality of the knowledge graph, achieving knowledge fusion and integration. The main shortcomings of most current knowledge graph models are: (1) they do not fully utilize graph structure information for efficient fusion, neglecting the important role of relational and attribute information in entity alignment, resulting in poor alignment performance; (2) they cannot fully utilize and integrate graph structure information within a self-supervised entity alignment framework. Therefore, to address these problems and deficiencies, there is an urgent need for a knowledge graph entity alignment method that can fully utilize and integrate graph structure information for efficient fusion within a self-supervised entity alignment framework.
[0003] In view of this, the applicant hereby submits this application after studying the existing technology. Summary of the Invention
[0004] This invention aims to provide a method, apparatus, device, and medium for self-supervised learning of entity alignment in knowledge graphs. In the framework of self-supervised entity alignment, this invention makes full use of the integrated graph structure information for efficient fusion, thereby improving the accuracy of entity alignment in knowledge graphs.
[0005] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution:
[0006] A self-supervised learning method for knowledge graph entity alignment includes:
[0007] S1. Connect two heterogeneous standard terminology knowledge graphs to obtain a new knowledge graph. The new knowledge graph includes an entity set, a relation set, an attribute set, and an attribute value set. The entity set includes a head entity and a tail entity. Generate a set of relation triples based on the entity set and the relation set. Generate a set of attribute triples based on the entity set, the attribute set, and the attribute value set. The relation triples represent head entities and tail entities connected by relations. The attribute triples represent attribute head entities, attributes, and the corresponding attribute values. Use a word embedding function to embed the entity set and attribute value set of the new knowledge graph into embedding vectors to obtain initial entity embedding vectors and initial attribute value embedding vectors.
[0008] S2, calculate and sum the initial entity embedding vectors corresponding to the head and tail entities of each relation triple by multiplying them with the corresponding weight parameters, and then perform vector concatenation and activation to obtain relation embedding vectors. Calculate the relation-aware attention coefficient of the tail entity to the head entity. After standardizing the relation-aware attention coefficient, aggregate it with the initial entity embedding vector of the tail entity to obtain the entity relation aggregate embedding vector. Mix all the initial entity embedding vectors with the relation aggregate embedding vector to obtain the entity hybrid relation embedding set.
[0009] S3, calculate the dot product of the attribute head entity and the embedding vector corresponding to the attribute value of each attribute triple with the corresponding weight parameters, sum the results, and then perform vector concatenation and activation to obtain the attribute embedding vector. Calculate the attribute perception attention of the attribute head entity to the attribute value to obtain the attribute perception attention coefficient. After standardizing the attribute perception attention coefficient, aggregate it with the embedding vector corresponding to the attribute value to obtain the attribute aggregate embedding vector of the entity. Mix all the initial entity embedding vectors with the attribute aggregate embedding vector to obtain the entity hybrid attribute embedding set.
[0010] S4, The entity hybrid relation embedding set and the entity hybrid attribute value embedding set are fed into the graph convolutional network to obtain the entity graph embedding vector set of the new knowledge graph;
[0011] S5, the entity graph is embedded into the vector set for interactive comparative learning and iterative optimization to generate the optimal set of positive entity pairs, thereby obtaining a trained knowledge graph entity alignment model, which is used to perform entity alignment on any two input standard term knowledge graphs according to the trained knowledge graph entity alignment model.
[0012] Preferably, two heterogeneous standard terminology knowledge graphs are defined as G1 = (E1, R1, M1, V1, T1, K1) and G2 = (E2, R2, M2, V2, T2, K2), and S1 specifically includes:
[0013] S11, Connecting G1 and G2 yields the new knowledge graph G, whose expression is:
[0014] G=G1∪G2=(E,R,M,V,T,K),
[0015] Where E = E1∪E2 represents the entity set; R = R1∪R2 represents the relation set; M = M1∪M2 represents the attribute set; V = V1∪V2 represents the attribute value set; T = T1∪T2, This represents the set of relation triples consisting of head and tail entities connected by a relation; K = K1∪K2. A set of attribute triples consisting of an entity, an attribute, and the value attribute corresponding to that attribute;
[0016] S12, The entity set E is expressed as an embedding vector using a word embedding function, and e is defined. i For the i-th entity, For entity e i The initial embedding vector of the entity is given by the following formula:
[0017]
[0018] in, The initial entity embedding vector sequence represents all initial entity embedding vectors. `word_embed(·)` represents the word embedding function. i ∈E, |E| represents the size of the entity set E, and d represents the dimension of all the initial embedding vectors of the entities;
[0019] S13, The word embedding function is used to embed the attribute value set V into an embedding vector representation, and v is defined. i For the i-th attribute value, For v i The initial embedding vector for the attribute values is given by the following formula:
[0020]
[0021] in, The sequence of initial embedding vectors for all attribute values, v i ∈V, |V| represents the size of the attribute value set V.
[0022] Preferably, S2 specifically includes:
[0023] S21, for each relation r t ∈R compute relation head entity e i With tail entity e j The scale will e i Entity initial embedding vector With weight parameters After performing dot product calculation, the summation is performed, and the summation vector is divided by the number of head entities to obtain the head entity relationship embedding vector.
[0024] Each tail entity e j Entity initial embedding vector With weight parameters After performing dot product calculation, the results are accumulated and summed. The accumulated sum vector is divided by the number of tail entities to obtain the tail entity relationship embedding vector.
[0025] After concatenating the head entity relationship embedding vector and the tail entity relationship embedding vector, the relationship embedding vector is obtained through an activation function. The calculation formula is as follows:
[0026]
[0027] in, Representing relation r respectively t Head entity e i Combined tail entity e j The initial embedding vector of the entity, |H t | Represents the relation r t Head entity e i The set H t The scale, |T t | Represents the relation r t tail entity e j set T t scale Represents the head entity e i The weight parameters, Represents tail entity e j The weight parameters are: || is the vector concatenation operator, and σ is the activation function.
[0028] S22, Calculate the tail entity e j Head entity e i Regarding the importance value of relation triples, i.e., the relation-aware attention coefficient The formula is as follows:
[0029]
[0030] Among them att relation (·) denotes the relation-aware attention function. It is the head entity e i Relationship r t Tail entity e j The relational triples formed;
[0031] S23, The Softmax function is used to adjust the relationship-aware attention coefficient. Standardization is performed to obtain the standardized relation-perceived attention coefficient. The calculation formula is as follows:
[0032]
[0033] in It is an attention parameter. Represents entity e i Neighbor e k The set, It is entity e i The initial embedding vector, It is entity e k The initial embedding vector, where η is the decay factor and ⊙ is the product operator;
[0034] S24, the standardized relation-aware attention coefficient With tail entity e j Entity initial embedding vector Aggregation yields entity-relation aggregation embedding vectors. The formula is as follows:
[0035]
[0036] in, X se Let σ be the set of entity relation aggregation embeddings for the knowledge graph G, where σ is the activation function.
[0037] S25, Mix the initial embedding vector sequence X of the entity e The entity relationship is aggregated and embedded in the set X. se Obtain the entity hybrid relationship embedding set X see The formula is as follows:
[0038] X see =β1X se +X e ,
[0039] Where β1 is X se With X e The trade-off parameters.
[0040] Preferably, S3 specifically includes:
[0041] S31, For each attribute triple, calculate the size of the attribute head entity and the size of each attribute m. g The corresponding attribute value v k The size, then the attribute header entity e h Entity initial embedding vector With entity weight parameters After performing dot product calculations, the results are summed. The summed vector is then divided by the size of the head entity to obtain the head entity attribute embedding vector.
[0042] Embed the attribute value corresponding to each attribute into a vector. With attribute value weight parameters After performing dot product calculations, sum the results and divide the summed vector by the attribute value scale to obtain the attribute embedding vector corresponding to the attribute value.
[0043] Then, the head entity attribute embedding vector is concatenated with the attribute embedding vector of the corresponding attribute value, and then the attribute embedding vector is obtained by applying an activation function. The calculation formula is as follows:
[0044]
[0045] in This indicates that the entity e is represented by the attribute header. h Attribute m g Attribute value v k The attribute triples formed. X m This represents the embedding vector of all attributes. Represents the attribute header entity e h The initial embedding vector of the entity. H g Represents the attribute header entity e h The set, |H g | represents set H g The scale, V g Indicates the attribute value v k The set, Indicates the attribute value v k The corresponding attribute value embedding vector, |V g | represents set V g scale These represent the weight parameters of the entity and attribute values, respectively; || is the vector concatenation operator; σ is the activation function; and m g ∈M;
[0046] S32, an attention mechanism is used to calculate the attribute-aware attention of the attribute value to the head entity, and the attribute-aware attention coefficient is obtained. And the attribute-aware attention coefficient Standardize and define For the set of attribute triples (e p ,m g ,v q )∈K, the formula is as follows:
[0047]
[0048] in, These represent the attribute header entity e respectively. p Attribute m g Attribute value v q The corresponding embedding vector, It is an attention parameter. Represents entity e p The set of attribute values, where η is the decay factor and ⊙ is the product operator;
[0049] S33, combined with the attribute-aware attention coefficient With attribute value embedding vector Obtain entity e p Attribute aggregation embedding vector The formula is as follows:
[0050]
[0051] in, X ce Embedded collections for attribute aggregation;
[0052] S34, Mix the initial embedding vector sequence X of the entity e With the attribute aggregation embedding set X ce Obtain the embedded set X of the entity's mixed attribute values. cee The formula is as follows:
[0053] X cee =β2X ce +X e
[0054] Among them, X ce It is a set of embedded mixed attribute values, where β2 is X. ce With X e The trade-off parameters.
[0055] Preferably, the calculation formula for the graph convolutional network is as follows:
[0056]
[0057]
[0058] X sc =T(X) (f,l) )⊙X (f,l) +(1-T(X (f,l) ))⊙X (f,l-1) ,
[0059] Where f = {see,cee} represents the hybrid relation embedding set X see and the set X of the hybrid attribute values cee Indicator, It is the adjacency matrix of the knowledge graph G with self-connections added, where I is the identity matrix. yes The degree matrix of the diagonal nodes, W (f,l) X represents the connection weight matrix parameters of the l-th layer. (f,l) This represents the output of the l-th layer. Let X represent the weight matrix and bias vector, respectively; σ and φ are the activation functions; T(·) is the transformation gate; and X... (f,l-1)This represents the output of the (l-1)th layer.
[0060] Preferably, the entity graph embedding vector set is iteratively optimized using a loss function until the convergence condition is met, and (e) is set. x ,e y )∈EA represents a positive entity pair, and the loss function The calculation formula is as follows:
[0061]
[0062] Where, x sc ,y sc ∈X sc Representing entity e respectively x ,e y The corresponding entity graph embedding vector, EA={(e x ,e y )|e x ∈E1,e y ∈E2,e x ≡e y}, ≡ represents the alignment symbol for two entities;
[0063] set up This indicates that it cannot be associated with entity e. x Aligned entity graph embedding vectors, i.e., negative entity vectors. Let represent the set of negative entity vectors, τ be the temperature hyperparameter, and B be the number of negative entities;
[0064] The expectation calculation is based on the set of negative entity vectors. The calculation shows that this set is independent and identically distributed with the knowledge graph G;
[0065] Define the set of negative entity vectors The scale threshold θ is limited by the following formula:
[0066] θ=(1+W)×Q <min((|E1|,|E2|)),
[0067] Where 1+W is the set of negative entity vectors in the current iteration batch. The size of Q is the loss function. The number of iteration batches.
[0068] Preferably, during the iterative optimization of the entity graph embedding vector set, the graph embedding vector set X is... sc The Manhattan distance between two entities is calculated using the following formula:
[0069]
[0070] Where, x sc ,y sc ∈X sc 1 represents entity e respectively x ,e y The corresponding entity graph embedding vector, where L1 represents the first-order Euclidean distance;
[0071] Then for entity e x Take the minimum distance d fm Second minimum distance d fs If d fm and d fs If the following threshold conditions are met, then e is selected. x and e m For positive entity pairs, where e m For entity e x Minimum distance d fm The corresponding entity, the threshold condition is as follows:
[0072]
[0073] Where σ1 and σ2 are the set threshold values.
[0074] The present invention also provides a knowledge graph entity alignment device for self-supervised learning, comprising:
[0075] An initial embedding module is used to connect two heterogeneous standard terminology knowledge graphs to obtain a new knowledge graph. The new knowledge graph includes an entity set, a relation set, an attribute set, and an attribute value set. The entity set includes a head entity and a tail entity. A set of relation triples is generated based on the entity set and the relation set. A set of attribute triples is generated based on the entity set, the attribute set, and the attribute value set. The relation triples represent head and tail entities connected by relations, and the attribute triples represent a head entity, an attribute, and its corresponding attribute value. A word embedding function is used to embed the entity set and the attribute value set of the new knowledge graph into initial embedding vectors to obtain initial entity embedding vectors and initial attribute value embedding vectors.
[0076] The relation aggregation embedding module is used to calculate and sum the initial entity embedding vectors corresponding to the head and tail entities of each relation triple by multiplying them with the corresponding weight parameters, and then perform vector concatenation and activation to obtain the relation embedding vector. The relation-aware attention coefficient of the tail entity to the head entity is calculated. The relation-aware attention coefficient is standardized and then aggregated with the initial entity embedding vector of the tail entity to obtain the entity relation aggregation embedding vector. All the initial entity embedding vectors and the relation aggregation embedding vector are mixed to obtain the entity hybrid relation embedding set.
[0077] The attribute aggregation and embedding module is used to calculate and sum the embedding vectors corresponding to the attribute head entity and attribute value of each attribute triple with the corresponding weight parameters, and then perform vector concatenation and activation to obtain the attribute embedding vector. The module calculates the attribute-aware attention coefficient of the attribute head entity to the attribute value, standardizes the attribute-aware attention coefficient, and then aggregates it with the embedding vector corresponding to the attribute value to obtain the attribute aggregation embedding vector of the entity. Finally, the module mixes all the initial entity embedding vectors with the attribute aggregation embedding vector to obtain the entity hybrid attribute embedding set.
[0078] The graph convolutional network module is used to feed the entity hybrid relation embedding set and the entity hybrid attribute value embedding set into the graph convolutional network to obtain the entity graph embedding vector set of the new knowledge graph.
[0079] The interactive comparison learning module is used to embed the entity graph into a vector set for interactive comparison learning and iterative optimization, generate the optimal set of positive entity pairs, and then obtain a trained knowledge graph entity alignment model, so as to perform entity alignment on any two input standard term knowledge graphs according to the trained knowledge graph entity alignment model.
[0080] The present invention also provides a knowledge graph entity alignment device for self-supervised learning, including a processor and a memory, wherein the memory stores a computer program that can be executed by the processor to implement a knowledge graph entity alignment method for self-supervised learning as described above.
[0081] The present invention also provides a computer-readable storage medium storing computer-readable instructions, which, when executed by a processor of the device on which the computer-readable storage medium resides, implement a self-supervised learning knowledge graph entity alignment method as described above.
[0082] In summary, compared with existing technologies, this invention has the following beneficial effects: This invention fully utilizes graph structure information for efficient fusion, embedding relational and attribute information with entities. After attention mechanisms and standardization, the data is fed into a graph convolutional network to obtain a set of entity graph embedding vectors. This set of entity graph embedding vectors undergoes interactive comparative learning and iterative optimization to generate an optimal set of positive entity pairs, thus obtaining a trained knowledge graph entity alignment model. This knowledge graph entity alignment method fully considers the multi-view information of the knowledge graph, effectively integrating information from different perspectives and improving classification accuracy by utilizing graph neural networks and multi-view image classification techniques of knowledge graph embedding technology. In a self-supervised entity alignment framework, this invention fully utilizes and integrates graph structure information for efficient fusion, improving the accuracy and universality of entity alignment in knowledge graphs, and has extremely high application value. Attached Figure Description
[0083] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.
[0084] Figure 1 This is a flowchart of a self-supervised learning knowledge graph entity alignment method provided in Embodiment 1 of the present invention.
[0085] Figure 2 This is a flowchart of a self-supervised learning knowledge graph entity alignment method provided in Embodiment 1 of the present invention.
[0086] Figure 3 The present invention provides a structural diagram of a knowledge graph entity alignment device for self-supervised learning according to Embodiment 2 of the present invention.
[0087] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Detailed Implementation
[0088] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0089] Example 1
[0090] like Figure 1 and Figure 2As shown, this invention provides a self-supervised learning knowledge graph entity alignment method, which can be implemented by a self-supervised learning knowledge graph entity alignment device (hereinafter referred to as entity alignment device). It is understood that the entity alignment device can be an electronic device with computing power, such as a laptop computer, desktop computer, server, smartphone, or tablet computer. Specifically, steps S1 to S5 are executed by one or more processors in the entity alignment device.
[0091] S1, connect two heterogeneous standard terminology knowledge graphs to obtain a new knowledge graph, the new knowledge graph including an entity set, a relation set, an attribute set, and an attribute value set, the entity set including a head entity and a tail entity; generate a relation triple set based on the entity set and the relation set, and generate an attribute triple set based on the entity set, the attribute set, and the attribute value set, wherein the relation triple set represents the head entity and tail entity connected by relations, and the attribute triple set represents the attribute head entity, the attribute, and the attribute value corresponding to the attribute;
[0092] The entity set and attribute value set of the new knowledge graph are expressed by embedding vectors using word embedding functions to obtain the initial embedding vectors of the entities and the initial embedding vectors of the attribute values.
[0093] Define two heterogeneous standard terminology knowledge graphs as G1=(E1,R1,M1,V1,T1,K1) and G2=(E2,R2,M2,V2,T2,K2);
[0094] [G1:{"e i1 ":"Fatigue","r1":"Nursing Outcome","e j1 ":"Activity Endurance","e i1_attribute ":["Domain","Domain Classification","Code","Definition","Definitive Characteristics","Related Factors"],"e i1_value ":["Activity / Rest","Energy Balance","00093","Overwhelming and persistent feeling of exhaustion and a decline in normal levels of physical and mental work capacity.","Changed Concentration","Lack of Energy","Lack of Energy","Depression"],"e j1_attribute ":["Domain Definition","Category","Ending Name","Ending Code","Ending Definition","Domain"],"e j1_value ":["Describes the ability to perform basic life tasks and the outcome of performance","Energy Maintenance","ActivityTolerance","0005","Physiological Response to Physically Exhaustive Exercise in Daily Activities","Functional Health"],"e i2":"Anxiety","r2":"Nursing Outcomes","e j2 ":"Anxiety Self-Control","e i2_attribute ":["Domain","Code","Definition","Definitive Characteristics","Related Factors"],"e j2_value ":["Coping / Stress Tolerance","Energy Balance","00146","A vague sense of unease or fear, accompanied by an autonomous response (the source of the stimulus is usually nonspecific or unknown to the individual); a sense of anxiety caused by anticipated danger. This is a sign of alertness, warning of impending danger and prompting the individual to take steps to deal with the threat.","Behavioral: Irritability","Affective: Anxiety","Cognitive: Confusion"],"e j2_attribute ":["Domain Definition","Category","Ending Name","Ending Code","Ending Definition","Domain"],"e j2_value ":["Describe the outcomes of psychological and social functioning","Self-control","Anxiety Self-Control","1402","Personal behavior that eliminates or reduces unexplained fear, tension or discomfort","Psychosocial Health"]};
[0095] G2:{"e i3 ":"fatigue","r3":"expected nursing outcomes","e j3 ":"Feeling improved","e i3 _attribute":["encoding","definition","English name","English definition"],"e i3_value ":["01.4","Exhaustion that interferes with physical and mental activities","Fatigue","Exhaustion that interferes with physical and mental activities"],"e j3_attribute ":[""],"e j3_value ":[""],"e i4 ":"Activity intolerance","r4":"Expected nursing outcomes","e j4 ":"Exertion intolerance has improved","e i4_attribute ":["Encoding","Definition","English Name","English Definition"],"e i4_value ":["01.1","Lack of physiological or psychological daily activity capacity","Activity Intolerance","Incapacity to carry out physiological or psychological daily activities"],"ej4_attribute ":[""],"e j4_value ":[""]}.
[0096] Among them, e i The header entity is represented by r, the relation is represented by e. j Represents the tail entity, e i_attribute Represents the header entity attribute, e i_value Represents the attribute value of the head entity, e j_attribute Represents the tail entity attribute, e j_value Represents the attribute value of the tail entity;
[0097] Among them, the heterogeneous knowledge graph G1 contains 905 entities, 1508 attribute triples, and 2490 relation triples.
[0098] The heterogeneous knowledge graph G2 contains 1,326 entities, 25,732 attribute triples, and 9,184 relation triples.
[0099] Connecting two heterogeneous knowledge graphs G1 and G2 to form a new knowledge graph G, the expression is:
[0100] G=G1∪G2=(E,R,M,V,T,K),
[0101] Where E = E1∪E2 represents the set of entities; R = R1∪R2 represents the set of relations; M = M1∪M2 represents the set of attributes; V = V1∪V2 represents the set of attribute values; T = T1∪T2, This represents the set of relation triples consisting of head and tail entities connected by a relation; K = K1∪K2. It represents a set of attribute triples consisting of an entity, an attribute, and the corresponding value attribute.
[0102] In this embodiment, the entity set of the new knowledge graph G is [E:{"fatigue", "activity endurance", "anxiety", "anxiety self-control", "fatigue", "fatigue improved", "activity endurance", "activity endurance improved"}].
[0103] First, each entity node is fed into the word embedding model to embed the entity nodes of the new knowledge graph into vector representations.
[0104] Define e i For the i-th entity, For entity e i The initial embedding vector of the entity is given by the following formula:
[0105]
[0106] in, The initial entity embedding vector sequence represents all initial entity embedding vectors. `word_embed(·)` represents the word embedding function. i ∈E, |E| represents the size of the entity set E, and d represents the dimension of all initial embedding vectors of entities.
[0107] In this embodiment, d = 1536, forming a 1536-dimensional initial entity embedding vector, ultimately obtaining the 1536-dimensional initial entity embedding vector sequence X for all entities. e The size is (2231, 1536).
[0108] In this embodiment, the attribute values of the new knowledge graph G are [V:{"Activity / Rest","Energy Balance","00093","Overwhelming and persistent feelings of exhaustion and a decline in normal levels of physical and mental work capacity.","Changed Concentration","Lack of Energy","Lack of Energy","Depression","Description of the ability to perform basic life tasks and the outcome of performance","Energy Maintenance","Activity Tolerance","0005","Physiological Response to Physically Exhausting Exercise in Daily Activities","Functional Health","01.4","Exhaustion that interferes with physical and mental activities"}].
[0109] All attribute values are embedded into vector representations, forming a 1536-dimensional vector, ultimately yielding an initial (20463, 1536)-dimensional attribute value embedding vector sequence X. v The calculation formula is as follows:
[0110]
[0111] in For v i The initial embedding vector of attribute values, v i ∈V, |V| represents the size of the attribute value set V. The sequence of initial embedding vectors for all attribute values.
[0112] S2, perform dot product calculation and summation on the initial entity embedding vectors corresponding to the head and tail entities of each relation triplet with their respective weight parameters. Then perform vector concatenation and activation on the results to obtain the relation embedding vector. Calculate the relation-aware attention coefficient of the tail entity to the head entity. After standardizing the relation-aware attention coefficient, aggregate it with the initial entity embedding vector of the tail entity to obtain the entity relation aggregate embedding vector. Mix all the initial entity embedding vectors with the relation aggregate embedding vector to obtain the entity hybrid relation embedding set.
[0113] In a knowledge graph, head entities and tail entities are connected to each other through relations. Each relation consists of a head entity and a tail entity, representing a specific relationship between the two entities.
[0114] In this embodiment, the new knowledge graph G consists of the relation [r:{"nursing outcome"}], the relation head entity vector, and the tail entity head entity vector.
[0115] First, for each relation, the size of the relation head entity is calculated to be 181, and the size of each relation tail entity is calculated to be 309.
[0116] Secondly, each relation header entity vector is associated with a weight parameter. After performing dot product calculations, the results are summed, and the resulting vector is divided by the number of head entities to obtain the head entity relationship embedding vector.
[0117] Similarly, the tail entity vector of each relation is associated with the weight parameters. After performing dot product calculations, the results are summed.
[0118] Dividing the obtained vector by the number of tail entities yields the tail entity relation embedding vector. Finally, the head entity relation embedding vector and the tail entity relation embedding vector are concatenated, and an activation function is used to obtain the relation embedding vector. The size is (6, 3072), and the calculation formula is as follows:
[0119]
[0120] in, Representing relation r respectively t Head entity e i Combined tail entity e j The initial embedding vector of the entity, |H t | Represents the relation r t Head entity e i The set H t The scale, |T t | Represents the relation r t tail entity e j set Tt scale Represents the head entity e i The weight parameters, Represents tail entity e j The weight parameters are: || is the vector concatenation operator, and σ is the activation function.
[0121] In this embodiment, the ReLU activation function can be used to obtain the relation embedding vector.
[0122] In this embodiment, the head entity [e] of the new knowledge graph G i :{"fatigue"}]、tail entity[e j :{"activity endurance"}] and the set of relational triples
[0123] Then, the importance value of each tail entity to the head entity with respect to the relation triple is calculated, and finally, the set of importance values of the tail entities to the head entities is obtained. The formula is as follows:
[0124]
[0125] Among them att relation (·) denotes the relation-aware attention function. It is the head entity e i Relationship r t Tail entity e j The set of relational triples.
[0126] The relationship-aware attention coefficients obtained above After standardization by the softmax layer, we obtain The calculation formula is as follows:
[0127]
[0128] in It is an attention parameter. Represents entity e i Neighbor e k The set, It is entity e i The initial embedding vector, It is entity e k The initial embedding vector, where η is the decay factor and ⊙ is the product operator.
[0129] Standardized attention importance values are compared with head entity vectors. The summation of the multiplication results in the entity relation aggregation embedding vector after passing through the activation function. The formula is as follows:
[0130]
[0131] in, X se Let σ be the set of entity relation aggregation embeddings of the knowledge graph G, and let σ be the activation function.
[0132] Embed entity relationship aggregation into set X se Multiply by the tradeoff parameter β1 and then by the initial embedding vector sequence X of the entity. e Adding them together yields the entity hybrid relation embedding set X. see The size is (2231, 3072), and the formula is as follows:
[0133] X see =β1X se +X e ,
[0134] Where β1 is X se With X e The trade-off parameters.
[0135] S3, calculate the dot product of the attribute head entity and the embedding vector corresponding to the attribute value of each attribute triple with the corresponding weight parameters, sum the results, and then perform vector concatenation and activation to obtain the attribute embedding vector. Calculate the attribute perception attention of the attribute head entity to the attribute value to obtain the attribute perception attention coefficient. After standardizing the attribute perception attention coefficient, aggregate it with the embedding vector corresponding to the attribute value to obtain the attribute aggregate embedding vector of the entity. Mix all the initial entity embedding vectors with the attribute aggregate embedding vector to obtain the entity hybrid attribute embedding set.
[0136] In this embodiment, the new knowledge graph G has attributes [value:{"domain"}] and attribute header entity vector e. p The attribute value vector corresponding to the attribute.
[0137] First, for each relation, calculate the size of the attribute header entity (245) and the size of the attribute value corresponding to each attribute (10).
[0138] Next, the entity vector of each attribute header is associated with the weight parameters. After performing dot product calculation, the vectors are summed and then divided by the head entity size to obtain the head entity attribute embedding vector.
[0139] Similarly, the attribute value vector corresponding to each attribute is linked to the weight parameters. The vector is obtained by performing a dot product and then summing the results. The resulting vector is then divided by the attribute value scale to obtain the attribute embedding vector corresponding to the attribute value.
[0140] Finally, the attribute embedding vector is obtained by concatenating the head entity relationship embedding vector with the corresponding attribute value attribute embedding vector and then applying an activation function. The calculation formula is as follows:
[0141]
[0142] in, X m This represents the embedding vector of all attributes. Represents entity e h The initial embedding vector of the entity. H g Represents attribute m g Head entity e h The set, |H g | represents set H g The scale, V g Represents attribute m g attribute value v k The set, Represents attribute m g The corresponding attribute value embedding vector, |V g | represents set V g scale These represent the weight parameters of the entity and attribute values, respectively; || is the vector concatenation operator; σ is the activation function; and m g ∈M.
[0143] In this embodiment, the ReLU activation function can be used to obtain the attribute embedding vector.
[0144] Next, the attribute-aware attention coefficient is calculated. An attention mechanism is used to calculate the attribute-aware attention of the attribute value to the head entity, thus obtaining the attribute-aware attention coefficient. And on Standardize it.
[0145] Attribute header entity e p An attribute triplet is composed of an attribute and its corresponding attribute value. The input is fed into the attention mechanism to obtain the attribute-aware attention coefficients of the attribute head entity to the attribute value corresponding to the attribute. The formula is as follows:
[0146]
[0147] in, These represent the attribute header entity e respectively. p Attribute m g Attribute value v q The corresponding embedding vector, It is an attention parameter. Represents entity e p The set of attribute values, where η is the decay factor and ⊙ is the product operator.
[0148] Then, combine the attribute-aware attention coefficient With attribute value embedding vector After performing multiplication and summing, the attribute aggregation embedding is obtained through an activation function. The formula is as follows:
[0149]
[0150] in, X ce Embedded collections for attribute aggregation;
[0151] σ is the activation function, which can be the ReLU activation function.
[0152] Embed attribute aggregation into set X ce Multiply by the tradeoff parameter β2 and then by the initial embedding vector sequence X of the entity. e The summation yields the entity's blended attribute value embedding set X. cee The size is (2231, 3072), and the formula is as follows:
[0153] X cee =β2X ce +X e
[0154] Among them, X ce It is a set of embedded mixed attribute values, where β2 is X. ce With X e The trade-off parameters.
[0155] S4, The entity hybrid relation embedding set and the entity hybrid attribute value embedding set are fed into the graph convolutional network to obtain the entity graph embedding vector set of the new knowledge graph;
[0156] Embed relationships in a mixed set X see and the set X of mixed attribute values cee The data is fed into the Highway-Gates GCNs graph convolutional network to obtain the set of graph embedding vectors X of entities in the knowledge graph G. sc The value is (2231, 3072), and the calculation formula is as follows:
[0157]
[0158]
[0159] X sc =T(X) (f,l) )⊙X(f,l) +(1-T(X (f,l) ))⊙X (f,l-1) ,
[0160] Where f = {see,cee} represents the hybrid relation embedding set X see and the set X of the hybrid attribute values cee Indicator, It is the adjacency matrix of the knowledge graph G with self-connections added, where I is the identity matrix. yes The degree matrix of the diagonal nodes, W (f,l) X represents the connection weight matrix parameters of the l-th layer. (f,l) This represents the output of the l-th layer. Let X represent the weight matrix and bias vector, respectively; σ and φ are the activation functions; T(·) is the transformation gate; and X... (f,l-1) This represents the output of the (l-1)th layer.
[0161] In this embodiment, Highway-Gates GCNs is a variant of Graph Convolutional Networks (GCNs) that improves GCN performance by introducing a gating mechanism. A gating mechanism is a method for controlling the flow of information, allowing the network flexibility in processing information. For each node, the GCN simultaneously calculates a weighted sum of aggregated neighbor features and a gating signal. The gating signal is calculated using a sigmoid function with a value between 0 and 1. This signal controls the weights of the feature vectors of neighboring nodes, enabling the network to dynamically aggregate the feature information of neighboring nodes based on the node's features and structural information. By introducing the gating mechanism, Highway-Gates GCNs can better handle heterogeneous graph data and achieve better performance in tasks such as node classification and link prediction.
[0162] S5, the entity graph is embedded into the vector set for interactive comparative learning and iterative optimization to generate the optimal set of positive entity pairs, thereby obtaining a trained knowledge graph entity alignment model, which is used to perform entity alignment on any two input standard term knowledge graphs according to the trained knowledge graph entity alignment model.
[0163] First, embed the entity graph into the vector set X. sc With misaligned negative entity vectors Calculate the loss score Setting (e) x ,e y )∈EA represents a positive entity pair, and the loss function The calculation formula is as follows:
[0164]
[0165] Where, x sc ,y sc ∈X sc Representing entity e respectively x ,e y The corresponding entity graph embedding vector, EA={(e x ,e y )|e x ∈E1,e y ∈E2,e x ≡e y}, ≡ represents the alignment symbol for two entities.
[0166] The set of negative entities The scale is 25, first of all Add 1 to the size, and finally the loss score. Multiplying by the number of iteration batches Q=1 yields the set of negative entity vectors.
[0167] Define the set of negative entity vectors The scale threshold θ is constrained by the following formula:
[0168] θ=(1+W)×Q <min((|E1|,|E2|)),
[0169] Where 1+W is the set of negative entity vectors in the current iteration batch. The size of Q is the loss function. The number of iteration batches.
[0170] Therefore, the scale threshold θ = 26.
[0171] During the iterative optimization of the entity graph embedding vector set, the entity graph embedding vector set X... sc Calculate the Manhattan distance between two entities. Given any two entity graph embedding vectors, calculate the Manhattan distance d. f (e x ,e y The formula is as follows:
[0172]
[0173] Where, x sc ,y sc ∈X sc Representing entity e respectively x ,e y The corresponding entity graph embedding vector, where L1 represents the first-order Euclidean distance.
[0174] For entity e x Take the minimum distance d fm Second minimum distance d fsIf d fm and d fs If the following threshold conditions are met, then e is selected. x and e m For positive entity pairs, where e m For entity e x Minimum distance d fm The corresponding entity, the threshold condition is as follows:
[0175]
[0176] Where σ1 and σ2 are the set threshold values.
[0177] Calculate the minimum distance d between the graph embedding vectors. fm =126 and the second smallest distance d fs =767.
[0178] The set thresholds are σ1 = 223 and σ2 = 2231.
[0179] First, determine d. fm and d fs Does d satisfy? fm -d fs Threshold σ1 = 223;
[0180] Next, determine d. fm Does d satisfy? fm <threshold σ2=2231,d fs Does d satisfy? fs <Threshold σ2=2231;
[0181] If the above conditions are met, the final aligned entity pair ["fatigue, fatigue"] is obtained.
[0182] loss function The loss value is iteratively optimized until the convergence condition is met, thereby obtaining the optimal positive entity pair EA. opt And a trained self-supervised knowledge graph entity alignment model.
[0183] Output a set of positive entity pairs, representing whether two heterogeneous knowledge graph entity pairs are aligned.
[0184] In this embodiment, the output is: ["fatigue, exhaustion", "activity endurance, activity insufficiency improved"]].
[0185] Furthermore, it should be noted that other functions or algorithms can also be used for the loss function, and this invention does not impose any specific limitations.
[0186] Compared with existing technologies, the present invention has the following advantages: The present invention fully utilizes graph structure information for efficient fusion, embedding and fusing relational and attribute information with entities. After attention mechanism and standardization, the data is fed into a graph convolutional network to obtain a set of entity graph embedding vectors. This set of entity graph embedding vectors undergoes interactive comparative learning and iterative optimization to generate an optimal set of positive entity pairs, thus obtaining a trained knowledge graph entity alignment model. This knowledge graph entity alignment method fully considers the multi-view information of the knowledge graph, effectively integrating information from different perspectives and improving classification accuracy by utilizing graph neural networks and multi-view image classification techniques of knowledge graph embedding technology. In the self-supervised entity alignment framework, the present invention fully utilizes and integrates graph structure information for efficient fusion, improving the accuracy and universality of entity alignment in the knowledge graph, and has extremely high application value.
[0187] The self-supervised knowledge graph entity alignment model is a model for multi-view image classification, and it is an improved model based on graph neural networks (GNNs).
[0188] Traditional image classification methods typically consider image features only from a single viewpoint, neglecting information between different viewpoints. To address this issue, self-supervised knowledge graph entity alignment models utilize graph neural networks to integrate information from different viewpoints.
[0189] In a self-supervised knowledge graph entity alignment model, each viewpoint of each image is represented as a node, and the edges between nodes represent the relationships between different viewpoints. Through training with a graph neural network, the model can learn the intrinsic relationships between different viewpoints, thereby achieving better classification.
[0190] The self-supervised knowledge graph entity alignment model is a multi-view image classification model that utilizes graph neural networks and knowledge graph embedding techniques. It can effectively integrate information from different perspectives and improve classification accuracy.
[0191] Example 2
[0192] like Figure 3 As shown, this embodiment of the invention also provides a self-supervised learning knowledge graph entity alignment device, comprising:
[0193] An initial embedding module is used to connect two heterogeneous standard terminology knowledge graphs to obtain a new knowledge graph. The new knowledge graph includes an entity set, a relation set, an attribute set, and an attribute value set. The entity set includes a head entity and a tail entity. A set of relation triples is generated based on the entity set and the relation set. A set of attribute triples is generated based on the entity set, the attribute set, and the attribute value set. The relation triples represent head and tail entities connected by relations, and the attribute triples represent a head entity, an attribute, and its corresponding attribute value. A word embedding function is used to embed the entity set and the attribute value set of the new knowledge graph into initial embedding vectors to obtain initial entity embedding vectors and initial attribute value embedding vectors.
[0194] The relation aggregation embedding module is used to calculate and sum the initial entity embedding vectors corresponding to the head and tail entities of each relation triple by multiplying them with the corresponding weight parameters, and then perform vector concatenation and activation to obtain the relation embedding vector. The relation-aware attention coefficient of the tail entity to the head entity is calculated. The relation-aware attention coefficient is standardized and then aggregated with the initial entity embedding vector of the tail entity to obtain the entity relation aggregation embedding vector. All the initial entity embedding vectors and the relation aggregation embedding vector are mixed to obtain the entity hybrid relation embedding set.
[0195] The attribute aggregation and embedding module is used to calculate and sum the embedding vectors corresponding to the attribute head entity and attribute value of each attribute triple with the corresponding weight parameters, and then perform vector concatenation and activation to obtain the attribute embedding vector. The module calculates the attribute-aware attention coefficient of the attribute head entity to the attribute value, standardizes the attribute-aware attention coefficient, and then aggregates it with the embedding vector corresponding to the attribute value to obtain the attribute aggregation embedding vector of the entity. Finally, the module mixes all the initial entity embedding vectors with the attribute aggregation embedding vector to obtain the entity hybrid attribute embedding set.
[0196] The graph convolutional network module is used to feed the entity hybrid relation embedding set and the entity hybrid attribute value embedding set into the graph convolutional network to obtain the entity graph embedding vector set of the new knowledge graph.
[0197] The interactive comparison learning module is used to embed the entity graph into a vector set for interactive comparison learning and iterative optimization, generate the optimal set of positive entity pairs, and then obtain a trained knowledge graph entity alignment model, so as to perform entity alignment on any two input standard term knowledge graphs according to the trained knowledge graph entity alignment model.
[0198] Example 3
[0199] The third embodiment of the present invention also provides a self-supervised learning knowledge graph entity alignment device, which includes a memory and a processor. The memory stores a computer program, which can be executed by the processor to implement the self-supervised learning knowledge graph entity alignment method described above.
[0200] Example 4
[0201] The fourth embodiment of the present invention also provides a computer-readable storage medium, which includes computer-readable instructions stored on the computer-readable storage medium. When the computer-readable instructions are executed by the processor of the device where the computer-readable storage medium is located, they implement a self-supervised learning knowledge graph entity alignment method as described above.
[0202] In the several embodiments provided in this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus and method embodiments described above are merely illustrative. For example, the flowcharts in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the invention. In this regard, each block in the flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0203] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0204] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. In the absence of further restrictions, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0205] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0206] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0207] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0208] The use of "first" and "second" in the embodiments is merely to distinguish similar objects and does not represent a specific ordering of objects. It is understood that "first" and "second" can be interchanged in a specific order or sequence where permitted. It should be understood that the objects distinguished by "first" and "second" can be interchanged where appropriate so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0209] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A self-supervised learning method for aligning entities in a knowledge graph, characterized in that, include: S1. Connect two heterogeneous standard terminology knowledge graphs to obtain a new knowledge graph. The new knowledge graph includes an entity set, a relation set, an attribute set, and an attribute value set. The entity set includes a head entity and a tail entity. Generate a set of relation triples based on the entity set and the relation set. Generate a set of attribute triples based on the entity set, the attribute set, and the attribute value set. The relation triples represent head entities and tail entities connected by relations. The attribute triples represent head entities, attributes, and their corresponding attribute values. Use a word embedding function to embed the entity set and attribute value set of the new knowledge graph into initial embedding vectors to obtain initial entity embedding vectors and initial attribute value embedding vectors. S2, perform dot product calculation and summation on the initial entity embedding vectors corresponding to the head and tail entities of each relation triplet with their respective weight parameters. Then perform vector concatenation and activation to obtain the relation embedding vector. Calculate the relation-aware attention coefficient of the tail entity to the head entity through an attention mechanism. After standardizing the relation-aware attention coefficient, aggregate it with the initial entity embedding vector of the tail entity to obtain the entity relation aggregate embedding vector. Mix all the initial entity embedding vectors with the relation aggregate embedding vector to obtain the entity hybrid relation embedding set. S3, calculate the dot product of the attribute head entity and the embedding vector corresponding to the attribute value of each attribute triple with the corresponding weight parameters, sum the results, and then perform vector concatenation and activation to obtain the attribute embedding vector. Calculate the attribute-aware attention of the attribute head entity to the attribute value to obtain the attribute-aware attention coefficient. Standardize the attribute-aware attention coefficient and then aggregate it with the embedding vector corresponding to the attribute value to obtain the attribute aggregate embedding vector of the entity. Mix all the initial entity embedding vectors with the attribute aggregate embedding vector to obtain the entity hybrid attribute embedding set. S4, The entity hybrid relation embedding set and the entity hybrid attribute value embedding set are fed into the graph convolutional network to obtain the entity graph embedding vector set of the new knowledge graph; S5, the entity graph is embedded into the vector set for interactive comparative learning and iterative optimization to generate the optimal set of positive entity pairs, thereby obtaining a trained knowledge graph entity alignment model, which is used to perform entity alignment on any two input standard term knowledge graphs according to the trained knowledge graph entity alignment model.
2. The knowledge graph entity alignment method for self-supervised learning according to claim 1, characterized in that... Two heterogeneous standard terminology knowledge graphs are defined as G1 = (E1, R1, M1, V1, T1, K1) and G2 = (E2, R2, M2, V2, T2, K2), wherein S1 specifically includes: S11, Connecting G1 and G2 yields a new knowledge graph G, expressed as: G=G1∪G2=(E,R,M,V,T,K), Where E = E1∪E2 represents the entity set; R = R1∪R2 represents the relation set; M = M1∪M2 represents the attribute set; V = V1∪V2 represents the attribute value set; T = T1∪T2, This represents the set of relation triples consisting of head and tail entities connected by a relation; K = K1∪K2. A set of attribute triples consisting of an entity, an attribute, and the value attribute corresponding to that attribute; S12, The entity set E is expressed as an embedding vector using a word embedding function, and e is defined as follows: i For the i-th entity, For entity e i The initial embedding vector of the entity is given by the following formula: in, The initial entity embedding vector sequence represents all initial entity embedding vectors. `word_embed(·)` represents the word embedding function. i ∈E, |E| represents the size of the entity set E, and d represents the dimension of all the initial embedding vectors of the entities; S13, The word embedding function is used to embed the attribute value set V into an embedding vector representation, and v is defined. i For the i-th attribute value, For v i The initial embedding vector for the attribute values is given by the following formula: in, The sequence of initial embedding vectors for all attribute values, v i ∈V, |V| represents the size of the attribute value set V.
3. The knowledge graph entity alignment method for self-supervised learning according to claim 2, characterized in that... S2 specifically includes: S21, for each relation r t ∈R compute relation head entity e i With tail entity e j The scale will e i Entity initial embedding vector With weight parameters After performing dot product calculation, the summation is performed, and the summation vector is divided by the number of head entities to obtain the head entity relationship embedding vector. Each tail entity e j Entity initial embedding vector With weight parameters After performing dot product calculation, the results are summed. The summed vector is then divided by the number of tail entities to obtain the tail entity relationship embedding vector. After concatenating the head entity relationship embedding vector and the tail entity relationship embedding vector, the relationship embedding vector is obtained through an activation function. The calculation formula is as follows: in, Representing relation r respectively t Head entity e i Combined tail entity e j The initial embedding vector of the entity, |H t | indicates the head entity e i The set H t The scale, |T t | represents the tail entity e j set T t scale Represents the head entity e i The weight parameters, Represents tail entity e j The weight parameters are: || is the vector concatenation operator, and σ is the activation function. S22, Calculate the tail entity e j Head entity e i Regarding the importance value of relation triples, i.e., the relation-aware attention coefficient The formula is as follows: Among them att relation (·) denotes the relation-aware attention function. It is the head entity e i Relationship r t Tail entity e j The relational triples formed; S23, The Softmax function is used to evaluate the relationship-aware attention coefficient. Standardization is performed to obtain the standardized relation-perceived attention coefficient. The calculation formula is as follows: in It is an attention parameter. Represents entity e i Neighbor e k The set, It is entity e i The initial embedding vector, It is entity e k The initial embedding vector, where η is the decay factor and ⊙ is the product operator; S24, the standardized relation-aware attention coefficient With tail entity e j Entity initial embedding vector Aggregation yields entity-relation aggregation embedding vectors. The formula is as follows: in, X se Let σ be the set of entity relation aggregation embeddings for the knowledge graph G, where σ is the activation function. S25, mixing the sequence of entity initial embedding vectors X e with the set of entity relation aggregated embeddings X se , obtaining a set of entity mixed relation embeddings X see , as follows: X see = β1X se + X e , where β1is X se with X e a trade-off parameter.
4. The knowledge graph entity alignment method for self-supervised learning according to claim 3, characterized in that... S3 specifically includes: S31, For each attribute triple, calculate the size of the attribute head entity and the size of each attribute m. g The corresponding attribute value v k The size, then the attribute header entity e h Entity initial embedding vector With entity weight parameters After performing dot product calculations, the results are summed. The summed vector is then divided by the size of the head entity to obtain the head entity attribute embedding vector. Embed the attribute value corresponding to each attribute into a vector. With attribute value weight parameters After performing dot product calculations, sum the results and divide the summed vector by the attribute value scale to obtain the attribute embedding vector corresponding to the attribute value. Then, the head entity attribute embedding vector is concatenated with the attribute embedding vector of the corresponding attribute value, and then the attribute embedding vector is obtained by applying an activation function. The calculation formula is as follows: in This indicates that the entity e is represented by the attribute header. h Attribute m g Attribute value v k The attribute triples formed; X m Represents the embedding vector of all attributes; Indicates the attribute header entity e h The initial embedding vector of the entity. H g Represents the attribute header entity e h The set, |H g | represents set H g The scale; V g Indicates the attribute value v k A set; Indicates the attribute value v k The corresponding attribute value embedding vector; |V g | represents set V g The scale; These represent the weight parameters of the entity and attribute values, respectively; || is the vector concatenation operator; σ is the activation function; and m g ∈M; S32, an attention mechanism is used to calculate the attribute-aware attention of the attribute value to the head entity, and the attribute-aware attention coefficient is obtained. And the attribute-aware attention coefficient Standardize and define For the set of attribute triples (e p ,m g ,v q )∈K, the formula is as follows: in, These represent the attribute header entity e respectively. p Attribute m g Attribute value v q The corresponding embedding vector, It is an attention parameter. Represents the attribute header entity e p The set of attribute values, where η is the decay factor and ⊙ is the product operator; S33, combined with the attribute-aware attention coefficient With attribute value embedding vector Obtain entity e p Attribute aggregation embedding vector The formula is as follows: in, X ce Embedded collections for attribute aggregation; S34, mixing the sequence of entity initial embedding vectors X e with the set of attribute aggregated embeddings X ce , obtaining a set of mixed attribute value embeddings X cee , as follows: X cee = β2X ce + X e where X ce is a set of mixed attribute value embeddings, β2is a weighting parameter for X ce and X e .
5. The knowledge graph entity alignment method for self-supervised learning according to claim 4, characterized in that... The calculation formula for the graph convolutional network is as follows: X sc =T(X (f,l) )⊙X (f,l) +(1-T(X (f,l) ))⊙X (f,l-1) , Where f = {see,cee} represents the hybrid relation embedding set X see and the set X of the hybrid attribute values cee Indicator, It is the adjacency matrix of the knowledge graph G with self-connections added, where I is the identity matrix. yes The degree matrix of the diagonal nodes, W (f,l) X represents the connection weight matrix parameters of the l-th layer. (f,l) This represents the output of the l-th layer. Let X represent the weight matrix and bias vector, respectively; σ and φ are the activation functions; T(·) is the transformation gate; and X... (f,l-1) This represents the output of the (l-1)th layer.
6. The knowledge graph entity alignment method for self-supervised learning according to claim 5, characterized in that... The loss function is used to iteratively optimize the entity graph embedding vector set until the convergence condition is met. (e) x ,e y )∈EA represents a positive entity pair, and the loss function The calculation formula is as follows: Where, x sc ,y sc ∈X sc Representing entity e respectively x ,e y The corresponding entity graph embedding vector, EA={(e x ,e y )|e x ∈E1,e y ∈E2,e x ≡e y }, ≡ represents the alignment symbol for two entities; set up This indicates that it cannot be associated with entity e. x Aligned entity graph embedding vectors, i.e., negative entity vectors. Let represent the set of negative entity vectors, τ be the temperature hyperparameter, and B be the number of negative entities; The expectation calculation is based on the set of negative entity vectors. The calculation shows that this set is independent and identically distributed with the knowledge graph G; Define the set of negative entity vectors The scale threshold θ is limited by the following formula: θ=(1+W)×Q <min((|E1|,|E2|)), Where 1+W is the set of negative entity vectors in the current iteration batch. The size of Q is the loss function. The number of iteration batches.
7. The knowledge graph entity alignment method for self-supervised learning according to claim 6, characterized in that... During the iterative optimization of the entity graph embedding vector set, the entity graph embedding vector set X... sc The Manhattan distance between two entities is calculated using the following formula: Where, x sc ,y sc ∈X sc Representing entity e respectively x ,e y The corresponding entity graph embedding vector, where L1 represents the first-order Euclidean distance; Then for entity e x Take the minimum distance d fm Second minimum distance d fs If d fm and d fs If the following threshold conditions are met, then e is selected. x and e m For positive entity pairs, where e m For entity e x Minimum distance d fm The corresponding entity, the threshold condition is as follows: Where σ1 and σ2 are the set threshold values.
8. A knowledge graph entity alignment device for self-supervised learning, characterized in that, include: An initial embedding module is used to connect two heterogeneous standard terminology knowledge graphs to obtain a new knowledge graph. The new knowledge graph includes an entity set, a relation set, an attribute set, and an attribute value set. The entity set includes a head entity and a tail entity. A set of relation triples is generated based on the entity set and the relation set. A set of attribute triples is generated based on the entity set, the attribute set, and the attribute value set. The relation triples represent head and tail entities connected by relations, and the attribute triples represent a head entity, an attribute, and its corresponding attribute value. A word embedding function is used to embed the entity set and the attribute value set of the new knowledge graph into initial embedding vectors to obtain initial entity embedding vectors and initial attribute value embedding vectors. The relation aggregation embedding module is used to calculate and sum the initial entity embedding vectors corresponding to the head and tail entities of each relation triple by multiplying them with the corresponding weight parameters, and then perform vector concatenation and activation to obtain the relation embedding vector. The relation-aware attention coefficient of the tail entity to the head entity is calculated. The relation-aware attention coefficient is standardized and then aggregated with the initial entity embedding vector of the tail entity to obtain the entity relation aggregation embedding vector. All the initial entity embedding vectors and the relation aggregation embedding vector are mixed to obtain the entity hybrid relation embedding set. The attribute aggregation and embedding module is used to calculate and sum the embedding vectors corresponding to the attribute head entity and attribute value of each attribute triple with the corresponding weight parameters, and then perform vector concatenation and activation to obtain the attribute embedding vector. The module calculates the attribute-aware attention coefficient of the attribute head entity to the attribute value, standardizes the attribute-aware attention coefficient, and then aggregates it with the embedding vector corresponding to the attribute value to obtain the attribute aggregation embedding vector of the entity. Finally, the module mixes all the initial entity embedding vectors with the attribute aggregation embedding vector to obtain the entity hybrid attribute embedding set. The graph convolutional network module is used to feed the entity hybrid relation embedding set and the entity hybrid attribute value embedding set into the graph convolutional network to obtain the entity graph embedding vector set of the new knowledge graph. The interactive comparison learning module is used to embed the entity graph into a vector set for interactive comparison learning and iterative optimization, generate the optimal set of positive entity pairs, and then obtain a trained knowledge graph entity alignment model, so as to perform entity alignment on any two input standard term knowledge graphs according to the trained knowledge graph entity alignment model.
9. A self-supervised learning knowledge graph entity alignment device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that can be executed by the processor to implement a self-supervised learning knowledge graph entity alignment method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor of the device on which the computer-readable storage medium resides, implement a self-supervised learning knowledge graph entity alignment method as described in any one of claims 1-7.
Citation Information
Patent Citations
Entity alignment method and device for multi-modal knowledge graph, and storage medium
CN113360673A
Heterogeneous knowledge graph fusion method and system
CN114090783A