Potential relation reasoning-based medical knowledge graph retrieval system and method
Through the medical knowledge graph retrieval system based on latent relationship reasoning, the problem of inefficiency caused by data heterogeneity, incompleteness and complex structure in the construction and application of medical knowledge graphs is solved, and the completion and optimization of knowledge graphs is achieved, providing efficient and accurate user query results.
Patent Information
- Application Number
- CN202411553889.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-04-01
AI Technical Summary
During the construction and application of medical knowledge graphs, they face problems such as data heterogeneity, incompleteness, and inefficiency caused by complex structures and difficult to meet user needs.
The medical knowledge graph retrieval system based on latent relationship reasoning is adopted, and through modules such as medical data preprocessing, knowledge extraction and graph generation, latent relationship reasoning completion, keyword network construction and semantic analysis and search, the knowledge graph completion and optimization are realized, and efficient user query analysis and result matching are provided.
It significantly improves the completeness and query efficiency of the knowledge graph, can accurately analyze complex user queries, provide comprehensive and accurate query results, and meet users' diverse needs for medical information.
Smart Images

Figure CN119739867A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of natural language processing technology, and in particular, to a medical knowledge graph retrieval system and method based on potential relationship reasoning. Background Art
[0002] In recent years, driven by relevant policy support and technological progress, the digital transformation of the medical and health sector has made significant progress, especially the application of technologies such as the Internet, artificial intelligence, cloud computing and big data has become increasingly important. The high competitiveness and fast-paced lifestyle of modern society, coupled with the shortage of medical resources, have made medical and health issues increasingly concerned. In order to effectively deal with the problem of insufficient medical resources, the medical retrieval system has become an effective solution. By providing convenient medical services, the system can also alleviate the problem of uneven distribution of medical resources to a certain extent, thereby optimizing the current medical system and improving the quality and efficiency of overall medical services.
[0003] Medical knowledge graph plays an important role in the medical field. It facilitates the storage and expression of complex knowledge by structuring a large amount of medical information into a graphical form. It not only supports the storage and query of knowledge, but also discovers potential information and relationships through reasoning. However, there are some challenges in building and applying medical knowledge graphs, especially the problems of completion and retrieval. Due to the diverse data sources of medical knowledge graphs, there is significant heterogeneity between data. The structures, formats, and semantics of different data sources are different, making it difficult to directly integrate information. In addition, data incompleteness is prevalent, resulting in the lack of entities and relationships in the knowledge graph, which limits its application capabilities in complex medical scenarios.
[0004] At the application level, efficient knowledge graph retrieval is an important way to achieve the availability of medical information. However, due to the very complex structure of the knowledge graph and the huge number of nodes and relationships, building an efficient retrieval system faces many technical challenges. First of all, how to efficiently match in large-scale and complex knowledge graphs is an important research direction. Secondly, the user's query intention is usually presented in the form of natural language. How to accurately parse these natural language queries and convert them into specific entities and relationships in the graph is the core problem of the retrieval system. Current retrieval methods often cannot effectively respond to complex user needs. Overall, the construction and application of medical knowledge graphs still face many technical challenges, which directly affect the integrity and practicality of the knowledge graph and its application effect in actual medical scenarios. Summary of the invention
[0005] The main purpose of this application is to use medical data to construct a medical knowledge graph, and to complete and optimize the knowledge graph through natural language processing technology and graph structure analysis methods. On this basis, by efficiently parsing user queries, understanding the ambiguity and fuzzy matching problems in the queries, extracting keywords and matching them with relevant entities in the knowledge graph, it is ensured that user queries are responded to accurately and comprehensively. And in complex query scenarios, all relevant entity and relationship information is integrated through multi-entity matching and relationship path analysis. To this end, this application proposes a medical knowledge graph retrieval system and method based on potential relationship reasoning, which aims to provide comprehensive and accurate query results to meet users' needs for medical information.
[0006] In the first aspect of the present application, the present application proposes a medical knowledge graph retrieval system based on potential relationship reasoning, and the system includes: a medical data preprocessing module, which is used for collecting and preprocessing original medical data; a knowledge extraction and medical graph generation module, which uses a named entity recognition model to identify medical entities from the processed data based on the preprocessed data, and analyzes the relationship between entities through a relationship construction model to form a preliminary medical knowledge graph; a medical knowledge graph potential relationship reasoning completion module, which analyzes structural information and semantic features based on the constructed knowledge graph, mines potential relationships between entities, and supplements unclear relationships, thereby improving the knowledge graph; a keyword network and semantic parsing retrieval module, which constructs a keyword network by performing word segmentation and weight calculation on medical texts, uses community detection and graph embedding technology to identify relevant key nodes, and performs slot labeling and intent recognition; a semantic mapping and query response module, which receives the intent and slot information of the user's query, maps keywords to entities and relationships in the medical knowledge graph, executes the query and returns the results.
[0007] In some examples of the present application, the aforementioned medical data preprocessing module includes a data acquisition device and a data preprocessing device; wherein the aforementioned data acquisition device is used to collect medical data; the aforementioned data preprocessing device cleans the collected medical data, including standardizing text and removing noise.
[0008] In some examples of the present application, the aforementioned knowledge extraction and medical graph generation module includes: an entity recognition device and a relationship construction device;
[0009] The configuration of the entity recognition device includes:
[0010] (1) Perform word segmentation on the input text and generate the word context embedding representation H = [h1,h2,…,h n ], where each h i Represents the vector of the i-th word. On this basis, H is processed using a bidirectional long short-term memory network to generate the forward and backward context of each word, expressed as in, represents the forward output of the i-th word, Represents the backward output of the i-th word, so that the word representation contains the context information;
[0011] (2) The context representation of words is optimized by combining the semantic similarity matrix with the relative position encoding. The semantic similarity matrix S is used to measure the semantic relevance between words in a sentence. Its calculation formula is: where h i and h j are the embedding vectors of word i and word j respectively. Relative position encoding is used to capture the order and distance information between words. Its calculation formula is R ij = clamp(ij,-d max ,d max )+d max , where i and j are the positions of word i and word j in the sentence, respectively, and d max is the maximum distance of the relative position, used to ensure that the relative position index is in [0,2·d max ] is within the range. Relative position encoding matrix R ij Mapped to relative position vector E rel (R ij ), the clamp function is used to limit the value of ij to [-d max ,d max ]between;
[0012] (3) Calculate the attention score A by combining the semantic similarity matrix and relative position encoding ij , the formula is Among them, Q i is the query vector of word i, K j is the key vector of word j, is the transpose of the key vector, and λ is a hyperparameter that affects the final attention score of the semantic similarity matrix. In some examples of this application, λ is taken as 0.5. After calculating the attention score, these weights are used to perform a weighted summation on the representation of the word to generate the context vector C for each word. ij , the formula is Among them, A ij represents the attention weight of word i to word j, V j Represents the value vector of the jth word;
[0013] (4) Output vector H BiLSTM With the context vector C i Splicing, dimensionality reduction through linear transformation to generate the final fusion feature representation, the formula is F i =FusionLinear(H BiLSTM||C i ), finally, the sequence labeling method is applied to parse the fused features to identify medical entities in the text.
[0014] The configuration contents of the aforementioned relationship building device include:
[0015] Receive the identified entities, construct a candidate set of entity pairs, and encode their context to generate word vectors, so as to identify the relationship type of entity pairs. The identification results will be constructed into triples and integrated into the knowledge graph, so that nodes represent entities and edges represent relationships, forming a preliminary medical knowledge graph. Specifically,
[0016] (1) Use the entity recognition device to extract and organize the recognized entities to generate a candidate set of entity pairs. Then, process each entity pair in the candidate set and generate the relevant word vector representation through context text encoding. and
[0017] (2) Based on the generated word vectors, a comprehensive feature representation is constructed and input into the conditional random field model to perform relationship feature annotation and identify the relationship type between entity pairs one by one in combination with the global sequence information;
[0018] (3) Based on the identified entity pairs and their relationship types, they are constructed into relationship triples and integrated into the knowledge graph. Nodes represent entities and edges represent relationships between entities. By structuring all entities and their relationships, a preliminary medical knowledge graph is constructed.
[0019] In some examples of the present application, the aforementioned medical knowledge graph potential relationship reasoning completion module includes: a knowledge graph completion device;
[0020] The configuration contents of the aforementioned knowledge graph completion device include:
[0021] (1) Perform context encoding on each word in the sequence to generate the corresponding hidden state vector, and then extract the corresponding semantic embedding from the hidden state vector, which are the head entity relation and tail entity
[0022] (2) The semantic score of the triple is calculated using the semantic scoring function. The calculation formula is: The semantic scoring function measures the Euclidean distance between the semantic representation of the head entity and relation and the semantic representation of the tail entity. The smaller the distance, the higher the semantic score of the triple.
[0023] (3) To obtain structural information, a graph attention network is used to assign weights to neighbor nodes through the attention mechanism, effectively capturing topological relationships and neighbor associations. The calculation formula is: Among them, N(i) represents the neighbor set of entity node i, K is the number of attention heads, represents the attention weight assigned to neighbor node j by the kth attention head, W (k) is the learnable weight matrix of the Kth attention head, and σ is a nonlinear activation function used to introduce nonlinear features. In this way, a structured representation of each entity is generated In the process of aggregating neighbor information, in order to better capture the impact of relationships, the relationship type is introduced into the model as the feature of the edge, so as to consider the impact of different relationships. The calculation formula is:
[0024] in, is a learnable weight matrix for relation embedding, H r The embedding vector representing relation r reflects the connection relationship between node i and node j;
[0025] (4) Generating structured representations and Then, the structural scoring function is used Calculate the structure score of the triples;
[0026] (5) By integrating semantic representation and structured representation Form a comprehensive feature representation so that the model can capture both contextual semantics and graph structure features;
[0027] (6) An improved contrast loss function is used to maximize the difference between the positive sample score and the negative sample score. The loss function calculation formula is: Among them, f B is the positive sample score of the semantic representation, f G is the positive sample score of the structure representation, f' B and f' G are the semantic score and structural score of negative samples respectively, τ is the balance factor used to control the score difference between positive and negative samples, Σ t' It represents the sum of the scores of all negative samples. After generating the comprehensive feature representation, the relationship reasoning is performed by calculating the scores of the triples, predicting the potential but not explicitly labeled relationships in the knowledge graph, and outputting new triples to complete the knowledge graph.
[0028] In some examples of the present application, the aforementioned keyword network and semantic analysis retrieval module includes: a medical keyword network construction device, a hierarchical retrieval device, and a semantic query device;
[0029] The configuration contents of the aforementioned medical keyword network construction device include:
[0030] (1) Divide each medical text data A into text set a m , a m The text in is divided into a sequence of words
[0031] <w1,w2,...,w i ,...,w n >, where w i represents the i-th word, n represents the total number of words, and m represents the m-th text in A;
[0032] (2) The stop word document T is a set of stop words, represented as a sequence of words. <c1,c2,...c i ,...,c n >, where c i Represents the i-th stop word. After removing the stop word, the text a m The generated word sequence is denoted as u m , which contains words that meet the condition <w i |w i ∈a m And w i ∈t>, in addition, each word d in the custom dictionary Dic has a corresponding weight weight(d);
[0033] (3) Extract keywords from each document and calculate the text set u m The frequency of word w in the word sequence is calculated using the formula Calculating Inverse Document Frequency Finally, calculate the product of the two to get the weighted TF-IDF of word w weight value, and sort them in descending order, and select the top 50 words as keywords, among which term(w,u m ) indicates that word w is in text u m The number of occurrences in , count(A) represents the total number of documents, and u(w) represents the number of documents containing word w;
[0034] (4) The generated keyword set is represented by K, K = {k1, k2, ..., k i ,...,k N×count(A)}, where k i represents the i-th keyword, initializes the co-word matrix M, defines the co-occurrence window size as 5, and for each document um Each word w i , if w i The keyword k p , then check whether the word in the window contains the keyword k p , using cooc(k p ,k q ,u m ,β) to indicate whether keywords co-occur. If in document u m In the window, if the keywords appear at the same time, the co-word matrix is updated using the formula Among them, M pq Represents the number of times a keyword co-occurs in all documents, and finally obtains the keyword co-occurrence matrix M;
[0035] (5) Convert the co-word matrix M into a keyword network graph, where the node set is the keyword set K. If M pq If it is not 0, it means that there is an edge between the keywords, and the value is used as the weight of the edge. The set of edges is denoted as E, thereby constructing the keyword network G = (K, E).
[0036] The configuration contents of the aforementioned hierarchical search device include:
[0037] (1) For the generated keyword network G, we first need to detect the communities in the graph and initialize each node as a separate community. That is, each node is an independent community at the beginning. The community set is represented by B. Then, the communities are merged and the modularity gain of each community merger is calculated. The communities are merged until there is no significant modularity gain. Finally, the community division is obtained, and each community contains a group of highly related keywords.
[0038] (2) Assume that the network has been divided into S communities, and the community label of each node v is b(v), where b(v)∈{B1,B2,…,B S} represents the community number or label to which node v belongs. For each community B i Corresponding to a subgraph G i , G i =(K i ,E i ), where K i It is community B i The node set in E i It is community B i The set of middle edges selects the nodes whose subgraph betweenness centrality value Center is greater than the threshold θ as the influential nodes of the community. It is community B i Influence nodes in
[0039]
[0040] (3) Using graph embedding technology, we generate an embedding vector e(v) for each node in the network. For the keyword query input by the user, we calculate the semantic similarity with the influential nodes in each community. The formula is: Among them, e(k) is the embedding vector of the keyword k entered by the user, Is an influence node Embedding vector of , get the final community of query;
[0041] (4) For the keyword network graph G, each subgraph G is indexed by constructing a hierarchical index. i The influential nodes in the graph are set as the top layer, and the subgraph G i is the medium layer, G is the bottom layer, and community B i The set of influential nodes in is set to For the input query, traverse from the top layer and calculate the query and v * The semantic relevance of the medium node. If the node is found, stop traversal. If not found, find the node with the maximum semantic relevance and jump to the medium layer to continue traversal from this node. If not found, continue to jump to the next layer until the node is found. For the query node found, set the jump probability of the neighbor node to 0.5, and finally output the first 10 neighbor nodes.
[0042] The configuration contents of the aforementioned semantic query device include:
[0043] (1) For the collected medical questions, use the extracted keywords to perform slot labeling and intent labeling;
[0044] (2) Extract features and calculate intent scores;
[0045] (3) Use sequence labeling methods to perform slot filling tasks, identify the information in the input query, match and fill in the actual information, and finally output the predicted intent of the query and slot information.
[0046] In some examples of the present application, the aforementioned semantic mapping and query response module includes: a query feedback device;
[0047] The configuration of the query feedback device includes:
[0048] (1) Receive the slot information of the user's query from the semantic query device, and extract the keyword set K'=
[0049] k'1,k'2,…,k' n, the keyword k'∈K' is associated with the entity node set E=e1,e2,…,e m Perform a preliminary match and find the corresponding entity node e∈E through string matching. If the keyword k' does not match an entity node in the knowledge graph in the preliminary match, or the query keyword may be ambiguous, the edit distance algorithm is used to calculate the edit distance ED(k',e) between the query keyword k and the entity name e in the knowledge graph, and the nodes with a closer distance are matched. The formula for the edit distance is ED(k',e)=
[0050] min{Insertions(k',e),Deletions(k',e),Substitutions(k',e)}, where Insertions(k',e), Deletions(k',e) and Substitutions(k',e) represent the minimum number of insertion, deletion and substitution operations respectively;
[0051] (2) receiving the intention recognition result of the user's query from the semantic query device, analyzing the purpose of the user's query, determining the type of relationship to be queried in the knowledge graph, and determining the type of relationship to be queried in the knowledge graph based on the intention and the related entity nodes E;
[0052] (3) For complex queries, multiple entities Combine them for matching, determine the relationship path P(E') between multiple entities, and query by combining the predefined relationship types in the knowledge graph. The relationship path P(E') represents a multi-hop path from one entity node to another entity node in the knowledge graph. The multi-hop path formula is used. Calculate, where Path(e i ,e j ) represents entity e i and e j The paths between them ensure that the query can cover all possible relevant information and enhance the accuracy of the query by combining relationship types;
[0053] (4) Integrate all relevant entity and relationship information found, return a comprehensive query result, and complete the retrieval.
[0054] In the second aspect of the present application, the present application proposes a medical knowledge graph retrieval method based on potential relationship mining. According to an embodiment of the present application, the method includes: cleaning the collected medical data, including standardizing text and removing noise; based on the processed medical data, using a named entity recognition model to identify medical entities from the processed data, and analyzing the relationship between entities through a relationship construction model to form a preliminary medical knowledge graph; based on the constructed knowledge graph, analyzing structural information and semantic features, mining potential relationships between entities, and supplementing unclear relationships, thereby improving the knowledge graph; by performing word segmentation and weight calculation on medical texts, constructing a keyword network, using community detection and graph embedding technology to identify relevant key nodes, and performing slot labeling and intent recognition; receiving the intent and slot information of the user's query, mapping keywords to entities and relationships in the medical knowledge graph, executing the query and returning the results.
[0055] It should be understood that the method embodiment and the system embodiment may correspond to each other, and similar descriptions may refer to the system embodiment. To avoid repetition, they will not be described here. Specifically, Figure 1 The system shown can execute the above-mentioned embodiment of the medical knowledge graph retrieval method based on potential relationship mining, and the operations and / or functions performed by each module in the system correspond to the method embodiment, which will not be repeated here for the sake of brevity.
[0056] The medical knowledge graph retrieval system and method based on potential relationship reasoning of the present invention have the following advantages:
[0057] (1) In the process of generating a medical knowledge graph, the present invention combines the semantic similarity matrix and relative position encoding to optimize entity recognition. First, the semantic similarity between words is calculated based on the word representation generated by the bidirectional long short-term memory network, and a semantic similarity matrix S is generated to measure the association between words. At the same time, the relative position matrix R is used to capture the order and distance information between words and encode it into a relative position vector. Then, the semantic similarity matrix and relative position encoding are integrated into the attention mechanism, and the attention score is calculated to adjust the feature weight to achieve more accurate entity recognition.
[0058] (2) The present invention effectively completes the knowledge graph by combining the semantic information and structural information of triples. The former provides semantic understanding of the text content, while the latter captures the structural information of the graph by analyzing the nodes and their neighbor relationships. The combination of the two can improve the entities and relationships in the knowledge graph and enhance its coverage, structural consistency, and semantic relevance. This method significantly improves the integrity of the knowledge graph and lays a solid foundation for subsequent query and information retrieval.
[0059] (3) The present invention can efficiently identify and classify keywords and form a structured keyword network by constructing a keyword co-occurrence matrix and a keyword network diagram, and combining co-occurrence analysis and community detection technology. This method not only improves the accuracy and efficiency of keyword extraction and network construction, but also provides a more efficient retrieval path for subsequent queries, ensuring that the system can quickly locate relevant information in a complex data environment.
[0060] (4) The present invention optimizes slot filling and intent recognition, and uses deep semantic analysis to effectively extract context information, ensuring that the system can accurately parse complex medical questions and accurately label and classify them. When processing user queries, the system can more accurately understand user needs and provide high-quality search results, thereby significantly improving user experience and query efficiency.
[0061] In the third aspect of the present application, the present application proposes a computer program product. According to an embodiment of the present application, the computer program product includes: computer instructions; when part or all of the computer instructions are run on a computer, the medical knowledge graph retrieval method based on potential relationship mining as described in the first aspect of the present application is executed.
[0062] In the fourth aspect of the present application, the present application proposes a computing device. According to an embodiment of the present application, the computing device includes: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program to implement the medical knowledge graph retrieval method based on potential relationship mining as described in the first aspect of the present application.
[0063] In a fifth aspect of the present application, the present application proposes a computer-readable storage medium. According to an embodiment of the present application, the computer-readable storage medium stores computer instructions or programs, and when the computer instructions or programs are run on a computer, the medical knowledge graph retrieval method based on potential relationship mining as described in the first aspect of the present application is executed.
[0064] The aforementioned computer program product, computing device, and computer-readable storage medium automatically execute a medical knowledge graph retrieval method based on potential relationship mining through computer instructions, thereby improving retrieval efficiency and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments 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 any creative work.
[0066] Figure 1It is a structural block diagram of a medical knowledge graph retrieval system based on potential relationship reasoning provided according to an exemplary embodiment;
[0067] Figure 2 It is a flow chart of a medical knowledge graph retrieval system based on potential relationship reasoning provided according to an exemplary embodiment. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0069] In one embodiment of the present application, a medical knowledge graph retrieval system and method based on potential relationship reasoning are provided to retrieve relevant information from medical data. Figure 1 As shown, the medical knowledge graph retrieval system based on latent relationship reasoning includes: medical data preprocessing module, knowledge extraction and medical graph generation module, medical knowledge graph latent relationship reasoning completion module, keyword network and semantic parsing retrieval module, semantic mapping and query response module.
[0070] In Example 1, the function of the medical data preprocessing module is to collect medical text data and clean the collected medical data, including standardizing the text, removing noise, etc.
[0071] The function of the knowledge extraction and medical graph generation module is to generate and integrate relational triplets by identifying entities and their relationships in medical texts, thereby constructing a preliminary medical knowledge graph. First, the input text is segmented and the contextual embedding vector of the word is generated. Subsequently, the embedding vector is processed by bidirectional sequence modeling to capture the contextual dependencies. On this basis, the semantic similarity matrix and relative position encoding are introduced for feature enhancement. The two are combined to generate attention weights, thereby weighting the output to generate comprehensive features with more contextual significance. Next, conditional random fields are used to further identify entities in the text, which are used to generate candidate sets of entity pairs. Subsequently, the entity pairs are encoded, and the relationships between them are identified through sequence labeling methods to construct relational triplets. Finally, these relational triplets are integrated into the knowledge graph to form a preliminary medical knowledge graph.
[0072] The function of the medical knowledge graph potential relationship reasoning and completion module is to complete the knowledge graph. First, the triples in the knowledge graph are converted into sequences to generate deep semantic representations. At the same time, the graph attention network is used to process the graph structure information to generate a structured representation of the nodes. Then, the semantic representation is combined with the structural representation to form a comprehensive feature. The Dropout operation is introduced to generate positive and negative samples, and the improved loss function is used for training. Finally, the relationship reasoning is performed by calculating the score of the triples to predict and complete the potential relationship in the knowledge graph.
[0073] The function of the keyword network and semantic analysis retrieval module is to identify the intent and slot information of the user's query. First, the medical text data is segmented, stop words are removed, and the word embedding vectors of the keywords are calculated to generate a keyword co-occurrence matrix and convert it into a keyword network graph. Then, through community detection and graph embedding technology, the influential nodes in the network are identified, and a hierarchical index is constructed for effective query matching. Finally, for the query entered by the user, slot filling and intent recognition are performed.
[0074] The function of the semantic mapping and query response module is to execute queries and return query results. First, the user's slot information is received from the semantic query device, and keywords are extracted and preliminarily matched with entity nodes in the knowledge graph; if the match is incomplete or there is ambiguity, the edit distance algorithm is used to find the closest node. Receive the user's intention recognition results, analyze the query purpose, and determine the relationship type that needs to be queried in the knowledge graph. Secondly, for complex queries, multiple entities are combined and matched, the relationship path is determined, and the query is performed through the predefined relationship types in the knowledge graph to ensure that all relevant information is covered. Finally, all the found entity and relationship information is integrated, and the comprehensive query results are returned to complete the retrieval.
[0075] In this embodiment, the specific steps provided are:
[0076] Step 1: Collect medical text data and clean the collected medical data, including standardizing text and removing noise;
[0077] Step 2: Segment the input text and generate the word context embedding vector H = [h1,h2,...,h n ], these embedding vectors are input into the bidirectional long short-term memory network to capture the contextual dependencies and generate the hidden state vector In order to enhance feature representation, the semantic similarity matrix and relative position encoding are introduced. The semantic similarity matrix S is used to measure the semantic relevance of words, and its calculation formula is: The relative position matrix R is used to capture word order information, and its calculation formula is R ij = clamp(ij,-d max,d max )+d max , where i and j are the positions of word i and word j in the sentence respectively, and d max is the maximum distance of the relative position, and the relative position encoding matrix is mapped to the relative position vector E rel (R ij ), the attention score A is calculated by combining the semantic similarity matrix and the relative position ij , the calculation formula is Calculate the context vector based on the attention score And concatenate it with the output, and generate the fusion feature F through linear transformation i =FusionLinear(H BiLSTM ||C i ). The fusion features are input into the conditional random field model for sequence labeling, maximizing the conditional probability to identify medical entities;
[0078] Step 3: Use the entity recognition device to extract and organize the recognized entities to generate a candidate set of entity pairs. Next, encode the context text of these entity pairs to generate context-related word vector representations. and Then, the generated word vector representation is input into the conditional random field model to label the entity pairs. By combining the global sequence information, the relationship type between the entity pairs is identified and the loss function is minimized. Accurately predict the relationship category R. Finally, based on the identified relationships, the entity pairs are constructed into relationship triples, and all generated relationship triples are integrated into the knowledge graph, where nodes represent entities and edges represent relationships between entities, thus constructing a preliminary medical knowledge graph;
[0079] Step 4: Improve the performance of knowledge graph reasoning by integrating semantic and structural information. First, extract semantic representations from the input sequence and calculate the head entity relation and tail entity And adopt the semantic scoring function f B (h, r, t) measures the semantic score of the triple, and the calculation formula is Next, the graph attention network assigns weights to neighbor nodes through the attention mechanism, captures the entity relationship in the graph structure, aggregates distant neighbor information layer by layer, and generates a structured representation of each entity. G (h, r, t) measures the structure score of the triple, and the formula is in, is the representation of the head entity, is the representation of the tail entity, thus ensuring that the model effectively learns the structural features. Finally, in order to make full use of the semantic and structural information, the semantic embedding and structural embedding Fusion forms a comprehensive feature representation, and then infers the potential relationship in the knowledge graph to complete the medical knowledge graph;
[0080] Step 5: Perform word segmentation on the medical text data and generate the text set u after removing stop words m The word sequence And use the medical dictionary Dic to calculate the weight of the words weight (d), extract the keywords of each document, and calculate the word frequency TF (w,u m ), and combined with the inverse document frequency to obtain the weighted TF-IDF value, sorted in descending order, and the top 50 words were selected as keywords to form a keyword set K = {k1, k2, ..., k i ,...,k N×count(A) Then, initialize the co-occurrence matrix M, define the co-occurrence window size as 5, and calculate the number of keywords in document u. m The co-occurrence frequency in the keyword network is calculated and a keyword network graph G = (K, E) is generated, where E represents an edge set and the weight is determined by the number of co-occurrences. If the number of co-occurrences exceeds 5, a corresponding connection is established.
[0081] Step 6: Perform community detection on the generated keyword network G. Initially, each node is treated as an independent community, and communities are gradually merged and modularity gains are calculated until the optimal community division is achieved. For each subgraph G i , select the node whose betweenness centrality value Center is greater than the threshold θ as the influential node And use graph embedding technology to generate the embedding vector e(v) of each node. In hierarchical retrieval, by traversing the hierarchical index of the keyword network, the semantic relevance between the input query and the influential node is calculated, and the final community and the corresponding neighboring nodes are selected based on the relevance;
[0082] Step 7: Slot labeling and intent labeling for medical questions. First, generate the hidden state representation of each word and calculate the intent prediction probability through the fully connected layer. Then, use the sequence labeling method to perform the slot filling task, identify and match the information in the query, and finally output the predicted intent and slot information.
[0083] Step 8: Receive the slot information of the user's query from the semantic query device and extract the keyword set K'={k'1, k'2, ..., k' n} and the entity node set E = {e1, e2, …, e n} for preliminary matching. Find the corresponding entity node e∈E through string matching. If the keyword k' cannot be matched to the entity node or there is ambiguity, use the edit distance algorithm to calculate the edit distance ED(k',e) between the keyword k' and the entity name e. The calculation formula is ED(k',e)=min{Insertions(k',e),Deletions(k',e),Substitutions(k',e)}, where Insertions(k',e), Deletions(k',e) and Substitutions(k',e) represent the minimum number of insertion, deletion and replacement operations, respectively. Next, receive the intention recognition result of the user query from the semantic query device, analyze the purpose of the user query, and determine the relationship type that needs to be queried in the knowledge graph. For complex queries, multiple entities are Combine them for matching, determine the relationship path P(E') between multiple entities, and combine the query through the predefined relationship type R(E') in the knowledge graph. The relationship path P(E') represents a multi-hop path from one entity node to another entity node in the knowledge graph, and the formula is Calculate, where Path(e i ,e j ) represents entity e i and e j Finally, all the relevant entities and relationship information found are integrated, and the comprehensive query results are returned to complete the retrieval.
[0084] In summary, the system of this application can comprehensively parse the user's query statement, deeply analyze the user's query intention, and effectively retrieve and provide the medical information required by the user by matching with the relevant entities and relationships in the medical knowledge graph. The system can not only recognize and process simple queries, but also cope with complex query scenarios, and meet the user's needs for medical information by identifying multi-hop paths and combined relationship types.
[0085] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0086] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in the field can change, modify, replace and modify the above embodiments within the scope of the present application without departing from the principles and purpose of the present application.
Claims
1. A medical knowledge graph retrieval system based on potential relationship mining, characterized in that: The system comprises: Medical data preprocessing module, used for collecting and preprocessing raw medical data; The knowledge extraction and medical graph generation module uses the named entity recognition model to identify medical entities from the processed medical data, and analyzes the relationship between entities through the relationship construction model to form a preliminary medical knowledge graph. The medical knowledge graph potential relationship reasoning and completion module analyzes the structural information and semantic features based on the constructed knowledge graph, mines the potential relationships between entities, and supplements the unclear relationships, thereby improving the knowledge graph; The keyword network and semantic analysis retrieval module constructs a keyword network by segmenting medical texts and calculating weights. It uses community detection and graph embedding technology to identify relevant key nodes, perform slot labeling, and identify intent. The semantic mapping and query response module receives the user's query intent and slot information, maps keywords to entities and relationships in the medical knowledge graph, executes the query and returns the results.
2. The system according to claim 1, characterized in that The medical data preprocessing module includes: a data acquisition device and a data preprocessing device. The data acquisition device is used to collect medical data, and the data preprocessing device is used to clean the collected data, including standardizing text and removing noise.
3. The system according to claim 1, characterized in that The knowledge extraction and medical graph generation module includes: an entity recognition device and a relationship construction device: The configuration contents of the entity recognition device include: (1) The input text is segmented and the word context embedding is represented as H = [h1,h2,...,h n ], where h i Represents the vector of the i-th word, uses a bidirectional long short-term memory network to process H, and generates the forward and backward context representations H of each word BiLSTM ; (2) Using the formula To calculate the semantic similarity matrix, which is used to measure the semantic relevance between words in a sentence, the formula R is used ij = clamp(ij,-d max ,d max )+d max Calculate the relative position encoding to capture the order and distance information between words, where i and j are the positions of word i and word j in the sentence, respectively, and d max is the maximum distance of the relative position, the relative position encoding matrix R ij Mapped to relative position vector E rel (R ij ), the clamp function is used to limit the value of ij to [-d max ,d max ]between; (3) Calculate the attention score A by combining the semantic similarity matrix and relative position ij , the formula is Among them, Q i is the query vector of word i, K j is the key vector of word j, is the transpose of the key vector, λ is the hyperparameter of the semantic similarity matrix that affects the final attention. After calculating the attention score, these weights are used to perform weighted summation on the word representation to generate the context vector C for each word. ij , the formula is Among them, A ij represents the attention weight of word i to word j, V j Represents the value vector of the jth word; (4) Output vector H BiLSTM With the context vector C i Concatenation, which reduces the dimension through linear transformation to generate the final fusion feature representation, and uses sequence labeling method to parse the fusion features to identify medical entities in the text; The setting contents of the relationship building device include: Receive the identified entities, construct a candidate set of entity pairs, and encode their contexts to generate word vectors, so as to identify the relationship type of the entity pairs. The identification results will be constructed as triples and integrated into the knowledge graph, so that nodes represent entities and edges represent relationships, forming a preliminary medical knowledge graph.
4. The system according to claim 1, characterized in that The medical knowledge graph potential relationship reasoning and completion module includes: a knowledge graph completion device: The setting contents of the knowledge graph completion device include: (1) Extract deep semantic information from the triples in the knowledge graph and calculate the representations of the head entity, relation, and tail entity, respectively. and Using semantic scoring function Calculate the semantic score of the triple; (2) Capture the structural information in the medical knowledge graph through the graph attention network and generate the structural representation of each entity In the aggregation process, relation embedding is introduced as the feature of the edge, and the model perception range is expanded by stacking multiple layers of structures, aggregating distant neighbor information layer by layer to capture global relation features and structural information; (3) Using structural scoring function Compute the structure score of a triple, where is the representation of the head entity, is the representation of the tail entity; (4) To fully utilize semantic and structural information, semantic embedding With structural embedding Fusion is performed to form a comprehensive feature representation H ij , an improved contrast loss function is used to maximize the difference in positive and negative sample scores. The formula is: Among them, f B and f G are the semantic score and structural score of the positive sample, respectively, and f' B and f' G is the semantic and structural score of negative samples, τ is the balance factor, Σ t' It means to sum up the scores of negative samples, reason about the relationships between entities based on the comprehensive feature representation, and complete the medical knowledge graph.
5. The system according to claim 1, characterized in that The keyword network and semantic analysis retrieval module includes: a medical keyword network construction device, a hierarchical retrieval device and a semantic query device: The settings of the medical keyword network construction device include: (1) The medical text data is divided into text sets, a word sequence is generated without stop words, and the keyword K is extracted. The top 50 words are selected as keywords by calculating the keyword weights; (2) Initialize the co-word matrix, set the co-occurrence window to 5, check the co-occurrence of keywords in each document within the window, update the co-word matrix, and then convert it into a keyword network graph G = (K, E), where the weight of the edge depends on the number of co-occurrences of the keywords. If the number of co-occurrences exceeds 5, a corresponding connection is established; The configuration contents of the hierarchical search device include: (1) Detect communities on the keyword network G, initialize each node as an independent community, merge communities and calculate modularity gain until there is no significant gain, and finally obtain community divisions containing highly related keywords; (2) Divide the network into S communities, select nodes with betweenness centrality greater than a threshold from each community as influential nodes, generate node embedding vectors, calculate word semantic similarity based on user keywords, select the most relevant community and build a hierarchical index, start traversing from the top layer, calculate the correlation between keywords and influential nodes, and after finding relevant nodes, set the jump probability of neighbor nodes to 0.5, and finally output the top 10 neighbor nodes; The configuration contents of the semantic query device include: (1) Extract keywords from medical questions, annotate slots and intents, extract features and calculate intent scores, fill slots through semantic parsing methods, and finally output predicted intent and slot information.
6. The system according to claim 1, characterized in that The semantic mapping and query response module includes: query feedback device: The settings of the query feedback device include: (1) Receive user query slot information, extract keyword sets, and match the entity node set E = {e1, e2, …, e m }, if not found or ambiguous, the edit distance algorithm is used to match the closest entity node; (2) Based on the keyword network G and the number of communities S, analyze the user's query intent and determine the type of relationship to be retrieved. For complex queries, multiple matching entities are Combine, find the relationship path between them, combine predefined relationship types for query, and finally integrate related entity and relationship information and return the retrieval results.
7. A medical knowledge graph retrieval method based on potential relationship mining, characterized in that: The method comprises: Clean the collected medical data, including standardizing text and removing noise; Based on the processed medical data, the named entity recognition model is used to identify medical entities from the processed data, and the relationship between entities is analyzed through the relationship construction model to form a preliminary medical knowledge graph; Based on the constructed knowledge graph, analyze the structural information and semantic features, explore the potential relationships between entities, and supplement the unclear relationships, so as to improve the knowledge graph; By performing word segmentation and weight calculation on medical texts, a keyword network is constructed, and community detection and graph embedding technology are used to identify relevant key nodes, perform slot labeling and intent recognition; Receive the user's query intent and slot information, map keywords to entities and relationships in the medical knowledge graph, execute the query and return the results.
8. A computer program product, characterized in that include: Computer instructions; When part or all of the computer instructions are executed on a computer, the medical knowledge graph retrieval method based on potential relationship mining as described in claim 7 is executed.
9. A computing device, characterized in that include: Processor and memory; The memory is used to store computer programs; The processor is used to execute the computer program to implement the medical knowledge graph retrieval method based on potential relationship mining as described in claim 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions or programs, and when the computer instructions or programs are executed on the computer, the medical knowledge graph retrieval method based on potential relationship mining as described in claim 7 is executed.
Citation Information
Cited By
Automatic standard term recommendation method
CN119938902A
Drug use assisting system and device based on symptom-drug two-way verification
CN120164570A
A medication assistance system and device based on symptom-drug bidirectional verification
CN120164570B
Intelligent retrieval method and system for genuine medicinal materials based on atlas
CN120216741A
An intelligent retrieval method and system for authentic medicinal materials based on a spectrum
CN120216741B