A neighbor entity-based medical knowledge graph automatic alignment method
By constructing a neighbor relationship mask matrix and an interaction matrix, combined with the BERT model and the RBF kernel aggregation function, the entity alignment process of the medical knowledge graph is optimized, the heterogeneity problem is solved, efficient automatic alignment is achieved, and reliance on manual annotation is reduced.
Patent Information
- Application Number
- CN202411413549.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-10-11
AI Technical Summary
Existing medical knowledge graphs have heterogeneity problems in the entity alignment process, resulting in low efficiency and reliance on manual annotation, which cannot fully understand the semantics of text information.
An automatic alignment method of medical knowledge graph based on neighbor entities was adopted. By constructing a neighbor relationship mask matrix and a neighbor entity interaction matrix, combined with the BERT model and RBF kernel aggregation function, the comprehensive similarity between entities was calculated, and the model was optimized using the gradient descent method.
It improves the accuracy and speed of entity alignment, reduces dependence on manual labeling, enhances the generalization and prediction capabilities of the model, and can automatically handle the heterogeneity of medical knowledge graphs.
Smart Images

Figure CN119227796B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of natural language processing, and particularly relates to a medical knowledge graph automatic alignment method based on neighbor entities. BACKGROUND
[0002] A knowledge graph is a high-efficiency method for representing and integrating knowledge. In a knowledge graph, entities are connected to different entities through relationships, forming a huge semantic network, so that the connection between entities becomes structured and easy to query. Therefore, in the medical field, a knowledge graph is widely used to promote medical information integration, optimize personalized medical decision-making, promote medical education and research, semantic search and medical knowledge question answering, etc. However, medical knowledge involves a wide range of content and is highly professional, and manual annotation and entity alignment of medical knowledge have high thresholds, requiring a large amount of manpower and time cost, and it is also difficult to keep up with the constantly updated medical knowledge. In addition, due to the different levels of refinement of medical knowledge carriers, the updating and iteration of medical knowledge, and the influence of colloquial expressions, there is heterogeneity among medical knowledge graphs, mainly in source difference, representation difference and semantic difference, and it is crucial to eliminate or reduce these heterogeneities to improve the efficiency and accuracy of entity alignment.
[0003] In order to solve the above problems, some scholars use knowledge representation learning-based methods to map entities to low-dimensional vector spaces, calculate the similarity between entities through mathematical methods, improve the accuracy of entity alignment, realize the automation of entity alignment, and reduce the dependence on manual annotation, but the knowledge representation learning-based method does not truly understand and predict the semantics of text information, but only performs simple vector mapping; in addition, some scholars introduce field aggregation matching networks, multi-view embedding frameworks and dynamic graph attention network models to solve the problem of knowledge graph heterogeneity, however, since the neighbors of entities are unordered and independent, these models have limitations in dealing with nonlinear problems, and some models have high computational complexity and cannot fully capture the complex relationships between all entities. SUMMARY
[0004] The present application is to solve the above-mentioned deficiencies in the prior art, and proposes a medical knowledge graph automatic alignment method based on neighbor entities, in order to reduce the influence of knowledge graph heterogeneity on entity alignment on the basis of obtaining medical knowledge representation features, and to realize the automation of medical knowledge graph entity alignment, thereby providing technical support for promoting medical information integration, optimizing personalized medical decision-making, promoting medical education and research, semantic search and medical knowledge question answering, etc.
[0005] In order to achieve the above-mentioned application purposes, the following technical solutions are adopted in the present application:
[0006] The application discloses a neighbor entity-based medical knowledge graph automatic alignment method.
[0007] Step one: obtaining a source medical knowledge graph and a target medical knowledge graph , wherein, denotes a query entity set in , denotes a query relationship set in , denotes a target entity set in , denotes a target relationship set in ;
[0008] Let any query entity in be denoted as , let any query relationship in be denoted as , let any target entity in be denoted as , and let any target relationship in be denoted as ;
[0009] Step two: constructing a neighbor entity-based medical knowledge graph automatic alignment network, including a vector representation module, a neighbor relationship mask matrix construction module, a neighbor entity interaction matrix construction module and a comprehensive similarity calculation module.
[0010] Step 2.1: the vector representation module processes and respectively by using formula (1) to obtain embedding vectors of and embedding vectors of :
[0011] (1)
[0012] In formula (1), denotes a multi-layer perception machine, denotes a class label symbol;
[0013] Step 2.2: the neighbor relationship mask matrix construction module constructs a neighbor relationship mask matrix according to the embedding vectors of the entities.
[0014] Step 2.3: the neighbor entity interaction matrix construction module constructs and according to the embedding vectors of the entities and The weight-adjusted neighbor entity interaction matrix , and get the final similarity embedding ;
[0015] Step 2.4: The comprehensive similarity calculation module uses formula (12) to calculate and The comprehensive similarity :
[0016] (12)
[0017] In formula (12), represents the cosine function, Represents a splicing operation;
[0018] Step 3: Use formula (13) to construct the pairwise boundary loss function , thereby using the gradient descent method to train the automatic alignment network of the medical knowledge graph based on neighbor entities, and continuously adjusting the pairwise boundary loss function during the training process The value of , until the pairwise boundary loss function Until convergence, the trained medical knowledge graph automatic alignment network based on neighbor entities is obtained, which is used to output the source medical knowledge graph and target medical knowledge graph The comprehensive similarity between
[0019] (13)
[0020] In formula (13), It is a maximization operation. express Zhongyu Any semantically aligned positive target entity, express Zhongyu Any negative target entity with semantic non-alignment, is a positive entity pair and negative entity pairs The boundary values enforced between Indicates Measured by distance and The similarity between Indicates that cosine similarity is used to measure and The similarity between them.
[0021] The automatic alignment method of medical knowledge graphs based on neighbor entities described in the present invention is also characterized in that step 2.2 is performed as follows:
[0022] Step 2.2.1: Calculate the average of the embedding vectors of all query entities associated with and the average of the embedding vectors of all target entities associated with :
[0023] (2)
[0024] In formula (2), denotes the set of associated with , denotes the number of elements in the set , denotes the set of associated with , denotes the number of elements in the set ;
[0025] Step 2.2.2: Calculate the average of the embedding vectors of all query entities associated with and the average of the embedding vectors of all target entities associated with :
[0026] (3)
[0027] In formula (3), and denote the vector representations of and , denotes the set of all associated with , denotes the number of elements in the set , denotes the set of all associated with , denotes the number of elements in the set ;
[0028] Step 2.2.4: Obtain the neighbor query relationship embedding vector and neighbor target relation embedding vectors :
[0029] (4)
[0030] Step 2.2.5: Calculate the cosine similarity of and : , thus obtaining the neighbor relation mask matrix :
[0031] (5).
[0032] Further, the step 2.3 is performed as follows:
[0033] Step 2.3.1: Calculate the neighbor interaction value between the th neighbor query entity of and the th neighbor target entity of using formula (6): wherein, denotes the neighbor entity interaction matrix: (6)
[0034] In formula (6), and
[0035] denote the vector representation of and respectively, denotes the modulus, denotes any row number of denotes any column number of ; Step 2.3.2: Obtain the weight-adjusted neighbor entity interaction matrix using formula (7):
[0036] (7)
[0037] In formula (7), denotes the weight adjustment;
[0038] Step 2.3.3: Obtain the maximum neighbor interaction value between and all its neighbor target entities
[0039] and the maximum neighbor interaction value between and all its neighbor query entities using formula (8), respectively:
[0040] (8)
[0041] In formula (8), denotes a maximization operation, denotes the total number of neighbor target entities of denotes the total number of neighbor query entities of
[0042] Step 2.3.4: Obtain the row-based similarity embedding and the column-based similarity embedding respectively by using formula (9):
[0043] (9)
[0044] In formula (9), denotes an exponential function, and denote the mean used by the i-th and j-th RBF kernel aggregation function respectively, and denote the variance used by the i-th and j-th RBF kernel aggregation function respectively;
[0045] Step 2.3.5: Obtain the row-based similarity embedding and the column-based similarity embedding respectively by using formula (10):
[0046] (10)
[0047] In formula (10), denotes a logarithm;
[0048] Step 2.3.6: Obtain the final similarity embedding of the weight-adjusted neighbor entity interaction matrix by formula (11):
[0049] (11)
[0050] In formula (11), denotes a concatenation operation.
[0051] The electronic device comprises a memory and a processor, and the memory is used to store a program supporting the processor to execute the medical knowledge graph automatic alignment method, and the processor is configured to execute the program stored in the memory.
[0052] The application discloses a computer readable storage medium, and a computer program is stored on the computer readable storage medium.
[0053] Compared with the prior art, the application has the beneficial effects that:
[0054] 1. The pre-trained BERT model is used for the application, the BERT model uses a Transformer architecture and an attention mechanism, learns deep language representation in a large amount of text data through an unsupervised learning task, can better capture potential semantic information between entities in the medical knowledge graph, and thus can more accurately complete entity alignment.
[0055] 2. The application constructs an interaction matrix between neighbor entities when designing the model, and adopts an RBF kernel aggregation function to extract features accumulated by similarity between entities, so as to represent knowledge, and thus can more clearly capture and understand direct and indirect connections between entities, and help improve the accuracy of entity alignment.
[0056] 3. The application further introduces a relationship mask matrix to process the problem of heterogeneity between medical knowledge graphs when constructing the model. In the case that entity neighbors are unordered or independent, the mask matrix helps the model filter out irrelevant information and avoid noise interference. By masking the relationship in the neighbor entity interaction matrix, unnecessary calculation can be reduced, and the running time of the model can be optimized. In addition, the mask matrix can enable the model to maintain good performance when seeing hidden or unobserved parts, thereby enhancing the generalization and prediction ability of the alignment model.
[0057] 4. The application can automatically align more medical entities after learning a set of limited alignment seeds, and can also help the model match various heterogeneous and sparse entities in the medical knowledge graph, so as to realize automatic alignment of the medical knowledge graph, and also achieve the purposes of significantly improving the alignment speed and reducing the dependence on manual annotation. BRIEF DESCRIPTION OF DRAWINGS
[0058] Figure 1 The application discloses a computer readable storage medium, and a computer program is stored on the computer readable storage medium. DETAILED DESCRIPTION
[0059] In this embodiment, a neighbor entity-based medical knowledge graph automatic alignment method is used to obtain vector representation of each medical entity from source medical knowledge graph and target medical knowledge graph through pre-training model, construct neighbor relationship mask matrix, construct neighbor entity interaction matrix of medical entity, adjust weight of neighbor entity interaction matrix using neighbor relationship mask matrix, then calculate comprehensive similarity vector between entities, and finally use a loss function to fine-tune the model, thereby improving the accuracy of entity alignment and realizing automatic alignment of medical knowledge graph. Specifically, as shown in Figure 1 the following steps are performed:
[0060] Step 1: Obtain source medical knowledge graph and target medical knowledge graph , wherein, denotes the set of query entities in , denotes the set of query relationships in , denotes the set of target entities in , and denotes the set of target relationships in ; ; ; ;
[0061] Let any query entity in be denoted as , let any query relationship in be denoted as , let any target entity in be denoted as , and let any target relationship in be denoted as ;
[0062] For example, (baseball elbow, epidemiology) , query entity 'baseball elbow' , query relationship 'epidemiology' , (humeral medial epicondylar avulsion fracture, etiology) , target entity 'humeral medial epicondylar avulsion fracture' , target relationship 'etiology' ; Query entity 'baseball elbow' is usually due to repeated pitching-induced overload injury to the medial elbow joint, while target entity 'humeral medial epicondylar avulsion fracture' is a specific form of injury that usually occurs during intense activities such as falling or pitching; both are different descriptions of the same disease and are connected to other entities through different relationships;
[0063] Step 2: Construct an automated alignment model for the medical knowledge graph based on neighbor entities, including: a vector representation module, a neighbor entity interaction matrix construction module, a neighbor relationship mask matrix construction module, and a comprehensive similarity calculation module;
[0064] Step 2.1: The vector representation module uses formula (1) to represent and Processing is performed and the pre-trained language model BERT is used to obtain Vector representation of and Vector representation of :
[0065] (1)
[0066] In formula (1), represents a multilayer perceptron, Symbol representing the class label.
[0067] Step 2.2: Neighbor Relationship Mask Matrix Construction Module Constructs the Neighbor Relationship Mask Matrix :
[0068] For example, querying entities 'Baseball elbow' Neighbor query entity For 'Raise arms', query the relationship For 'Epidemiology', the target entity 'Avulsion fracture of the medial epicondyle of the humerus' Neighbor Target For 'Posterolateral Dislocation of the Elbow', the target relationship for the 'cause';
[0069] The query relationship 'Epidemiology' uses etiology to conduct population-level research to define the distribution, determinants, and prevention of diseases. The target relationship 'Causes' provides insights into the causes of disease and serves as a basis for developing preventive measures. The query relationship 'Epidemiology' and the target relationship 'Causes' link entities with their neighbor entities. If the query relationship and the target relationship are semantically similar, then the neighbor query entity is more likely to be semantically similar to the target query entity.
[0070] Step 2.2.1: Use formula (2) to calculate all Related query entities Embedding vector of Average value and all Related target entity Embedding vector of Average value :
[0071] (2)
[0072] In formula (2), Represents Related A collection of Representing a collection The number of elements in , Represents Related A collection of Representing a collection The number of elements in ;
[0073] Step 2.2.2: Use formula (3) to calculate all Related Embedding vector of Average value and with Related Embedding vector of Average value :
[0074] (3)
[0075] In formula (3), and Respectively and The vector representation of Represents All related A collection of Representing a collection The number of elements in , Represents All related A collection of Representing a collection The number of elements in ;
[0076] Step 2.2.4: Use formula (4) to get the neighbor query relationship embedding vector and neighbor target relation embedding vector :
[0077] (4)
[0078] Step 2.2.5: Calculate using formula (5) and Cosine similarity of , thus obtaining the neighbor relationship mask matrix :
[0079] (5)
[0080] Step 2.3: Neighbor Entity Interaction Matrix Building Block Construction and The weight-adjusted neighbor entity interaction matrix :
[0081] Step 2.3.1: Calculate using formula (6) No. Neighbor query entity and No. Neighbor target entities Neighbor interaction value ,in, Represents the neighbor entity interaction matrix:
[0082] (6)
[0083] In formula (6), and Respectively and The vector representation of Represents the module, express Any number of rows, express Any number of columns;
[0084] For example, query the entity 'baseball elbow' Neighbor query entity For 'Raise your arms', the target entity is 'Avulsion fracture of the medial epicondyle of the humerus'. Neighbor target entities For 'posterolateral dislocation of the elbow', there is interaction between the neighbor query entity 'raise and swing arms' and the neighbor target entity 'posterolateral dislocation of the elbow', which is the potential semantic information;
[0085] Step 2.3.2: Use formula (7) to obtain the neighbor entity interaction matrix after weight adjustment :
[0086] (7)
[0087] In formula (7), Indicates weight adjustment;
[0088] Step 2.3.3: Use formula (8) to obtain The maximum neighbor interaction value between all its neighbor target entities and maximal neighbor interaction value between all neighbor query entities of :
[0089] (8)
[0090] In formula (8), denotes a maximization operation, denotes the total number of neighbor target entities of denotes the total number of neighbor query entities of
[0091] Step 2.3.4: Obtain the row eigenvector of the i-th row of and the column eigenvector of the j-th column of respectively by using formula (9):
[0092] (9)
[0093] In formula (9), denotes an exponential function, and denote the mean values used by the i-th and j-th RBF kernel aggregation functions respectively, and denote the variances used by the i-th and j-th RBF kernel aggregation functions respectively;
[0094] Step 2.3.5: Obtain the row-based similarity embedding and the column-based similarity embedding respectively by using formula (10):
[0095] (10)
[0096] In formula (10), denotes a logarithm;
[0097] Step 2.3.6: Obtain the final similarity embedding of the neighbor entity interaction matrix after weight adjustment by formula (11):
[0098] (11)
[0099] In formula (11), denotes a concatenation operation;
[0100] Step 2.4: The comprehensive similarity calculation module calculates the comprehensive similarity and between by using formula (12):
[0101] (12)
[0102] In formula (12), represents the cosine function, Represents a splicing operation;
[0103] Step 3: Use formula (13) to construct the pairwise boundary loss function , thereby using the gradient descent method to train the automatic alignment network of the medical knowledge graph based on neighbor entities, and continuously adjusting the pairwise boundary loss function during the training process The value of , until the pairwise boundary loss function Until convergence, the trained medical knowledge graph automatic alignment network based on neighbor entities is obtained, which is used to output the source medical knowledge graph and target medical knowledge graph The comprehensive similarity between
[0104] (13)
[0105] In formula (13), It is a maximization operation. express Zhongyu Any semantically aligned positive target entity, express Zhongyu Any negative target entity with semantic non-alignment, is a positive entity pair and negative entity pairs The boundary values enforced between Indicates Measured by distance and The similarity between Indicates that cosine similarity is used to measure and The similarity between them.
[0106] For example, (baseball elbow, medial epicondyle avulsion fracture of the humerus) and (baseball elbow, scoliosis), where the entity 'baseball elbow' is the query entity set The query entity in the set is 'medial epicondyle avulsion fracture of humerus'. The positive target entity that is semantically aligned with the query entity 'baseball elbow' is 'scoliosis'. Negative target entities randomly sampled from the query entity ‘baseball elbow’ that are semantically misaligned with the query entity;
[0107] Step 4: Using entity alignment evaluation metrics 、 and checking the degree of alignment between the source medical knowledge graph and the target medical knowledge graph.
[0108] In this embodiment, an electronic device includes a memory for storing a program supporting a processor to execute the above method, and the processor is configured to execute the program stored in the memory.
[0109] In this embodiment, a computer readable storage medium has a computer program stored thereon, and the computer program is run by a processor to execute the steps of the above method.
Claims
1. A neighbor entity-based medical knowledge graph automatic alignment method, characterized in that, is performed as follows: Step one: Obtain source medical knowledge graph and target medical knowledge graph wherein, denotes a set of query entities in denotes a set of query relations in denotes a set of target entities in denotes a set of target relations in Let any query entity in be denoted as , let any query relation in be denoted as , let any target entity in be denoted as , let any target relation in be denoted as ; Step two: constructing a neighbor entity-based medical knowledge graph automatic alignment network, including: a vector representation module, a neighbor relationship mask matrix construction module, a neighbor entity interaction matrix construction module, and a comprehensive similarity calculation module; Step 2.1: The vector representation module processes the respective and using Equation (1) to obtain the embedding vectors and and and respectively: (1) In formula (1), represents a multi-layer perceptron, represents a symbol of a class label; Step 2.2: The neighbor relation mask matrix construction module constructs the neighbor relation mask matrix according to the embedding vectors of the entities ; Step 2.3: The neighbor entity interaction matrix construction module constructs the weight-adjusted neighbor entity interaction matrix of and according to the embedding vectors of entities and ; Step 2.4: The integrated similarity calculation module calculates the integrated similarity of the two images using equation (12) and : (12) In formula (12), denotes a cosine function, denotes a concatenation operation; Step three: constructing a pair boundary loss function by using formula (13) , so as to train the neighbor entity based medical knowledge graph automatic alignment network by using the gradient descent method, and continuously adjust the value of the pair boundary loss function in the training process until the pair boundary loss function converges , so as to obtain the trained neighbor entity based medical knowledge graph automatic alignment network, which is used to output the comprehensive similarity between the source medical knowledge graph and the target medical knowledge graph . (13) In formula (13), It is a maximization operation. express Zhongyu Any semantically aligned positive target entity, express Zhongyu Any negative target entity with semantic non-alignment, is a positive entity pair and negative entity pairs The boundary values enforced between Indicates Measured by distance and The similarity between Indicates that cosine similarity is used to measure and The similarity between them. 2.The method of claim 1, wherein, The step 2.2 is performed as follows: Step 2.2.1: Calculate the average of the embedding vectors of all query entities associated with the query and the average of the embedding vectors of all target entities associated with the target : (2) In formula (2), denotes a set of associated with denotes a set of denotes the number of elements in the set denotes a set of denotes the number of elements in the set denotes a set of denotes the number of elements in the set denotes a set of denotes the number of elements in the set Step 2.2.2: Calculate all embedding vectors of associated with the average of the average of and embedding vectors of associated with the average of the average of : (3) In formula (3), and respectively represent and vector representation, represents all associated with the set, represents the number of elements in the set represents all associated with the set, represents the number of elements in the set represents all associated with the set Step 2.2.4: Obtain neighbor query relation embedding vector with formula (4) and neighbor target relation embedding vector : (4) Step 2.2.5: Calculate using formula (5) and cosine similarity of , thus obtaining the neighbor relation mask matrix : (5)。 3.The method of claim 2, wherein, The step 2.3 is performed as follows: Step 2.3.1: Calculate using formula (6) No. Neighbor query entity and No. Neighbor target entities Neighbor interaction value ,in, Represents the neighbor entity interaction matrix: (6) In formula (6), and respectively represent and the vector representation of represents the module, represents any row number of represents any column number of Step 2.3.2: Obtain the weight-adjusted neighbor entity interaction matrix using formula (7) : (7) In formula (7), denotes a weight adjustment; Step 2.3.3: Utilizing formula (8) to obtain the maximum neighbor interaction value with all of its neighbor target entities and the maximum neighbor interaction value with all of its neighbor query entities : (8) In formula (8), denotes a maximization operation, denotes a total number of neighbor target entities of denotes a total number of neighbor query entities of Step 2.3.4: Utilizing formula (9) to obtain the i-th column eigenvector and the j-th column eigenvector : (9) In formula (9), denotes an exponential function, and denotes the mean used by the i-th and j-th RBF kernel clustering function, respectively, and denotes the variance used by the i-th and j-th RBF kernel clustering function, respectively. Step 2.3.5: Obtain row-based similarity embedding based on formula (10) respectively and column-based similarity embedding : (10) In formula (10), represents a logarithm; Step 2.3.6: Obtain the weight-adjusted neighbor entity interaction matrix from formula (11) the final similarity embedding of : (11) In formula (11), represents a concatenation operation.
4. An electronic device comprising a memory and a processor, characterized in that The memory is configured to store a program supporting the processor to execute the medical knowledge graph automatic alignment method of any one of claims 1-3, and the processor is configured to execute the program stored in the memory.
5. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to perform the steps of the medical knowledge graph automatic alignment method of any one of claims 1-3.
Citation Information
Patent Citations
Drug repositioning method and system fusing multi-source knowledge graph
WO2024138803A1
KR20210079203A