Medical knowledge graph automatic alignment method based on neighbor entities
Through the automated alignment method of medical knowledge graph based on neighbor entities, combined with pre-trained BERT model and RBF kernel aggregation function, the problem of low entity alignment efficiency and accuracy in medical knowledge graph is solved, and efficient entity alignment and heterogeneity processing is achieved , reduces the dependence on manual annotation.
Patent Information
- Application Number
- CN202411413549.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-10-11
AI Technical Summary
The prior art has high labor and time costs when aligning entities in the medical knowledge graph, and the inability to effectively capture complex entity connections and deal with heterogeneity problems, resulting in low alignment efficiency and accuracy.
Using the medical knowledge graph automation alignment method based on neighbor entities, the vector representation module, the neighbor relationship mask matrix construction module, the neighbor entity interaction matrix construction module and the comprehensive similarity calculation module are constructed by combining the pre-trained BERT model and the RBF kernel aggregation function. Automate the alignment network to achieve deep semantic understanding and efficient alignment between entities.
It improves the accuracy and automation of entity alignment, reduces the dependence on manual annotation, enhances the generalization ability and alignment speed of the model, and significantly reduces the impact of knowledge graph heterogeneity alignment.
Smart Images

Figure CN119227796A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural language processing, and specifically relates to an automatic alignment method of medical knowledge graphs based on neighbor entities. Background Art
[0002] Knowledge graph is an efficient way to represent and integrate knowledge. In the knowledge graph, entities are connected to different entities through relationships, forming a huge semantic network, making the connection between entities structured and easy to query. Therefore, in the field of medicine, knowledge graphs are widely used to promote medical information integration, optimize personalized medical decisions, promote medical education and research, semantic search and medical knowledge question and answer. However, medical knowledge involves a wide range of content and is highly professional. The threshold for manual annotation and entity alignment of medical knowledge is high, requiring a lot of manpower and time costs, and it is also difficult to keep up with the constantly updated medical knowledge. In addition, due to factors such as the different degrees of refinement of medical knowledge carriers, the iteration of medical knowledge, and the influence of colloquial expressions, there is heterogeneity between medical knowledge graphs, which is mainly manifested in source differences, representation differences and semantic differences. Eliminating or reducing these heterogeneities is critical to improving the efficiency and accuracy of entity alignment.
[0003] In order to solve the above problems, some scholars use methods based on knowledge representation learning to map entities into low-dimensional vector space, calculate the similarity between entities mathematically, improve the accuracy of entity alignment, realize the automation of entity alignment, and reduce the dependence on manual labeling. However, the methods based on knowledge representation learning do not truly understand and predict the semantics of text information, but are simply vector mappings. In addition, some scholars introduce domain 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 disordered and independent, these models have limitations in dealing with nonlinear problems, and some models have high computational complexity and cannot fully capture the complex connections between all entities. Summary of the invention
[0004] The present invention aims to address the deficiencies of the above-mentioned prior art and proposes an automatic alignment method for medical knowledge graphs based on neighbor entities, in order to reduce the impact of knowledge graph heterogeneity on entity alignment on the basis of obtaining medical knowledge representation features, and 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 and answer, etc.
[0005] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme:
[0006] The automatic alignment method of the medical knowledge graph based on neighbor entities of the present invention is characterized in that it is performed according to the following steps:
[0007] Step 1: Obtain the source medical knowledge graph and target medical knowledge graph ,in, express The query entity collection in express The query relation set in express The target entity set in express The target relation set in ;
[0008] make Any query entity in ,make Any query relation in ,make Any target entity in ,make Any target relation in ;
[0009] Step 2: Construct an automatic alignment network of medical knowledge graph based on neighbor entities, including: vector representation module, neighbor relationship mask matrix construction module, neighbor entity interaction matrix construction module, and comprehensive similarity calculation module;
[0010] Step 2.1: The vector representation module uses formula (1) to represent and Process and obtain The embedding vector and The embedding vector :
[0011] (1)
[0012] In formula (1), represents a multi-layer perceptron, Symbols representing class labels;
[0013] Step 2.2: The neighbor relationship mask matrix construction module constructs a neighbor relationship mask matrix based on the entity embedding vector ;
[0014] Step 2.3: The neighbor entity interaction matrix construction module is based on the embedding vector and , build 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), is a maximization operation. express Zhongyu Any semantically aligned positive target entity, express Zhongyu Any negative target entity with semantic misalignment, is a positive entity pair And negative sample entity pairs The boundary values enforced between Indicates Measure by distance and The similarity between Indicates that cosine similarity is used to measure and The similarity between .
[0021] The automatic alignment method of medical knowledge graph 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: Use formula (2) to calculate all Related query entities The embedding vector The average and all Related target entity The embedding vector The average :
[0023] (2)
[0024] In formula (2), Representation and Related A collection of Representing a collection The number of elements in , Representation and Related A collection of Representing a collection The number of elements in ;
[0025] Step 2.2.2: Use formula (3) to calculate all Related The embedding vector The average and with Related The embedding vector The average :
[0026] (3)
[0027] In formula (3), and Respectively and The vector representation of Representation and All related A collection of Representing a collection The number of elements in , Representation and All related A collection of Representing a collection The number of elements in ;
[0028] Step 2.2.4: Use formula (4) to get the neighbor query relationship embedding vector and neighbor target relation embedding vector :
[0029] (4)
[0030] Step 2.2.5: Calculate using formula (5) and The cosine similarity of , thus obtaining the neighbor relationship mask matrix :
[0031] (5).
[0032] Further, the step 2.3 is performed as follows:
[0033] 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:
[0034] (6)
[0035] In formula (6), and Respectively and The vector representation of Represents the model, express Any number of rows, express Any number of columns;
[0036] Step 2.3.2: Use formula (7) to obtain the weight-adjusted neighbor entity interaction matrix :
[0037] (7)
[0038] In formula (7), Indicates weight adjustment;
[0039] Step 2.3.3: Use formula (8) to obtain The maximum neighbor interaction value between all its neighbor target entities and The maximum neighbor interaction value between all its neighbor query entities :
[0040] (8)
[0041] In formula (8), represents the maximization operation, express The total number of neighbor target entities, express The total number of neighbor query entities;
[0042] Step 2.3.4: Use formula (9) to obtain The eigenvector of the i-th row in and the jth column eigenvector :
[0043] (9)
[0044] In formula (9), represents the exponential function, and Respectively represent the means used by the i-th and j-th RBF kernel aggregation functions, and represents the variance used by the i-th and j-th RBF kernel aggregation functions;
[0045] Step 2.3.5: Use formula (10) to obtain row-based similarity embedding and column-based similarity embedding :
[0046] (10)
[0047] In formula (10), represents logarithm;
[0048] Step 2.3.6: Obtain the weight-adjusted neighbor entity interaction matrix from formula (11): The final similarity embedding :
[0049] (11)
[0050] In formula (11), Represents a concatenation operation.
[0051] An electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports 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 present invention provides a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. The characteristic is that when the computer program is executed by a processor, the steps of the medical knowledge graph automatic alignment method are executed.
[0053] Compared with the prior art, the present invention has the following beneficial effects:
[0054] 1. As traditional knowledge representation methods cannot generate vector representations with semantic features, the present invention uses a pre-trained BERT model. The BERT model uses the Transformer architecture and attention mechanism. It learns deep language representations in a large amount of text data through unsupervised learning tasks, and can better capture the potential semantic information between entities in the medical knowledge graph, thereby completing entity alignment more accurately. At the same time, this is also a key link in achieving automation.
[0055] 2. In response to the problem of heterogeneity between medical knowledge graphs, the present invention constructs an interaction matrix between neighbor entities when designing the model. At the same time, the RBF kernel aggregation function is used to extract the characteristics of similarity accumulation between entities to characterize knowledge, so as to more clearly capture and understand the direct and indirect connections between entities, which helps to improve the accuracy of entity alignment.
[0056] 3. When constructing the model, the present invention further introduces a relational mask matrix to deal with the problem of heterogeneity between medical knowledge graphs. When the entity neighbors are unordered or independent, the mask matrix helps the model filter out irrelevant information and avoid noise interference. By masking the relationships in the neighbor entity interaction matrix, unnecessary calculations can be reduced and the running time of the model can be optimized. In addition, the mask matrix enables the model to maintain good performance when seeing hidden or unobserved parts, thereby enhancing the generalization and prediction capabilities of the alignment model.
[0057] 4. The present invention can automatically align more medical entities after learning a limited set of alignment seeds, and can also help the model match various heterogeneous and sparse entities in the medical knowledge graph. While realizing the automatic alignment of the medical knowledge graph, it also achieves the purpose of significantly improving the alignment speed and reducing the dependence on manual labeling. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0059] In this embodiment, a method for automatic alignment of medical knowledge graphs based on neighbor entities is to obtain the vector representation of each medical entity from the source medical knowledge graph and the target medical knowledge graph through a pre-trained model, first construct a neighbor relationship mask matrix, then construct a neighbor entity interaction matrix of the medical entity, and use the neighbor relationship mask matrix to adjust the weight of the neighbor entity interaction matrix, then calculate the comprehensive similarity vector between the 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 graphs. Specifically, if Figure 1 As shown, the steps are as follows:
[0060] Step 1: Obtain the source medical knowledge graph and target medical knowledge graph ,in, express The query entity collection in express The query relation set in express The target entity set in express The target relation set in ;
[0061] make Any query entity in ,make Any query relation in ,make Any target entity in ,make Any target relation in ;
[0062] For example, (baseball elbow, epidemiology) , query entity 'baseball elbow' , query the relationship 'epidemiology' , (avulsion fracture of the medial epicondyle of the humerus, cause) , target entity 'medial epicondyle avulsion fracture' , target relation 'Cause' ; The query entity 'baseball elbow' is usually an overload injury to the medial elbow joint caused by repeated throwing, while the target entity 'medial epicondyle avulsion fracture of the humerus' is a specific form of injury that usually occurs during strenuous activities such as falling or throwing; the two are different descriptions of the same disease and are connected to other entities through different relationships;
[0063] Step 2: Construct an automatic alignment model of medical knowledge graph based on neighbor entities, including: vector representation module, neighbor entity interaction matrix construction module, neighbor relationship mask matrix construction module, and comprehensive similarity calculation module;
[0064] Step 2.1: The vector representation module uses formula (1) to represent and Processing, using the pre-trained language model BERT to obtain Vector representation of and Vector representation of :
[0065] (1)
[0066] In formula (1), represents a multi-layer 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 'Medial epicondyle avulsion fracture' Neighbor Target For 'Posterolateral Elbow Dislocation', target relationship for the ‘cause’;
[0069] The query relation 'epidemiology' uses etiology to conduct population-level research to define the distribution, determinants, and prevention of the disease. The target relation 'cause' provides insights into the causes of the disease and is the basis for developing preventive measures. The query relation 'epidemiology' and the target relation 'cause' connect entities with their neighbor entities. If the query relation and the target relation 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 The embedding vector The average and all Related target entity The embedding vector The average :
[0071] (2)
[0072] In formula (2), Representation and Related A collection of Representing a collection The number of elements in , Representation and Related A collection of Representing a collection The number of elements in ;
[0073] Step 2.2.2: Use formula (3) to calculate all Related The embedding vector The average and with Related The embedding vector The average :
[0074] (3)
[0075] In formula (3), and Respectively and The vector representation of Representation and All related A collection of Representing a collection The number of elements in , Representation and 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 The 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 model, express Any number of rows, express Any number of columns;
[0084] For example, querying the entity 'baseball elbow' Neighbor Query Entity For 'Raise Arm and Swing', the target entity 'Medial epicondyle avulsion fracture of humerus' Neighbor target entities For 'posterolateral dislocation of the elbow joint', there is interaction between the neighbor query entity 'raise and swing arms' and the neighbor target entity 'posterolateral dislocation of the elbow joint', that is, potential semantic information;
[0085] Step 2.3.2: Use formula (7) to obtain the weight-adjusted neighbor entity interaction matrix :
[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 The maximum neighbor interaction value between all its neighbor query entities :
[0089] (8)
[0090] In formula (8), represents the maximization operation, express The total number of neighbor target entities, express The total number of neighbor query entities;
[0091] Step 2.3.4: Use formula (9) to obtain The eigenvector of the i-th row in and the jth column eigenvector :
[0092] (9)
[0093] In formula (9), represents the exponential function, and Respectively represent the means used by the i-th and j-th RBF kernel aggregation functions, and represents the variance used by the i-th and j-th RBF kernel aggregation functions;
[0094] Step 2.3.5: Use formula (10) to obtain row-based similarity embedding and column-based similarity embedding :
[0095] (10)
[0096] In formula (10), represents logarithm;
[0097] Step 2.3.6: Obtain the weight-adjusted neighbor entity interaction matrix from formula (11): The final similarity embedding :
[0098] (11)
[0099] In formula (11), Represents a splicing operation;
[0100] Step 2.4: The comprehensive similarity calculation module uses formula (12) to calculate and The comprehensive similarity :
[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), is a maximization operation. express Zhongyu Any semantically aligned positive target entity, express Zhongyu Any negative target entity with semantic misalignment, is a positive entity pair And negative sample entity pairs The boundary values enforced between Indicates Measure by distance and The similarity between Indicates that cosine similarity is used to measure and The similarity between .
[0106] For example, (baseball elbow, medial epicondyle avulsion fracture) and (baseball elbow, scoliosis), where the entity 'baseball elbow' is the query entity set The query entity in the query entity, 'medial epicondyle avulsion fracture of humerus' is the target entity set The positive target entity semantically aligned with the query entity 'baseball elbow' in Negative target entities randomly sampled from the query entity ‘baseball elbow’ that are semantically non-aligned;
[0107] Step 4: Using entity alignment evaluation indicators , and Medical knowledge graph of test sources and target medical knowledge graph The degree of alignment between .
[0108] In this embodiment, an electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the 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 stores a computer program on the computer-readable storage medium, and the computer program executes the steps of the above method when executed by a processor.
Claims
1. A method for automatic alignment of medical knowledge graphs based on neighbor entities, characterized in that: The steps are as follows: Step 1: Obtain the source medical knowledge graph and target medical knowledge graph ,in, express The query entity collection in express The query relation set in , express The target entity set in express The target relation set in ; make Any query entity in ,make Any query relation in ,make Any target entity in ,make Any target relation in ; Step 2: Construct an automatic alignment network of medical knowledge graph based on neighbor entities, including: vector representation module, neighbor relationship mask matrix construction module, neighbor entity interaction matrix construction module, and comprehensive similarity calculation module; Step 2.1: The vector representation module uses formula (1) to represent and Process and obtain The embedding vector and The embedding vector : (1) In formula (1), represents a multi-layer perceptron, Symbols representing class labels; Step 2.2: The neighbor relationship mask matrix construction module constructs a neighbor relationship mask matrix based on the entity embedding vector ; Step 2.3: The neighbor entity interaction matrix construction module is based on the embedding vector and , build and The weight-adjusted neighbor entity interaction matrix , and get the final similarity embedding ; Step 2.4: The comprehensive similarity calculation module uses formula (12) to calculate and The comprehensive similarity : (12) In formula (12), represents the cosine function, Represents a splicing operation; 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 (13) In formula (13), is a maximization operation. express Zhongyu Any positive target entity of semantic alignment, express Zhongyu Any negative target entity with semantic misalignment, is a positive entity pair And negative sample entity pairs The boundary values enforced between Indicates Measure by distance and The similarity between Indicates that cosine similarity is used to measure and The similarity between .
2. According to the method of automatic alignment of medical knowledge graphs based on neighbor entities in claim 1, it is characterized in that: The step 2.2 is performed as follows: Step 2.2.1: Use formula (2) to calculate all Related query entities The embedding vector The average and all Related target entity The embedding vector The average : (2) In formula (2), Representation and Related A collection of Representing a collection The number of elements in , Representation and Related A collection of Representing a collection The number of elements in ; Step 2.2.2: Use formula (3) to calculate all Related The embedding vector The average and with Related The embedding vector The average : (3) In formula (3), and Respectively and The vector representation of Representation and All related A collection of Representing a collection The number of elements in , Representation and All related A collection of Representing a collection The number of elements in ; Step 2.2.4: Use formula (4) to get the neighbor query relationship embedding vector and neighbor target relation embedding vector : (4) Step 2.2.5: Calculate using formula (5) and The cosine similarity of , thus obtaining the neighbor relationship mask matrix : (5)。 3. The method for automatic alignment of medical knowledge graphs based on neighbor entities according to claim 2, characterized in that: The step 2.3 is carried out 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 and The vector representation of Represents the model, express Any number of rows, express Any number of columns; Step 2.3.2: Use formula (7) to obtain the weight-adjusted neighbor entity interaction matrix : (7) In formula (7), Indicates weight adjustment; Step 2.3.3: Use formula (8) to obtain The maximum neighbor interaction value between all its neighbor target entities and The maximum neighbor interaction value between all its neighbor query entities : (8) In formula (8), represents the maximization operation, express The total number of neighbor target entities of express The total number of neighbor query entities; Step 2.3.4: Use formula (9) to obtain The eigenvector of the i-th row in and the jth column eigenvector : (9) In formula (9), represents the exponential function, and Respectively represent the means used by the i-th and j-th RBF kernel aggregation functions, and represents the variance used by the i-th and j-th RBF kernel aggregation functions; Step 2.3.5: Use formula (10) to obtain row-based similarity embedding and column-based similarity embedding : (10) In formula (10), represents logarithm; Step 2.3.6: Obtain the weight-adjusted neighbor entity interaction matrix from formula (11): The final similarity embedding : (11) In formula (11), Represents a concatenation operation.
4. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the medical knowledge graph automatic alignment method described in 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 a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for automatic alignment of medical knowledge graphs described in any one of claims 1 to 3 are performed.
Citation Information
Patent Citations
Drug repositioning method and system fusing multi-source knowledge graph
WO2024138803A1
KR20210079203A
Cited By
Causal path generation method and device, equipment, medium and product
CN120354928A
