Medical knowledge graph-oriented entity alignment method and related device
By constructing a heterogeneous graph model and learning the context semantic information in the medical knowledge graph, a fusion vector representation of entities is generated, which solves the problem of poor entity alignment in the medical knowledge graph, and achieves higher alignment accuracy and robustness .
Patent Information
- Application Number
- CN202411131939.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-11-26
AI Technical Summary
Existing solid alignment methods are not effective in medical knowledge graphs, especially due to insufficient utilization of contextual semantic information, resulting in low alignment accuracy.
Construct a heterogeneous graph model, including ontology diagrams and example diagrams, learn the context semantic information of entities in the medical knowledge graph in the ontology layer and instance layer through cross-layer link sets, obtain the first vector representation and the second vector representation of the entity, and Perform joint learning and generate fusion vector representations for entity alignment.
By making full use of the multi-source information and hierarchy of the medical knowledge graph, the accuracy and robustness of entity alignment are improved, the impact of medical knowledge complexity on entity alignment is overcome, and the performance of medical entity alignment is significantly improved.
Smart Images

Figure CN119025682A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an entity alignment method and related devices for medical knowledge graphs. Background Art
[0002] Knowledge Graph (KG) is a knowledge base that represents knowledge such as entities, relationships, and attributes in a graphical form. It allows computers to better understand and process human language by representing knowledge in a structured way. In recent years, with the vigorous development of artificial intelligence, a large number of different types of multi-source knowledge graphs have emerged. These knowledge graphs are usually expressed in different languages and store a large amount of high-quality knowledge, providing important knowledge reasoning services for downstream intelligent applications. At present, knowledge graphs have become a core component of modern artificial intelligence. However, with the deepening of applications, the amount of knowledge in a single knowledge graph is often difficult to support complex business scenarios. Therefore, entity alignment technology has become a hot topic in knowledge graph-related research. The goal of entity alignment of knowledge graphs is to discover equivalent objects in the real world represented in multi-source knowledge graphs, and then combine multi-source knowledge graphs to build a knowledge graph with a larger business scope and wider semantic coverage to support knowledge fusion and reasoning. Through entity alignment, collaborative reasoning based on multiple knowledge graphs can be achieved, which greatly promotes the improvement of downstream task performance.
[0003] Current entity alignment methods can be divided into two categories. One type of traditional entity alignment method is mainly based on string similarity measurement to determine whether two entity spellings refer to the same thing in the real world. The method based on string similarity measurement mainly utilizes the symbolic features of the entity, so this method is also called a symbol-based entity alignment method. The disadvantage of this method is the lack of utilization of contextual semantics, resulting in poor entity alignment effect. The other type is the entity alignment method based on knowledge representation learning. Compared with traditional methods, it can better utilize contextual semantics and has become the mainstream technology in entity alignment. For example, MtransE, BootEA, etc.
[0004] Entities in medical knowledge graphs generally have clear ontology information and textual information such as entity descriptions in the medical field. At present, entity alignment methods based on knowledge representation learning are generally carried out for knowledge graphs in general domains, without considering the domain characteristics of medical knowledge graphs. This leads to the direct use of general domain entity alignment technology to guide the alignment of medical entities in multi-source medical knowledge graphs, which often results in poor entity alignment effects and insufficient alignment accuracy. How to improve the performance of entity alignment in medical knowledge graphs has become a research hotspot in the current medical field. Summary of the invention
[0005] Based on the above problems, the present application provides an entity alignment method and related devices for medical knowledge graphs, aiming to improve the entity alignment performance of medical knowledge graphs.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] The first aspect of the present application provides an entity alignment method for a medical knowledge graph, the method comprising:
[0008] According to the medical knowledge graph and the cross-layer link set, a heterogeneous graph model of the medical knowledge graph is constructed; the heterogeneous graph model includes an ontology graph and an instance graph, and the instance graph is linked to the ontology graph based on the cross-layer link set; the ontology graph describes concepts and hierarchical relationships between concepts; the instance graph describes the topological structure of an entity; and the cross-layer link set describes the type of the concept of an entity;
[0009] Learning contextual semantic information of entities in the medical knowledge graph at the ontology layer according to the ontology graph to obtain a first vector representation of the entity; and learning contextual semantic information of entities in the medical knowledge graph at the instance layer according to the instance graph to obtain a second vector representation of the entity;
[0010] Jointly learning the first vector representation and the second vector representation of the same entity to obtain a fused vector representation of the entity;
[0011] An entity alignment operation is performed based on the fused vector representation of the entity in the first medical knowledge graph and the fused vector representation of the entity in the second medical knowledge graph.
[0012] In an optional implementation of the first aspect of the present application, learning contextual semantic information of an entity in the medical knowledge graph at an ontology layer according to the ontology graph to obtain a first vector representation of the entity includes:
[0013] For a target entity in the medical knowledge graph, a concept node set related to the target entity in the ontology graph is determined according to the cross-layer link set; the concept node set related to the target entity includes all ancestor nodes related to the target entity;
[0014] The semantic information of each concept node in the concept node set is aggregated to obtain a first vector representation of the target entity.
[0015] In an optional implementation of the first aspect of the present application, aggregating semantic information of each concept node in the concept node set to obtain a first vector representation of the target entity includes:
[0016] Obtaining a vector representation of each concept node in the concept node set;
[0017] Obtaining semantic compatibility weight coefficients between each concept node in the concept node set and the target entity;
[0018] According to the semantic compatibility weight coefficient between each concept node in the concept node set and the target entity, the attention weight coefficient of each concept node in the concept node set is calculated by a normalized exponential function;
[0019] A weighted sum is taken using the vector representation of each concept node in the concept node set and the attention weight coefficient, and a first calculation result of the weighted sum is used as the first vector representation of the target entity.
[0020] In an optional implementation of the first aspect of the present application, the obtaining of a vector representation of each concept node in the concept node set includes:
[0021] For a target concept node in the concept node set, obtaining correlation coefficients between each first-order sub-concept node of the target concept node and the target concept node; the correlation coefficients are used to characterize the semantic contribution of the first-order sub-concept nodes to the target concept node;
[0022] According to the correlation coefficients between each first-order sub-concept node of the target concept node and the target concept node, a semantic contribution weight coefficient of each first-order sub-concept node to the target concept node is calculated by a normalized exponential function;
[0023] The vector representation of each first-order sub-concept node and the semantic contribution weight coefficient of each first-order sub-concept node to the target concept node are weighted and summed, and a second calculation result of the weighted sum is used as the vector representation of the target concept node.
[0024] In an optional implementation of the first aspect of the present application, learning contextual semantic information of an entity at an instance layer in the medical knowledge graph according to the instance graph to obtain a second vector representation of the entity includes:
[0025] For a target entity node representing the target entity in the instance graph, according to the target entity node's own neighbor nodes and the relationship type between the target entity node and its own neighbor nodes, an attention weight coefficient of the target entity node to its own neighbor nodes is obtained through a self-attention mechanism; the neighbor nodes include neighbor entity nodes and neighbor attribute nodes;
[0026] Utilizing the vector representation of each neighbor node of the target entity node and the attention weight coefficient of the target entity node to its own neighbor nodes, the semantic information of the target entity node's own neighbor entity nodes and the relationship semantic information between the neighbor nodes are aggregated to the target entity node by weighted summation to obtain a second vector representation of the target entity.
[0027] In an optional implementation of the first aspect of the present application, the method of using the vector representation of each neighbor node of the target entity node and the attention weight coefficient of the target entity node to its own neighbor node to aggregate the semantic information of the neighbor entity nodes of the target entity node and the relationship semantic information between the neighbor nodes to the target entity node by weighted summation to obtain the second vector representation of the target entity, including:
[0028] Through a multi-head attention mechanism, each attention head uses the vector representation of each neighbor node of the target entity node and the attention weight coefficient of the target entity node to its own neighbor node to generate a semantic information aggregation vector representation of the target entity node by weighted summation;
[0029] splicing the semantic information aggregation vector representation of the target entity node generated by each attention head to obtain a spliced vector representation;
[0030] The concatenated vector representation is converted into the dimension of the semantic information aggregation vector representation before concatenation to obtain a second vector representation of the target entity.
[0031] In an optional implementation of the first aspect of the present application, the aggregation of entity semantic information is implemented by a multi-layer graph convolutional network, and a residual connection is added to each layer of the graph convolutional network;
[0032] The step of aggregating semantic information of neighbor entity nodes of the target entity node and relationship semantic information between neighbor nodes to the target entity node by weighted summation to obtain a second vector representation of the target entity includes:
[0033] After each layer of the graph convolution network aggregates the semantic information of the target entity node's own neighbor entity nodes and the relationship semantic information between the neighbor nodes to the target entity node by weighted summation, based on the residual connection on this layer of the graph convolution network, the output and input of this layer of the graph convolution network are superimposed as the input of the next layer of the graph convolution network until the last layer of the graph convolution network is calculated. The calculation result of the last layer of the graph convolution layer is used as the second vector representation of the target entity.
[0034] In an optional implementation of the first aspect of the present application, the jointly learning the first vector representation and the second vector representation of the same entity to obtain a fused vector representation of the entity includes:
[0035] Acquire the feature interaction between the first vector representation and the second vector representation of the same entity through a self-attention mechanism to obtain a joint learning preliminary vector representation of the entity;
[0036] The jointly learned preliminary vector representation is nonlinearly transformed into a fused vector representation through a two-layer feedforward neural network.
[0037] In an optional implementation of the first aspect of the present application, performing the entity alignment operation based on the fused vector representation of the entity in the first medical knowledge graph and the fused vector representation of the entity in the second medical knowledge graph includes:
[0038] Calculating the similarity between each vector in the first vector set and each vector in the second vector set one by one; the first vector set includes fused vector representations corresponding to each entity in the first medical knowledge graph, and the second vector set includes fused vector representations corresponding to each entity in the second medical knowledge graph;
[0039] An entity alignment operation is performed on the first medical knowledge graph and the second medical knowledge graph according to a calculation result of a similarity between each vector in the first vector set and each vector in the second vector set.
[0040] The second aspect of the present application provides an entity alignment device for medical knowledge graph, the device comprising:
[0041] A heterogeneous graph model construction module is used to construct a heterogeneous graph model of the medical knowledge graph according to the medical knowledge graph and the cross-layer link set; the heterogeneous graph model includes an ontology graph and an instance graph, and the instance graph is linked to the ontology graph based on the cross-layer link set; the ontology graph describes concepts and hierarchical relationships between concepts; the instance graph describes the topological structure of an entity; and the cross-layer link set describes the type of the concept of an entity;
[0042] A vectorization module, used to learn the contextual semantic information of the entity in the medical knowledge graph at the ontology layer according to the ontology graph, and obtain a first vector representation of the entity; and used to learn the contextual semantic information of the entity in the medical knowledge graph at the instance layer according to the instance graph, and obtain a second vector representation of the entity;
[0043] A vector fusion module, used for jointly learning the first vector representation and the second vector representation of the same entity to obtain a fused vector representation of the entity;
[0044] The entity alignment module is used to perform an entity alignment operation based on the fused vector representation of the entity in the first medical knowledge graph and the fused vector representation of the entity in the second medical knowledge graph.
[0045] The third aspect of the present application provides an entity alignment device for medical knowledge graphs, the device comprising a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the entity alignment method for medical knowledge graphs as described in any implementation method of the first aspect.
[0046] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the entity alignment method for medical knowledge graphs introduced in any implementation manner of the first aspect.
[0047] In the entity alignment technical solution for medical knowledge graph introduced in this application, a heterogeneous graph model of medical knowledge graph is first constructed based on medical knowledge graph and cross-layer link set. The cross-layer link set describes the type of entity concept. The constructed heterogeneous graph model includes an ontology graph and an instance graph. The instance graph is linked to the ontology graph based on the cross-layer link set. The ontology graph describes the hierarchical relationship between concepts and the instance graph describes the topological structure of the entity. The heterogeneous model realizes the hierarchical representation of medical entities and effectively represents the hierarchical structure and semantic boundaries of multi-source information of entities in the medical knowledge graph. On the basis of the constructed heterogeneous graph model, in this scheme, the vector representation of the entity is learned from the ontology graph and the instance graph respectively. Specifically, the first vector representation of the entity is obtained by learning the contextual semantic information of the entity in the ontology layer in the medical knowledge graph according to the ontology graph, and the second vector representation of the entity is obtained by learning the contextual semantic information of the entity in the instance layer in the medical knowledge graph according to the instance graph. In order to make full use of the entity vector representation learned from the two levels, the first vector representation and the second vector representation of the same entity are subsequently jointly learned to obtain the fusion vector representation of the entity. When it is necessary to align entities in two different medical knowledge graphs, it is only necessary to perform the entity alignment operation based on the fused vector representations of the entities in different medical knowledge graphs.
[0048] Since the heterogeneous graph model is constructed based on the knowledge graph in the medical field, the constructed instance graph and ontology graph can reflect the characteristics of the medical field from different levels. Therefore, the fused vector representation of the entity finally obtained through joint learning can not only have the domain characteristics of the medical knowledge graph, but also effectively combine the semantic information of the ontology layer and the instance layer. Therefore, in this scheme, the fused vector representation helps improve the accuracy of entity alignment in the medical knowledge graph. In this scheme, the multi-source information of medical entities is fully utilized to realize the representation and fusion of medical knowledge, overcome the influence of the complexity of medical knowledge on entity alignment, and greatly improve the performance and robustness of medical entity alignment. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0050] Figure 1 An implementation process architecture diagram of an entity alignment method for medical knowledge graphs provided in an embodiment of the present application;
[0051] Figure 2 A schematic diagram of a flow chart of an entity alignment method for a medical knowledge graph provided in an embodiment of the present application;
[0052] Figure 3 A schematic diagram of the overall process of obtaining a first vector representation and a second vector representation provided in an embodiment of the present application;
[0053] Figure 4 A flowchart for obtaining a first vector representation of an entity provided in an embodiment of the present application;
[0054] Figure 5 A flowchart for obtaining a second vector representation of an entity provided in an embodiment of the present application;
[0055] Figure 6 A schematic diagram of the structure of an entity alignment device for a medical knowledge graph provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] As described above, the alignment effect of the entity alignment method of the current medical knowledge graph needs to be improved. The main reason is that the use of contextual semantics in the knowledge graph is neglected. MTransE and BootEA have their own applications in the fields of knowledge graph and cross-language processing. MTransE (Multilingual TransE) is a translation-based cross-language knowledge graph representation learning model that aims to solve the problem of entity and relationship alignment in cross-language knowledge graphs. It achieves cross-language knowledge graph embedding by building an independent low-dimensional vector space for the knowledge graph of each language and learning the transformation relationship between these spaces. MTransE is widely used in the construction of cross-language knowledge graphs, entity alignment, relationship extraction and other fields, which helps to improve the ability of machines to process multilingual data. BootEA is an open source project based on TensorFlow, which mainly solves the problem of entity alignment in cross-language or cross-source knowledge graphs. BootEA has broad application prospects in the fields of machine translation, cross-language social media analysis, etc. It can assist in identifying and converting the proper nouns involved in the original document, and understand and integrate multiple information across language barriers. Even entity alignment technologies such as MtransE and BootEA are mainly aimed at general knowledge graphs and do not take into account the domain characteristics of medical knowledge graphs, resulting in insufficient accuracy in entity alignment.
[0057] In order to further improve the accuracy of entity alignment in medical knowledge graph, the inventor has provided a method, device, equipment and computer-readable storage medium for entity alignment in medical knowledge graph after research. In the technical solution of the present application, based on the type of concept of entity in medical knowledge graph, the ontology information and instance information contained in the medical knowledge graph are described from two perspectives (or two levels) based on the medical knowledge graph, so as to effectively represent the structure and semantic boundary of multi-source information of medical entities. Specifically, a heterogeneous graph model of medical knowledge graph is constructed, which includes an ontology graph and an instance graph. The instance graph is linked to the ontology graph based on a cross-layer link set. The ontology graph describes the hierarchical relationship between concepts and concepts, and the instance graph describes the topological structure of the entity. Then, the vector representation of the entity in the medical knowledge graph is learned based on the ontology graph and the instance graph, which are respectively called the first vector representation and the second vector representation. Next, the first vector representation and the second vector representation learned at the two levels are jointly learned to effectively fuse the information at the two levels of the ontology layer and the instance layer to obtain the fused vector representation of the entity. Finally, when performing entity alignment, the entity alignment is achieved by comparing the fused vector representations of each entity in different medical knowledge graphs. In the technical solution of this application, the accuracy of entity alignment in the medical knowledge graph is improved through the above method.
[0058] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0059] See also Figure 1 , which is a flowchart of an entity alignment method for medical knowledge graphs provided in an embodiment of the present application. Figure 1 As shown in the figure, in this method, a two-layer heterogeneous graph model is first constructed based on multi-source information in the medical knowledge graph, such as ontology information, structure information, attribute information, and description information. One layer is called the ontology layer, and the other layer is called the instance layer. The ontology layer in the heterogeneous graph model corresponds to the ontology graph G o , the instance layer corresponds to the instance graph G in the heterogeneous graph I .
[0060] In this scheme, the ontology graph G o and instance graph G I The association is realized based on the cross-layer link set. The cross-layer link set describes the type of the concept of the entity. For example, "liver cancer" is a medical entity in the medical knowledge graph, and its concept is a "disease". The "liver cancer" node in the instance graph is linked to the "disease" node in the ontology graph. In this way, the two-layer structure is interconnected and does not exist in isolation. The association of the two-layer semantics is realized. Figure 1 As shown in the ontology graph G o With the example graph G I The dotted line between them represents the cross-layer link between them.
[0061] Combination Figure 1 As shown, it is necessary to o Based on the contextual semantics of the entity at the ontology level, the first vector representation k1 of the medical entity is obtained and IThe second vector representation k2 of the medical entity is obtained based on the contextual semantics of the entity at the instance layer. The first vector representation k1 and the second vector representation k2 of the same medical entity are fused to construct a fused vector representation k3 of the entity. Assume that two medical knowledge graphs need to be aligned for entities. For ease of explanation, the two medical knowledge graphs are named KG1 and KG2 respectively. When it is necessary to align medical knowledge graph entities, it is only necessary to generate a fused vector representation k3 of each node for KG1 in advance, and to generate a fused vector representation of each node for KG2 in advance. Based on the fused vector representation of each node in KG1 and the fused vector representation k3 of each node in KG2, comparisons are made (for example, comparison of entity similarity by distance), and finally the alignment of medical entities in KG1 and KG2 is completed.
[0062] Combine the following Figure 2 The process shown in the figure introduces the implementation of the entity alignment method for medical knowledge graph. Figure 1 The process architecture diagram shown in the figure can help you understand the relevant process. Figure 2 As shown in FIG. 1 , the entity alignment method for medical knowledge graph includes:
[0063] S21. Construct a heterogeneous graph model of the medical knowledge graph based on the medical knowledge graph and the cross-layer link set.
[0064] Assuming that a medical knowledge graph KG1, a cross-layer link set T and an ontology O are given, the heterogeneous graph model of the constructed medical knowledge graph KG1 can be recorded as MHG = (C, E, R, A, V, L, T). Among them, C represents the concept set, E represents the entity set, R represents the relationship set, A represents the attribute set, V represents the attribute value set, L represents the edge set, and T represents the cross-layer link set.
[0065] The following introduces the ontology graph G included in the heterogeneous graph model o and instance graph G I ,The cross-layer link set describes the type of the concept of the entity, the instance graph G I Link to ontology graph G based on cross-layer link set o . Example Figure G I Describes the topological structure of an entity. o Describe concepts and the hierarchical relationships between concepts.
[0066] The main body layer in MHG is denoted as That is, the ontology graph G o The construction of is based on the concept set C, relationship set R and edge set L of the medical knowledge graph KG1. It retains the original expression of the ontology and uses a directed acyclic graph structure with a hierarchical relationship to represent the concepts related to medical entities and the hierarchical relationship between concepts. The data of the ontology layer is presented as the ontology graph Go In the ontology graph G o In the example, node c∈V o Represents a concept. (c2,subClassOf,c1)∈L o Represents an edge between concepts. The starting node of this edge is concept c2, and the ending node is concept c1. "subClassOf" is the type of the edge, that is, the relationship between concepts.
[0067] In some medical ontologies, in addition to hierarchical relationships, concepts also contain some attribute relationships, such as the site of occurrence, the cause of the disease, etc. These attribute relationships can be reallocated to the instance layer. In the instance layer, the instance graph of MHG is reconstructed using the relationship triples and attribute triples in the medical knowledge graph KG1 and the attribute information in the ontology. That is, the instance graph G I The construction is based on the entity set E, attribute value set V, relationship set R, attribute set A and edge set L.
[0068] Through this solution S21, the construction of a heterogeneous graph model is realized, and the data and semantic information of the medical knowledge graph are represented and linked through the ontology layer and the instance layer. In order to achieve entity alignment, the vector representation corresponding to the entity at the ontology layer and the instance layer is obtained through S22.
[0069] S22. Learn the contextual semantic information of entities in the medical knowledge graph at the ontology layer according to the ontology graph to obtain a first vector representation of the entity; and learn the contextual semantic information of entities in the medical knowledge graph at the instance layer according to the instance graph to obtain a second vector representation of the entity.
[0070] It should be noted that in the technical solution of the present application, the steps of obtaining the first vector representation of the entity and the second vector representation of the entity can be performed one after the other or simultaneously. For example, the first vector representation of the entity can be obtained first, and then the second vector representation can be obtained; the second vector representation of the entity can be obtained first, and then the first vector representation can be obtained; or the first vector representation and the second vector representation can be obtained at the same time.
[0071] First, the method of obtaining the first vector representation of the entity is introduced. Figure 3 The figure is a schematic diagram of the overall process of obtaining a first vector representation and a second vector representation. Figure 3 S221-S222 of the present invention take the target entity as an example to introduce the method of obtaining the first vector representation thereof. S223-S224 introduce the method of obtaining the second vector representation of the target entity. The target entity may be any entity in the medical knowledge graph.
[0072] like Figure 3, learning the contextual semantic information of entities in the medical knowledge graph at the ontology layer according to the ontology graph, and obtaining the first vector representation of the entity, may include:
[0073] S221. For a target entity in the medical knowledge graph, determine a set of concept nodes related to the target entity in the ontology graph based on a set of cross-layer links.
[0074] In order to realize the extraction of the vector representation of the target entity at the ontology layer, in this application, the set of concept nodes related to the entity must first be determined. That is, the concepts related to the target entity are locked at the ontology layer. Among them, the concepts related to the target entity can be directly linked to the target entity across layers, and can also include the parent nodes, ancestor nodes, etc. of the nodes in the ontology graph that are directly linked to the target entity across layers. The above nodes can all be called ancestor nodes related to the target entity. In order to achieve effective aggregation of the contextual semantics of the target entity at the ontology layer, in this solution, the set of concept nodes related to the target entity includes all ancestor nodes related to the target entity. Next, the aggregation of the semantic information of the relevant concept nodes is achieved through S222 to obtain the first vector representation of the target entity.
[0075] S222: Aggregate the semantic information of each concept node in the concept node set to obtain a first vector representation of the target entity.
[0076] Figure 4 A flowchart of obtaining a first vector representation of an entity is provided in an embodiment of the present application. In the figure, S2221 to S2224 focus on introducing the semantic aggregation process of concept nodes.
[0077] Schematic diagram of the implementation process of aggregating semantic information at the ontology level. Figure 4 As shown in , the semantic information of each concept node in the concept node set is aggregated to obtain the first vector representation of the target entity, including:
[0078] S2221. Obtain the vector representation of each concept node in the concept node set.
[0079] In this application, there is a parent-child relationship between each concept node in the concept node set. Each node has an embedding initialization stage, and an embedding vector can be initialized for each concept node in advance. Then the parent concept is expressed using the embedding of the child concept node. The embedding of concepts related to the entity is then used to express the semantics of the entity at the ontology level. These embeddings will be updated through training with sample data. After the training is completed, the final embedding vectors of all concepts are obtained.
[0080] The target concept node refers to any concept node in the concept node set, which is convenient for explanation and understanding. The vector representation of each concept node in the concept node set is obtained, including:
[0081] For the target concept node in the concept node set, obtain the correlation coefficient between each first-order sub-concept node of the target concept node and the target concept node. The first-order sub-concept node of the target concept node refers to a concept node that is directly connected to the target concept node and has the target concept node as a parent node. A target concept node may have one first-order sub-concept node or multiple first-order sub-concept nodes. The correlation coefficient between the first-order sub-concept node and the target concept node is used to characterize the semantic contribution of the first-order sub-concept node to the target concept node. It can be understood that the higher the correlation coefficient, the higher the semantic contribution of the first-order sub-concept node to the target concept node. Conversely, if the correlation coefficient is lower, it means that the semantic contribution of the first-order sub-concept node to the target concept node is lower.
[0082] Assume that the initial vector of the target concept node i is represented by c i , all its first-order sub-concept nodes are taken as the set M i The constituent elements of the set M i The initial vector of a first-order sub-concept node j in is represented by c j The correlation coefficient between the target concept node and the first-order sub-concept node can be expressed as e ij :
[0083] e ij =a T ([W o ·c i ||W o ·c j ]), j∈M i Formula (1)
[0084] In the formula, α represents a learnable parameter and T represents the transposition operation. T Responsible for mapping the concatenated high-dimensional features to a real number. || represents the concatenation operation, W o are learnable weight parameters.
[0085] Next, according to the correlation coefficients between each first-order sub-concept node of the target concept node and the target concept node, the semantic contribution weight coefficient α of each first-order sub-concept node to the target concept node is calculated by the normalized exponential function: ij See formula (2) for details:
[0086]
[0087] In the formula, LeakyReLU is an activation function. In the previous formula (1), only the correlation coefficients between the first-order sub-concept nodes of the target concept node and the target concept node were obtained. Through the normalized calculation of formula (2), the semantic contribution of each first-order sub-concept node to the target concept node can be limited to a unified and fixed range, eliminating the influence of dimension and achieving more convenient data analysis and processing.
[0088] Next, the vector representation of each first-order sub-concept node and the semantic contribution weight coefficient of each first-order sub-concept node to the target concept node are weighted and summed, and the second calculation result of the weighted sum is used as the vector representation of the target concept node. See formula (3) for details.
[0089]
[0090] In the formula, c i ' represents the final vector representation of the target concept node calculated by formula (3). j For the set M i The initial vector representation of a first-order sub-concept node in . ij W represents the semantic contribution weight coefficient, and its calculation is shown in formula (2). o is a learnable weight parameter. σ() represents the ReLU activation function.
[0091] Based on the vector representation of each concept node obtained by executing S2221, the semantic relationship between each concept node in the concept node set and the target entity is obtained through S2222~S2223, and then S2224 is combined with the mining results of S2221~S2223 to realize the vector representation of the target entity at the ontology layer.
[0092] S2222. Obtain the semantic compatibility weight coefficient between each concept node in the concept node set and the target entity.
[0093] The semantic compatibility weight coefficient is a scalar value used to represent the semantic compatibility between concepts and entities. The higher the semantic compatibility weight coefficient, the higher the semantic compatibility between the concepts and entities involved, and the closer the semantic connection; conversely, the lower the semantic compatibility weight coefficient, the lower the semantic compatibility between the concepts and entities involved, and the looser the semantic connection. The following formula (4) shows the method of calculating the semantic compatibility weight coefficient through a feedforward neural network.
[0094] f(x, y) = u T tanh(W c [x||y]+b c ) Formula (4)
[0095] In formula (4), x and y represent two vectors. c ∈R l×2m , W c represents a learnable weight matrix used to transform the dimension after vector concatenation, and || represents the concatenation operation. b c ∈R l , b c represents a bias vector. u is a learnable weight vector used to generate a scalar result. l represents the dimension of the hidden layer in the feedforward neural network. When the two parameters x and y are respectively passed into the initial vector representation of the target entity and the concept node vector representation of a concept node in the concept node set obtained by formula (3), the semantic compatibility weight coefficient between the concept node and the target entity can be obtained.
[0096] S2223. According to the semantic compatibility weight coefficient between each concept node in the concept node set and the target entity, the attention weight coefficient of each concept node in the concept node set is calculated by a normalized exponential function.
[0097]
[0098] e in formula (5) o is the initial vector representation of the target entity e, which is obtained by initialization. In the numerator of the formula, c j 'Represents the concept node set O related to the target entity e e The concept node vector representation of a concept node j in is obtained through formula (3). Formula (5) calculates the attention weight coefficient β of concept node j through a normalized indicator function (such as a softmax function) j process. e Represents the set of concept nodes related to the target entity. In the denominator of the formula, c k ' is the concept node set O e The vector representation of any concept node k in . The numerical value of the attention weight coefficient represents the influence of the concept node on the semantics of the target entity, and the numerical value is positively correlated with the influence.
[0099] S2224. Use the vector representation of each concept node in the concept node set and the attention weight coefficient to perform weighted summation, and use the first calculation result of the weighted summation as the first vector representation of the target entity.
[0100] Based on the attention weight coefficient calculated by formula (5) and the vector representation of the concept node implemented by formula (3), refer to formula (6), which shows how to calculate the first vector representation k1 of the target entity e at the ontology layer.
[0101]
[0102] At this point, the purpose of vector representation of the target entity e at the ontology layer has been achieved.
[0103] Next, we introduce how to obtain the second vector representation of the entity. Unlike the ontology graph, the instance graph is essentially a multi-relation heterogeneous graph with strong heterogeneity. Therefore, in this scheme, the second vector representation of the entity in the instance graph is learned based on relationship perception. This learning process can be achieved by a relationship-aware heterogeneous graph convolution module NmGCN, which mainly includes three parts: attention module, aggregation update module and residual module. In the attention module, the self-attention mechanism in the transformer can be used to calculate the attention weight coefficient (or attention score) of the central node to the neighboring node. Since the central node's attention to the neighbors is different, the attention depends not only on the neighbors of the central node, but also on the type of relationship between the central node and the neighboring nodes. In this scheme, the Q, K, and V mapping matrices in the self-attention mechanism are reconstructed according to the relationship. In the aggregation update module, the attention weight coefficient (or attention score) of the central node to the neighboring nodes is used to aggregate the vector representation of the neighboring nodes in a weighted summation manner, thereby obtaining the second vector representation of the central node at the instance layer.
[0104] like Figure 3 , learning the contextual semantic information of entities in the medical knowledge graph at the instance layer according to the instance graph, and obtaining the second vector representation of the entity, may include:
[0105] S223. For a target entity node representing a target entity in the instance graph, an attention weight coefficient of the target entity node to its own neighbor nodes is obtained through a self-attention mechanism according to the target entity node's own neighbor nodes and the relationship type between the target entity node and its own neighbor nodes.
[0106] Neighbor nodes include neighbor entity nodes and neighbor attribute nodes. In the technical solution of this application, both neighbor entity nodes and neighbor attribute nodes can provide clues in context semantics. Therefore, S223 needs to combine the information of these nodes, take the target entity node as a central node, and obtain its attention weight coefficient for the neighbor nodes.
[0107] For example, for a given instance graph G I ,(v,r,u|v,u∈V I ,r∈R I )∈L I , represents the instance graph G I An edge in G, v represents the starting node of this edge, u represents the ending node of this edge, and r represents the type of this edge.I The vector representation set of all nodes in is Where d represents the dimension of the vector.
[0108] Define three mapping matrices Q for different relations r r , K r and V r .Q r ∈R f×m , K r ∈R f×m and V r ∈R f×m , are the learnable query matrix, key matrix, and value matrix determined by the relationship. f is the dimension of the query vector, key vector, and value vector after feature extraction through matrix mapping.
[0109] When S223 is implemented, the matrix Q is used r Extract the features of the target entity node as the query vector, from K r and V r The features of a first-order neighbor node of the target entity node are extracted as the key vector and value vector respectively. There are three mapping matrices Q about the edge type r r , K r and V r The query vector q extracted from i r , key vector k j r Sum value vector v j r For the calculation of , see formula (7).
[0110]
[0111] In formula (7), h i and h j are the vector representation of the target entity node and the vector representation of its neighbor nodes respectively. v ∈R m×d is a learnable weight matrix responsible for the linear transformation of the node vector. j r and vector q i r Based on this, the attention weight coefficient p of the target entity node to its neighbor node is obtained through formula (8): ij :
[0112]
[0113] In the formula, f represents the vector k j r and vector q i r The dimension of . T represents the transposition operation. Then, the attention weight coefficient p can be calculated by formula (9) ij Perform normalization:
[0114]
[0115] In the formula, s ij Represents the normalized attention weight coefficient of the target entity node to its neighbor nodes obtained through the self-attention mechanism, N e Represents the set of first-order neighbor nodes of the target entity node. The attention weight coefficient of the target entity node to its neighbor nodes mentioned in S224 below may specifically refer to the normalized attention weight coefficient calculated by formula (9).
[0116] S224. Utilizing the vector representation of each neighbor node of the target entity node and the attention weight coefficient of the target entity node to its own neighbor nodes, the semantic information of the neighbor entity nodes of the target entity node itself and the relationship semantic information between the neighbor nodes are aggregated to the target entity node by weighted summation to obtain a second vector representation of the target entity.
[0117] Figure 5 A flowchart of obtaining a second vector representation of an entity is provided in an embodiment of the present application. In the figure, S2241 to S2243 focus on the semantic aggregation process of neighbor nodes in the instance layer.
[0118] In an optional implementation of the first aspect of the present application, the implementation process of S224 includes:
[0119] S2241. Through a multi-head attention mechanism, each attention head is used to obtain a weighted sum of the vector representations of the target entity node's neighbor nodes and the target entity node's attention weight coefficients for its own neighbor nodes, and to generate a semantic information aggregation vector representation of the target entity node.
[0120] Based on the vector representation of each neighbor node (specifically the value vector) and the attention weight coefficient of the target entity node to the neighbor node, the weighted sum is used to generate the semantic information aggregation vector representation of the target entity node as shown in formula (10):
[0121]
[0122] In the formula, s ij Indicates the normalized attention weight coefficient of the target entity node to its neighbor nodes obtained through the self-attention mechanism. jr A vector of values representing neighbor nodes. is the semantic information aggregation vector representation of the target entity node. Through the process of formula (10), the aggregation of the semantic information of the target entity node by a single attention head is completed.
[0123] Compared with the single-head attention mechanism, the multi-head attention mechanism can enhance the stability of the model in this solution. To this end, the multi-head attention mechanism can be further used to realize the semantic representation of the target entity node. See S2242 to S22243.
[0124] S2242. Concatenate the semantic information aggregation vector representations of the target entity node generated by each attention head to obtain a concatenated vector representation.
[0125] S2243. Convert the concatenated vector representation into the dimension of the semantic information aggregation vector representation before concatenation to obtain a second vector representation of the target entity.
[0126] Assume that K attention heads are configured, and K is a positive integer greater than or equal to 2. Please see formula (11), based on S2241, the output results of the K attention heads are concatenated to obtain the second vector representation k2 of the target entity.
[0127]
[0128] represents the semantic information aggregation vector representation of the target entity node calculated by the kth attention head among the K attention heads according to formula (10). Concat represents the concatenation operation, W c ∈R d×Kf It is a learnable weight matrix responsible for converting the vector generated by the multi-head attention mechanism into the original dimension of the input.
[0129] As mentioned above, the heterogeneous graph convolution module NmGCN also includes a residual module. In an optional implementation of the present application, the aggregation of entity semantic information is achieved through a multi-layer graph convolution network, and residual connections are added to each layer of the graph convolution network. The added residual connection can retain the original information of the input and reduce the probability of losing important information in the original information.
[0130] The semantic information of the neighboring entity nodes of the target entity node and the relationship semantic information between the neighboring nodes are aggregated to the target entity node by weighted summation to obtain a second vector representation of the target entity, including:
[0131] After each layer of the graph convolution network aggregates the semantic information of the target entity node’s neighbor entity nodes and the relationship semantic information between the neighbor nodes to the target entity node through weighted summation, the output and input of this layer of the graph convolution network are superimposed based on the residual connection on this layer of the graph convolution network as the input of the next layer of the graph convolution network until the last layer of the graph convolution network is calculated. The calculation result of the last layer of the graph convolution layer is used as the second vector representation of the target entity.
[0132] k2 l+1 =k2 l+1 +k2 l
[0133] The above formula shows the calculation form of the residual link. l+1 represents the computational output of the l+1th layer of the graph convolutional network, k2 l Represents the computational input of the l+1th layer of the graph convolutional network (also the true output of the lth layer of the graph convolutional network). By re-assigning the formula, the true output of the l+1th layer of the graph convolutional network is equal to the sum of the computational input and output of the network, thus achieving superposition. Assuming a total of N layers of graph convolutional neural networks, the value of l should be an integer between 1 and N-1.
[0134] At this point, the purpose of vectorizing the target entity at the instance level has been achieved.
[0135] S23. Jointly learn the first vector representation and the second vector representation of the same entity to obtain a fused vector representation of the entity.
[0136] In an optional implementation of the present application, a first vector representation and a second vector representation of the same entity are jointly learned to obtain a fused vector representation of the entity, including: acquiring feature interactions between the first vector representation and the second vector representation of the same entity through a self-attention mechanism to obtain a jointly learned preliminary vector representation of the entity; and nonlinearly transforming the jointly learned preliminary vector representation into a fused vector representation through a two-layer feedforward neural network.
[0137] The purpose of feature interaction learning is to combine the vector representations learned by the ontology layer and instance layer of the heterogeneous graph model to obtain a complete vector representation that can describe the entity. During this period, it is expected that the entity information of the ontology layer and the instance layer can be effectively integrated and the semantic loss can be reduced. In this step, the feature interaction between entities at different layers can still be captured through the self-attention mechanism. Specifically, the first vector representation k1 and the second vector representation k2 of the target entity can be used as the input of the self-attention mechanism.
[0138] Formula (12) shows the three matrices Q corresponding to query, key and value after the self-attention mechanism is applied:f , K f and V f Calculation method of . In the formula, W qf ∈R n×d , W kf ∈R n×d and W vf ∈R n×d are all learnable parameter matrices. They are used to extract the query, key, and value of a tensor. || represents a concatenation operation, and d is the dimension of the vector.
[0139] Q f =W qf (k1||k2), K f =W kf (k1||k2), V f =W vf ·(k1||k2) Formula (12)
[0140] Based on the calculation results of formula (12), formula (13) also shows the preliminary results of the joint learning of the target entity, that is, the preliminary vector representation O of the joint learning f .
[0141]
[0142] Next, the vector O obtained by joint learning is transformed into f Perform a nonlinear transformation:
[0143] k3=σ(W F ′·(σ(W F ·flat(O f ))+b 1 ))+b 2 Formula (14)
[0144] In formula (3), k3 is the fusion vector representation of the target entity obtained after nonlinear transformation. F and W F ' are the linear transformation parameter matrices in the two-layer feedforward neural network. flat is the expansion operation of the tensor, b 1 and b 2 They represent bias respectively. σ() represents the activation function, which can be ReLU.
[0145] After steps S21 to S23 in this solution are completed, the fusion vector representation of the entity in the medical knowledge graph can be obtained. It can be understood that in the scenario where the entity alignment operation needs to be performed, at least two medical knowledge graphs are generally involved, and the medical entities in the at least two medical knowledge graphs are aligned. For the sake of ease of introduction, the entity alignment process of two medical knowledge graphs (the first medical knowledge graph and the second medical knowledge graph) is explained in S24.
[0146] S24. Perform an entity alignment operation based on the fused vector representation of the entity in the first medical knowledge graph and the fused vector representation of the entity in the second medical knowledge graph.
[0147] The first medical knowledge graph and the second medical knowledge graph can be represented as KG1 and KG2 respectively. The set containing the fused vector representations corresponding to each entity in KG1 is called the first vector set, and the set containing the fused vector representations corresponding to each entity in KG2 is called the second vector set.
[0148] An optional implementation of this step is:
[0149] The similarity between each vector in the first vector set and each vector in the second vector set is calculated one by one; and according to the calculation result of the similarity between each vector in the first vector set and each vector in the second vector set, an entity alignment operation is performed on the first medical knowledge graph and the second medical knowledge graph.
[0150] When measuring whether two vectors are similar, the distance between the vectors can be used to determine it. For example, the Manhattan distance is used to measure the similarity between two vectors, and then the similarity between the entities is determined. Specifically, the smaller the Manhattan distance, the higher the similarity; the larger the Manhattan distance, the lower the similarity. The similarity calculation formula is shown below:
[0151]
[0152] In the formula, e i represents an entity in the first medical knowledge graph KG1, e j represents an entity in the second medical knowledge graph KG2, k3 i For entity e i The fusion vector representation of k3 j For entity e j The fusion vector representation of . L1 represents the norm.
[0153] In the specific implementation, for example, for an entity e in the first medical knowledge graph KG1 i In S24, the fusion vector representation of each entity in the second medical knowledge graph KG2 can be combined with the entity e in KG1 one by one.i The fusion vector representation of is used to calculate the similarity, sort the obtained similarities, compare the highest similarity with the similarity threshold (it can also be understood as comparing the smallest Manhattan distance with the distance threshold). If the entity with the highest similarity meets the requirement that the similarity is greater than the similarity threshold (or the smallest Manhattan distance is less than the distance threshold), then it is considered that the entity with the highest similarity in KG2 is similar to the entity e in KG1. i Alignment.
[0154] In the entity alignment technical solution for medical knowledge graph introduced in this application, a heterogeneous graph model of medical knowledge graph is first constructed based on medical knowledge graph and cross-layer link set. The cross-layer link set describes the type of entity concept. The constructed heterogeneous graph model includes an ontology graph and an instance graph. The instance graph is linked to the ontology graph based on the cross-layer link set. The ontology graph describes the hierarchical relationship between concepts and the instance graph describes the topological structure of the entity. The heterogeneous model realizes the hierarchical representation of medical entities and effectively represents the hierarchical structure and semantic boundaries of multi-source information of entities in the medical knowledge graph. On the basis of the constructed heterogeneous graph model, in this scheme, the vector representation of the entity is learned from the ontology graph and the instance graph respectively. Specifically, the first vector representation of the entity is obtained by learning the contextual semantic information of the entity in the ontology layer in the medical knowledge graph according to the ontology graph, and the second vector representation of the entity is obtained by learning the contextual semantic information of the entity in the instance layer in the medical knowledge graph according to the instance graph. In order to make full use of the entity vector representation learned from the two levels, the first vector representation and the second vector representation of the same entity are subsequently jointly learned to obtain the fusion vector representation of the entity. When it is necessary to align entities in two different medical knowledge graphs, it is only necessary to perform the entity alignment operation based on the fused vector representations of the entities in different medical knowledge graphs.
[0155] Since the heterogeneous graph model is constructed based on the knowledge graph in the medical field, the constructed instance graph and ontology graph can reflect the characteristics of the medical field from different levels. Therefore, the fused vector representation of the entity finally obtained through joint learning can not only have the domain characteristics of the medical knowledge graph, but also effectively combine the semantic information of the ontology layer and the instance layer. Therefore, in this scheme, the fused vector representation helps improve the accuracy of entity alignment in the medical knowledge graph. The entity alignment method in general fields does not take into account the characteristics of the medical field, and its performance on the medical knowledge graph is not ideal. This application solves the problem of medical entity alignment and medical knowledge fusion, and provides strong support for downstream knowledge-based reasoning services. In this scheme, the multi-source information of medical entities is fully utilized to realize the representation and fusion of medical knowledge, overcome the influence of the complexity of medical knowledge on entity alignment, and greatly improve the performance and robustness of medical entity alignment.
[0156] In the technical solution of the present application, the entity alignment operation in step S24 can also be implemented by the model. The goal of the method of the embodiment of the present application to train the model is to make the value of the loss function as small as possible. That is, in the vector space, the distance between the vector representations corresponding to the aligned entity pairs (two entities) should be as close as possible, and the distance between the fused vector representations corresponding to the non-aligned entity pairs (two entities) should be as far apart as possible. Optionally, a marginal-based ranking loss function is used for model training, and the specific objective function is as follows:
[0157]
[0158] In the formula, [dis(i,j)-dis(i',j')+γ] + , which means taking the maximum value between dis(i,j)-dis(i',j')+γ and 0, where γ is the marginal hyperparameter that controls the distance between positive samples and negative samples. S and S' represent the positive sample set and the negative sample set, respectively. i and j are the fusion vector representations of two entities in the positive sample set, and these two entities are two entities in the aligned entity pair; i' and j' are the fusion vector representations of two entities in the negative sample set, and these two entities are two entities in the non-aligned entity pair. When sampling positive and negative samples, the sampling range can be limited, and the nearest neighbor sampling method can be used to obtain a more discriminative negative sample set S'. In this way, the recognition of the model for entity alignment can be improved, and the accuracy of entity alignment can be increased.
[0159] Based on the entity alignment method for medical knowledge graphs introduced in the above embodiments, the present application also provides an entity alignment device for medical knowledge graphs. Figure 6 A schematic diagram of the structure of the device.
[0160] like Figure 6 As shown, an entity alignment device 60 for medical knowledge graph includes: a heterogeneous graph model construction module 601, a vectorization module 602, a vector fusion module 603 and an entity alignment module 604.
[0161] A heterogeneous graph model construction module 601 is used to construct a heterogeneous graph model of the medical knowledge graph according to the medical knowledge graph and the cross-layer link set; the heterogeneous graph model includes an ontology graph and an instance graph, and the instance graph is linked to the ontology graph based on the cross-layer link set; the ontology graph describes concepts and hierarchical relationships between concepts; the instance graph describes the topological structure of an entity; and the cross-layer link set describes the type of the concept of an entity;
[0162] A vectorization module 602 is used to learn the contextual semantic information of the entity in the medical knowledge graph at the ontology layer according to the ontology graph to obtain a first vector representation of the entity; and to learn the contextual semantic information of the entity in the medical knowledge graph at the instance layer according to the instance graph to obtain a second vector representation of the entity;
[0163] A vector fusion module 603, configured to jointly learn the first vector representation and the second vector representation of the same entity to obtain a fused vector representation of the entity;
[0164] The entity alignment module 604 is used to perform an entity alignment operation based on the fused vector representation of the entity in the first medical knowledge graph and the fused vector representation of the entity in the second medical knowledge graph.
[0165] Since the heterogeneous graph model is constructed based on the knowledge graph in the medical field, the constructed instance graph and ontology graph can reflect the characteristics of the medical field from different levels. Therefore, the fused vector representation of the entity finally obtained through joint learning can not only have the domain characteristics of the medical knowledge graph, but also effectively combine the semantic information of the ontology layer and the instance layer. Therefore, in this scheme, the fused vector representation helps improve the accuracy of entity alignment in the medical knowledge graph. In this scheme, the multi-source information of medical entities is fully utilized to realize the representation and fusion of medical knowledge, overcome the influence of the complexity of medical knowledge on entity alignment, and greatly improve the performance and robustness of medical entity alignment.
[0166] In an optional implementation, the vectorization module 602 is specifically used for:
[0167] For a target entity in the medical knowledge graph, a concept node set related to the target entity in the ontology graph is determined according to the cross-layer link set; the concept node set related to the target entity includes all ancestor nodes related to the target entity;
[0168] The semantic information of each concept node in the concept node set is aggregated to obtain a first vector representation of the target entity.
[0169] In an optional implementation, the vectorization module 602 is specifically used for:
[0170] Obtaining a vector representation of each concept node in the concept node set;
[0171] Obtaining semantic compatibility weight coefficients between each concept node in the concept node set and the target entity;
[0172] According to the semantic compatibility weight coefficient between each concept node in the concept node set and the target entity, the attention weight coefficient of each concept node in the concept node set is calculated by a normalized exponential function;
[0173] A weighted sum is taken using the vector representation of each concept node in the concept node set and the attention weight coefficient, and a first calculation result of the weighted sum is used as the first vector representation of the target entity.
[0174] In an optional implementation, the vectorization module 602 is specifically used for:
[0175] For a target concept node in the concept node set, obtaining correlation coefficients between each first-order sub-concept node of the target concept node and the target concept node; the correlation coefficients are used to characterize the semantic contribution of the first-order sub-concept nodes to the target concept node;
[0176] According to the correlation coefficients between each first-order sub-concept node of the target concept node and the target concept node, a semantic contribution weight coefficient of each first-order sub-concept node to the target concept node is calculated by a normalized exponential function;
[0177] The vector representation of each first-order sub-concept node and the semantic contribution weight coefficient of each first-order sub-concept node to the target concept node are weighted and summed, and a second calculation result of the weighted sum is used as the vector representation of the target concept node.
[0178] In an optional implementation, the vectorization module 602 is specifically used for:
[0179] For a target entity node representing the target entity in the instance graph, according to the target entity node's own neighbor nodes and the relationship type between the target entity node and its own neighbor nodes, an attention weight coefficient of the target entity node to its own neighbor nodes is obtained through a self-attention mechanism; the neighbor nodes include neighbor entity nodes and neighbor attribute nodes;
[0180] Utilizing the vector representation of each neighbor node of the target entity node and the attention weight coefficient of the target entity node to its own neighbor nodes, the semantic information of the target entity node's own neighbor entity nodes and the relationship semantic information between the neighbor nodes are aggregated to the target entity node by weighted summation to obtain a second vector representation of the target entity.
[0181] In an optional implementation, the vectorization module 602 is specifically used for:
[0182] Through a multi-head attention mechanism, each attention head uses the vector representation of each neighbor node of the target entity node and the attention weight coefficient of the target entity node to its own neighbor node to generate a semantic information aggregation vector representation of the target entity node by weighted summation;
[0183] splicing the semantic information aggregation vector representation of the target entity node generated by each attention head to obtain a spliced vector representation;
[0184] The concatenated vector representation is converted into the dimension of the semantic information aggregation vector representation before concatenation to obtain a second vector representation of the target entity.
[0185] In an optional implementation, the aggregation of entity semantic information is achieved through a multi-layer graph convolutional network, and residual connections are added to each layer of the graph convolutional network;
[0186] The vectorization module 602 is specifically used for:
[0187] After each layer of the graph convolution network aggregates the semantic information of the target entity node's own neighbor entity nodes and the relationship semantic information between the neighbor nodes to the target entity node by weighted summation, based on the residual connection on this layer of the graph convolution network, the output and input of this layer of the graph convolution network are superimposed as the input of the next layer of the graph convolution network until the last layer of the graph convolution network is calculated. The calculation result of the last layer of the graph convolution layer is used as the second vector representation of the target entity.
[0188] In an optional implementation, the vector fusion module 603 is specifically used for:
[0189] Acquire the feature interaction between the first vector representation and the second vector representation of the same entity through a self-attention mechanism to obtain a joint learning preliminary vector representation of the entity;
[0190] The jointly learned preliminary vector representation is nonlinearly transformed into a fused vector representation through a two-layer feedforward neural network.
[0191] In an optional implementation, the entity alignment module 604 is specifically used to:
[0192] Calculating the similarity between each vector in the first vector set and each vector in the second vector set one by one; the first vector set includes fused vector representations corresponding to each entity in the first medical knowledge graph, and the second vector set includes fused vector representations corresponding to each entity in the second medical knowledge graph;
[0193] An entity alignment operation is performed on the first medical knowledge graph and the second medical knowledge graph according to a calculation result of a similarity between each vector in the first vector set and each vector in the second vector set.
[0194] The entity alignment method for medical knowledge graphs introduced in the above embodiments can also be implemented by specific devices. Based on the above embodiments, the present application also provides an entity alignment device for medical knowledge graphs. The device includes a processor and a memory, wherein at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the entity alignment method for medical knowledge graphs introduced in any implementation method in the method embodiment.
[0195] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the entity alignment method for medical knowledge graphs introduced in the method embodiment are implemented.
[0196] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, in which the unit described as a separate component may or may not be physically separated, and the component prompted as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0197] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An entity alignment method for medical knowledge graph, characterized in that: include: According to the medical knowledge graph and the cross-layer link set, a heterogeneous graph model of the medical knowledge graph is constructed; the heterogeneous graph model includes an ontology graph and an instance graph, and the instance graph is linked to the ontology graph based on the cross-layer link set; the ontology graph describes concepts and hierarchical relationships between concepts; the instance graph describes the topological structure of an entity; and the cross-layer link set describes the type of the concept of an entity; Learning contextual semantic information of entities in the medical knowledge graph at the ontology layer according to the ontology graph to obtain a first vector representation of the entity; and learning contextual semantic information of entities in the medical knowledge graph at the instance layer according to the instance graph to obtain a second vector representation of the entity; Jointly learning the first vector representation and the second vector representation of the same entity to obtain a fused vector representation of the entity; An entity alignment operation is performed based on the fused vector representation of the entity in the first medical knowledge graph and the fused vector representation of the entity in the second medical knowledge graph.
2. The method according to claim 1, characterized in that The step of learning contextual semantic information of entities in the medical knowledge graph at the ontology layer according to the ontology graph to obtain a first vector representation of the entity includes: For a target entity in the medical knowledge graph, a concept node set related to the target entity in the ontology graph is determined according to the cross-layer link set; the concept node set related to the target entity includes all ancestor nodes related to the target entity; The semantic information of each concept node in the concept node set is aggregated to obtain a first vector representation of the target entity.
3. The method according to claim 2, characterized in that The aggregating semantic information of each concept node in the concept node set to obtain a first vector representation of the target entity includes: Obtaining a vector representation of each concept node in the concept node set; Obtaining semantic compatibility weight coefficients between each concept node in the concept node set and the target entity; According to the semantic compatibility weight coefficient between each concept node in the concept node set and the target entity, the attention weight coefficient of each concept node in the concept node set is calculated by a normalized exponential function; A weighted sum is taken using the vector representation of each concept node in the concept node set and the attention weight coefficient, and a first calculation result of the weighted sum is used as the first vector representation of the target entity.
4. The method according to claim 3, characterized in that The obtaining of the vector representation of each concept node in the concept node set includes: For a target concept node in the concept node set, obtaining correlation coefficients between each first-order sub-concept node of the target concept node and the target concept node; the correlation coefficients are used to characterize the semantic contribution of the first-order sub-concept nodes to the target concept node; According to the correlation coefficients between each first-order sub-concept node of the target concept node and the target concept node, a semantic contribution weight coefficient of each first-order sub-concept node to the target concept node is calculated by a normalized exponential function; The vector representation of each first-order sub-concept node and the semantic contribution weight coefficient of each first-order sub-concept node to the target concept node are weighted and summed, and a second calculation result of the weighted sum is used as the vector representation of the target concept node.
5. The method according to claim 1, characterized in that The step of learning contextual semantic information of an entity at an instance layer in the medical knowledge graph according to the instance graph to obtain a second vector representation of the entity includes: For a target entity node representing the target entity in the instance graph, according to the target entity node's own neighbor nodes and the relationship type between the target entity node and its own neighbor nodes, an attention weight coefficient of the target entity node to its own neighbor nodes is obtained through a self-attention mechanism; the neighbor nodes include neighbor entity nodes and neighbor attribute nodes; Utilizing the vector representation of each neighbor node of the target entity node and the attention weight coefficient of the target entity node to its own neighbor nodes, the semantic information of the target entity node's own neighbor entity nodes and the relationship semantic information between the neighbor nodes are aggregated to the target entity node by weighted summation to obtain a second vector representation of the target entity.
6. The method according to claim 5, characterized in that The method uses the vector representation of each neighbor node of the target entity node and the attention weight coefficient of the target entity node to its own neighbor node to aggregate the semantic information of the neighbor entity nodes of the target entity node and the relationship semantic information between the neighbor nodes to the target entity node by weighted summation to obtain the second vector representation of the target entity, including: Through a multi-head attention mechanism, each attention head uses the vector representation of each neighbor node of the target entity node and the attention weight coefficient of the target entity node to its own neighbor node to generate a semantic information aggregation vector representation of the target entity node by weighted summation; splicing the semantic information aggregation vector representation of the target entity node generated by each attention head to obtain a spliced vector representation; The concatenated vector representation is converted into the dimension of the semantic information aggregation vector representation before concatenation to obtain a second vector representation of the target entity.
7. The method according to claim 5, characterized in that The aggregation of entity semantic information is achieved through a multi-layer graph convolutional network, and residual connections are added to each layer of the graph convolutional network; The step of aggregating semantic information of neighbor entity nodes of the target entity node and relationship semantic information between neighbor nodes to the target entity node by weighted summation to obtain a second vector representation of the target entity includes: After each layer of the graph convolution network aggregates the semantic information of the target entity node's own neighbor entity nodes and the relationship semantic information between the neighbor nodes to the target entity node by weighted summation, based on the residual connection on this layer of the graph convolution network, the output and input of this layer of the graph convolution network are superimposed as the input of the next layer of the graph convolution network until the last layer of the graph convolution network is calculated. The calculation result of the last layer of the graph convolution layer is used as the second vector representation of the target entity.
8. The method according to claim 1, characterized in that The jointly learning the first vector representation and the second vector representation of the same entity to obtain a fused vector representation of the entity includes: Acquire the feature interaction between the first vector representation and the second vector representation of the same entity through a self-attention mechanism to obtain a joint learning preliminary vector representation of the entity; The jointly learned preliminary vector representation is nonlinearly transformed into a fused vector representation through a two-layer feedforward neural network.
9. The method according to claim 1, characterized in that: The entity alignment operation is performed based on the fused vector representation of the entity in the first medical knowledge graph and the fused vector representation of the entity in the second medical knowledge graph, including: Calculating the similarity between each vector in the first vector set and each vector in the second vector set one by one; the first vector set includes fused vector representations corresponding to each entity in the first medical knowledge graph, and the second vector set includes fused vector representations corresponding to each entity in the second medical knowledge graph; An entity alignment operation is performed on the first medical knowledge graph and the second medical knowledge graph according to a calculation result of a similarity between each vector in the first vector set and each vector in the second vector set.
10. An entity alignment device for medical knowledge graph, characterized in that: include: A heterogeneous graph model construction module is used to construct a heterogeneous graph model of the medical knowledge graph according to the medical knowledge graph and the cross-layer link set; the heterogeneous graph model includes an ontology graph and an instance graph, and the instance graph is linked to the ontology graph based on the cross-layer link set; the ontology graph describes concepts and hierarchical relationships between concepts; the instance graph describes the topological structure of an entity; and the cross-layer link set describes the type of the concept of an entity; A vectorization module, used to learn the contextual semantic information of the entity in the medical knowledge graph at the ontology layer according to the ontology graph, and obtain a first vector representation of the entity; and used to learn the contextual semantic information of the entity in the medical knowledge graph at the instance layer according to the instance graph, and obtain a second vector representation of the entity; A vector fusion module, used for jointly learning the first vector representation and the second vector representation of the same entity to obtain a fused vector representation of the entity; The entity alignment module is used to perform an entity alignment operation based on the fused vector representation of the entity in the first medical knowledge graph and the fused vector representation of the entity in the second medical knowledge graph.
11. An entity alignment device for medical knowledge graph, characterized in that: It includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the entity alignment method for medical knowledge graphs as described in any one of claims 1-9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the entity alignment method for medical knowledge graphs described in any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Knowledge graph fusion method based on entity alignment
CN110941722A
Medical knowledge graph entity alignment method based on representation learning
CN111309930A
High-speed train product structure tree knowledge fusion method and device and program product
CN114996476A
Ontology alignment apparatus, program, and method
EP3407208A1
Cited By
Knowledge graph entity alignment method and device based on ontology enhancement and feature fusion
CN119808921A
A knowledge graph entity alignment method and apparatus based on ontology enhancement and feature fusion
CN119808921B
Knowledge graph question and answer method based on double-cascade graph attention framework
CN120031127A
Medical knowledge graph construction method and device, equipment and storage medium
CN120705330A
Classified extraction method and device based on scientific research demand information
CN121166920A
