Heterogeneous knowledge-based medical multi-hop text question and answer retrieval enhancement method

By constructing heterogeneous graphs and large-scale pre-trained language models to break down complex questions into atomic queries, and combining multi-hop path retrieval and scoring mechanisms, we solve the single data source limitations and lack of interpretability of existing medical question-answering systems, and achieve high-precision and explainable medical question-answering.

CN120821802APending Publication Date: 2025-10-21EAST CHINA UNIV OF SCI & TECH
View PDF 0 Cites 9 Cited by

Patent Information

Application Number
CN202510921394.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-10-21

AI Technical Summary

Technical Problem

When processing complex medical queries, existing medical text question-answering systems have the limitations of a single data source, lack of an effective question decomposition mechanism, and insufficient reasoning explainability. They find it difficult to fully utilize structured and unstructured medical knowledge, and lack the comprehensive use of heterogeneous information.

Method used

A heterogeneous graph structure is constructed, and entity nodes in the knowledge graph and medical document fragments are unified into the same graph. They are connected through entity-document mapping relationships, and a large-scale pre-trained language model is used to iteratively decompose complex problems into atomic queries. Combined with multi-hop path retrieval and scoring mechanism, the marginal ranking loss function is used to optimize the model to generate explainable reasoning results.

Benefits of technology

It achieves high-precision medical question-answering, improves the processing capability and explainability of complex problems, provides detailed reasoning chains and evidence support through multi-source knowledge fusion and refined problem decomposition, and enhances the accuracy and transparency of medical question-answering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120821802A_ABST
    Figure CN120821802A_ABST
Patent Text Reader

Abstract

The invention provides a medical multi-hop text question and answer retrieval enhancement method based on heterogeneous knowledge. The method comprises the following steps: firstly, constructing a uniform heterogeneous graph structure based on a medical knowledge graph of a medical document, and establishing a semantic bridge through an entity-document mapping relationship; performing semantic decomposition on a complex medical problem input by a user by utilizing the large model, and iteratively generating a series of mutually independent atomic queries; searching a reasoning path in the entity sub-graph of the heterogeneous graph, and calculating a path score by fusing the weighted combination of the entity association text similarity, the entity matching degree and the path edge weight; training a retriever by adopting a marginal sorting loss function, and optimizing a retrieval effect through positive and negative sample comparative learning; and finally, calling a large model to convert the reasoning path with the highest score into a text, and extracting a document fragment corresponding to a path node. According to the method, the problems that an existing retrieval enhancement technology is insufficient in complex problem processing capacity, poor in reasoning interpretability and the like are effectively solved, and high-accuracy medical questions and answers are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing technology, in particular to the field of medical text question answering and knowledge graph reasoning technology. More specifically, it relates to a medical multi-hop text question answering retrieval enhancement method based on heterogeneous knowledge. The method decomposes complex medical problems into atomic problems by constructing a heterogeneous graph reasoning enhancement framework, and combines document retrieval and knowledge graph reasoning to achieve high-precision medical question answering and explainable reasoning. Background Art

[0002] With the rapid development of medical information digitization, medical text question answering systems are playing an increasingly important role in clinical decision support, medical education, and patient consultation. However, existing medical text question answering technologies still have many shortcomings when processing complex medical queries.

[0003] Existing Retrieval Augmentation Generation (RAG) methods primarily rely on a single data source for information retrieval, such as a document repository or knowledge graph. The limitations of this single data source often prevent them from fully leveraging the complementary advantages of structured knowledge and unstructured text when addressing complex medical problems. Medical knowledge encompasses a vast amount of textual material, such as medical literature and clinical guidelines, as well as the complex relationships between entities such as diseases, symptoms, and medications. A single data source cannot fully capture this heterogeneous medical knowledge.

[0004] Traditional medical question-answering systems lack effective problem decomposition mechanisms when handling complex reasoning problems. Medical diagnosis and treatment often involve multiple, interconnected reasoning steps, requiring comprehensive consideration of patient symptoms, medical history, test results, and other information. Existing methods that directly use complex questions for retrieval often fail to accurately locate relevant knowledge fragments, resulting in inadequate or erroneous reasoning.

[0005] Furthermore, existing technologies lack sufficient explainability when providing answers. The medical field places high demands on transparency and explainability in the reasoning process; doctors and patients need to understand the specific reasoning path used by the system to reach its conclusions. However, most existing systems only provide the final answer and fail to demonstrate the detailed reasoning process, limiting their application in real-world medical scenarios.

[0006] Existing methods for reasoning on knowledge graphs primarily focus on reasoning about relationships between a single type of entity, lacking the comprehensive utilization of heterogeneous information. Medical knowledge graphs contain diverse entities such as diseases, symptoms, medications, and examination items, each with complex semantic relationships. Traditional methods struggle to effectively integrate this heterogeneous information, impacting the accuracy and completeness of reasoning. Summary of the Invention

[0007] The purpose of the present invention is to provide a medical text question-answering atomic question reasoning method and system based on heterogeneous knowledge, to solve the problems of single data source limitations, insufficient complex problem processing capabilities, poor reasoning explainability, etc. in the existing technology, and to achieve high-precision medical question answering and explainable reasoning.

[0008] In order to achieve the above object, the present invention provides the following solutions, including:

[0009] S1: Heterogeneous Graph Construction: Based on medical professional documents and existing medical knowledge graphs, a unified heterogeneous graph structure is constructed. The heterogeneous graph structure integrates entity nodes from the knowledge graph with fragment nodes extracted from documents such as medical books and clinical guidelines into the same graph. Through the mapping relationship between entities in the documents, connections are established between entity nodes and document fragment nodes, thus forming a heterogeneous graph.

[0010] S2: Atomic Question Decomposition: For complex medical questions raised by users, we use a large-scale pre-trained language model to perform semantic understanding and task decomposition. The model iteratively parses the input question into several "atomic queries" with independent meaning, clear semantics, and logical coherence. Each atomic query focuses on a sub-question, resulting in a set of atomic queries for the question.

[0011] S3: Path retrieval and scoring: In the constructed heterogeneous graph, for each atomic query, focus on the entity subgraph and use a multi-hop approach to find a reasonable reasoning path from the starting entity to the potential target entity. For each path, a comprehensive score is performed based on three types of information: the semantic similarity between the document fragments associated with each entity on the path and the query, the degree of match between the path endpoint entity and the query target, and the semantic weight of the edges in the path. Finally, the overall score of each path is determined in a weighted combination to identify the path with the most reasoning value. The entity subgraph is a local subgraph centered on the current entity and expanded through entity relationships within a predefined hop range.

[0012] S4: Retrieval training: Construct a training sample set containing positive and negative paths. Positive paths are the most valuable inference paths; negative paths are misleading or irrelevant paths. The training sample set is used to train the model using a marginal ranking loss function. The marginal ranking loss function encourages the model to assign higher scores to positive paths, thereby optimizing the vector representation between entity nodes and queries, and dynamically adjusting the weights of edges in the graph to obtain a trained retriever.

[0013] S5: Recall strategy and retrieval enhancement generation: Further process the highest-scoring and most valuable reasoning paths, use a large language model to generate reasoning explanation text in natural language, connect the entity nodes involved in the path and the relationships between them in a coherent manner to form a clear reasoning chain, and then combine the retrieved document fragments, reasoning path information and the original question as context input, use a large language model for retrieval enhancement generation, and finally make a response to the medical multi-hop question answering.

[0014] Among them, S1 constructs a heterogeneous graph based on medical documents and knowledge graphs, integrates entity nodes and document fragment nodes in the knowledge graph into the same graph structure, and connects them through entity-document mapping relationships to form a heterogeneous graph:

[0015] S11: Extracting knowledge graph entity nodes and relationship edges: Extract all entity nodes from the medical knowledge graph, including medical concepts such as diseases, symptoms, examination methods, treatment plans, and drugs, and identify the associations between entities in the graph;

[0016] S12: Segmenting medical documents into structured segments: Slicing unstructured medical documents to ensure that each document segment is semantically complete and thematically focused. Each segment serves as a document node in the graph, carrying specific medical facts, instructions, or guidelines.

[0017] S13: Establishing a mapping relationship between entities and document fragments: Using similarity calculation and entity linking technology, the most relevant medical entities in a text fragment are identified and linked to the standard entity nodes in the knowledge graph to establish a semantic association relationship between the entity and the document fragment;

[0018] S14: Fusion to construct heterogeneous graph structure: Entity nodes, document nodes, and all relationship edges between them are fused to construct a heterogeneous graph, which contains the structured relationships defined in the knowledge graph and the semantic connections between entities and unstructured documents.

[0019] S2 uses a large-scale pre-trained language model to perform semantic decomposition on complex medical questions and answers input by users, iteratively generating a series of independent and logically self-consistent atomic queries:

[0020] S21: Design a question decomposition prompt template: For multi-sub-intent questions commonly encountered in medical question-answering scenarios, design a structured prompt template. This template combines domain terminology, question patterns, and logical structure to guide the model to decompose a lengthy or complex main question into several smaller atomic queries.

[0021] S22: Iteratively generate atomic queries for each step: Based on the user's initial input, the language model combines previously generated atomic queries and iteratively generates the next step of the question through contextual reasoning. Each generation comprehensively considers the overall semantics, existing information, and the current context.

[0022] S23: Set termination conditions: During the problem decomposition process, set a reasonable termination strategy to avoid redundant generation. When the model determines that the original problem has been fully covered or no meaningful new sub-problems can be generated, the generation process is automatically terminated.

[0023] Among them, S3 searches for a multi-hop reasoning path from the starting entity to the candidate terminal entity in the entity subgraph of the heterogeneous graph, and calculates the path score through a weighted combination of the entity-associated document fragment similarity, the terminal entity similarity, and the path edge weight:

[0024] S31: Searching for multi-hop reasoning paths in the entity subgraph: Starting from the starting entity identified in the atomic query, explore multi-hop paths in the graph that can lead to other candidate end entities. The search process considers factors such as path length, hop limit, and edge type limit to avoid generating overly long or invalid paths.

[0025] S32: Unify entities, documents, and questions into a vector space: Map entities in the path, the document fragments corresponding to the entities, the atomic query itself, and candidate options into vector representations. This process relies on a pre-trained medical-specific embedding model to capture the semantic relevance and contextual information between medical terms.

[0026] S33: Fusion of multiple features to calculate the reasoning score of the path: The rationality score of each path is calculated based on a combination of factors, including the semantic similarity between the entity-associated document and the atomic query, the semantic fit between the entity and the question in the path, and the weight and type reliability of the edges in the path structure.

[0027] Among them, S4 uses marginal ranking loss to optimize the vector representation and edge weight of entities and questions based on the comparison between positive and negative example paths, so that the score of the correct reasoning path is higher than that of the wrong path:

[0028] S41: Construct positive and negative path pairs to form a training sample set: Based on manual annotation or rule-based derivation methods, a set of positive example paths is constructed, i.e., a knowledge chain that conforms to actual medical logic; at the same time, corresponding negative example paths are generated, such as irrelevant paths, logically conflicting paths, or semantically deviating paths;

[0029] S42: Design a ranking loss function: Use a ranking-oriented loss function to constrain the model to always give higher scores to positive paths than to negative paths, forcing the model to establish judgment criteria based on the overall semantics, structure, and evidence support of the path.

[0030] S43: Jointly optimize multiple module parameters: During training, the model simultaneously optimizes multiple parameters such as entity embedding, document fragment representation, atomic question understanding, and path edge weight estimation, so that the representations between different modalities are gradually aligned.

[0031] Among them, S5 calls the large model to convert the path nodes and their relationships into coherent reasoning text for the highest-scoring reasoning subgraph path, and extracts the document fragments mapped to each entity on the path as supporting evidence for the reasoning:

[0032] S51: Calling the language model to generate a complete reasoning chain text: After selecting the reasoning path with the highest score, calling the large-scale language model to convert the path into natural language, organizing the entities on the path, the relationships between entities, the path structure and other information into a reasoning explanation text;

[0033] S52: Combining the retrieved document fragments, reasoning path information, and the original question as context input, a large language model is used for retrieval enhancement generation to obtain a response for medical multi-hop question answering.

[0034] As can be seen from the above technical solutions, the present invention first constructs a unified heterogeneous graph structure based on medical professional documents and existing medical knowledge graphs, organically integrates entity nodes and document fragment nodes in the knowledge graph, and establishes a semantic bridge through the entity-document mapping relationship, providing a rich knowledge representation foundation for medical question-answering reasoning. Secondly, an atomic question decomposition mechanism based on a large-scale pre-trained language model is proposed to iteratively decompose complex medical questions into semantically independent and logically self-consistent atomic queries, effectively reducing the complexity of the problem and improving the pertinence and accuracy of reasoning. Then, a multi-hop reasoning path retrieval and scoring algorithm is designed. By integrating the weighted combination of entity-related document fragment similarity, endpoint entity matching, and path edge weight, an accurate assessment of the rationality of the reasoning path is achieved. Next, a marginal ranking loss function is used to optimize the retriever parameters, and through positive and negative sample comparative learning, the model's ability to identify the correct reasoning path is significantly improved. Finally, based on the recall strategy, a natural language reasoning explanation text is generated, and the document fragments corresponding to the path nodes are extracted as supporting evidence, providing an explainable reasoning process and reliable factual basis for medical question-answering. The medical text question-answering atomic question reasoning system constructed by this method based on heterogeneous knowledge has the following significant advantages: (1) Multi-source knowledge fusion and complementarity: By constructing a heterogeneous graph structure, the advantages of structured knowledge graphs and unstructured medical documents are effectively integrated, overcoming the limitations of a single data source, achieving complementary knowledge enhancement, and providing more comprehensive and accurate knowledge support for complex medical reasoning. (2) Refined problem decomposition and processing: The atomic problem decomposition mechanism can gradually decompose complex medical problems into independently processable sub-problems, reducing the difficulty of reasoning, improving the system's processing capabilities for complex medical scenarios, and enabling each atomic query to obtain a more accurate answer. (3) Explainable reasoning and evidence support: The system not only provides the final answer, but also generates a complete reasoning chain and corresponding document evidence, significantly improving the interpretability and credibility of medical question answering, helping medical staff understand the reasoning process and enhancing their confidence in decision-making. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] After reading the detailed description of the present invention with reference to the accompanying drawings, readers will have a clearer understanding of various aspects of the present invention.

[0036] Figure 1 The overall architecture diagram of the medical text question-answering atomic question reasoning method based on heterogeneous knowledge proposed by the present invention is shown;

[0037] Figure 2 A schematic diagram of the heterogeneous graph construction process proposed by the present invention is shown;

[0038] Figure 3 The atomic problem disassembly flow chart proposed by the present invention is shown;

[0039] Figure 4 A schematic diagram of the path retrieval and scoring mechanism proposed in the present invention is shown;

[0040] Figure 5 The following is a flow chart of the recall strategy proposed by the present invention. DETAILED DESCRIPTION

[0041] The present invention proposes a medical text question-answering atomic question reasoning method and system based on heterogeneous knowledge, which mainly includes five steps: building a unified heterogeneous graph structure based on medical professional documents and existing medical knowledge graphs; using a large-scale pre-trained language model to decompose complex medical problems into atomic questions; performing path retrieval and scoring in the heterogeneous graph; training the retriever through a marginal ranking loss function; and finally generating explainable reasoning results through a recall strategy.

[0042] Step S1: Construct a heterogeneous graph based on medical documents and knowledge graphs. The entity nodes and document fragment nodes in the knowledge graph are unified into the same graph structure and connected through entity-document mapping relationships to form a heterogeneous graph. Specifically, it includes:

[0043] S11: Extracting knowledge graph entity nodes and relationship edges: Extracting all entity node sets from the medical knowledge graph These entities include medical concepts such as diseases, symptoms, examination methods, treatment plans, and drugs. At the same time, the association between entities in the graph is identified to form an edge set. For example, relationships such as "disease-manifestation-symptom" or "drug-treatment-disease" exist in the form of edges, forming the basic topological structure of the knowledge graph and providing structural support for subsequent path reasoning;

[0044] S12: Split medical documents into structured segments: Split unstructured medical documents into semantically complete segments to ensure that each document segment is thematically focused. The segmented document segments are used as document node sets in the graph. Each fragment carries specific medical facts, instructions, or guidelines. Document fragmentation enables more fine-grained information mapping and extraction of reasoning evidence.

[0045] S13: Establish the mapping relationship between entities and document fragments: After preprocessing the document fragments, similarity calculation and entity linking technology are used to identify the most relevant medical entities in the text fragments and link them to the standard entity nodes in the knowledge graph. Establish the entity-document mapping edge set E map =(e i ,d j ), this edge indicates that a knowledge entity is explicitly mentioned, defined, or explained in a certain document, introducing a semantic bridge into the graph structure;

[0046] S14: Fusion to construct a heterogeneous graph structure: The entity nodes, document nodes, and all the relationship edges between them obtained above are fused to construct a heterogeneous graph:

[0047]

[0048] The graph contains both structured relationships defined in the knowledge graph and semantic connections between entities and unstructured documents, thus connecting structural knowledge with factual evidence. This graph is both logically traceable and textually interpretable, providing a rich reasoning space and retrieval support for question-answering tasks.

[0049] In step S2, based on a large-scale pre-trained language model and an atomic question decomposition mechanism, a semantic decomposition tool is used to decompose complex medical questions and answers entered by users. The tool is divided into three core modules: question decomposition prompt template design, iterative atomic query generation, and termination condition control. Specifically, it includes:

[0050] S21: Design question decomposition prompt templates to guide language model output: For multi-sub-intent questions commonly encountered in medical question-answering scenarios, we design structured prompt templates that issue "step-by-step question decomposition" instructions to the large model in natural language. These prompt templates combine medical domain terminology, question patterns, and logical structure to guide the model to decompose complex main questions into several smaller atomic queries. The prompt template format is as follows:

[0051] {

[0052] Task setting: "Please decompose complex medical problems into several independent atomic queries. Each query should be semantically clear and logically coherent.",

[0053] Output form: "Output a list of atomic queries in order, in the format ['Query 1', 'Query 2', 'Query 3'], ensuring that each query has independent meaning."

[0054] }

[0055] S22: Iteratively generate atomic queries at each step to ensure semantic coherence: Based on the user's initial input x, the language model combines the previously generated atomic query sequence q (1:i-1) , iteratively generates the atomic query q of step i through context reasoning (i) . Iterative atomic query decomposition using large models:

[0056]

[0057] Each generation takes into account the overall semantics, existing information, and current context to avoid duplication or omission of key content. This process continues until all potential query intents in the original question are fully covered.

[0058] S23: Set termination conditions to control the boundaries of problem solving: During the problem solving process, set a reasonable termination strategy to avoid redundant generation. When the model determines that the original question has been fully covered or that no meaningful new sub-questions can be generated, the generation process is automatically terminated. The termination condition is set based on the language model's confidence score. The process stops when the similarity between two consecutive generated atomic queries exceeds a threshold or when the model outputs a termination signal, ensuring the simplicity and practicality of the problem solving results.

[0059] In step S3, based on the heterogeneous graph and path retrieval mechanism, a multi-hop reasoning path search tool is used to perform path retrieval and scoring for each atomic query. The tool consists of four modules: multi-hop reasoning path search, vector space unified representation, multi-feature fusion scoring, and path ranking output. Specifically, it includes:

[0060] S31: Search for multi-hop reasoning paths in the entity subgraph: Starting from the starting entity identified in the atomic query, explore multi-hop paths that can lead to other candidate terminal entities in the entity subgraph of the heterogeneous graph. These paths may represent causal relationships, diagnosis and treatment processes, or semantic analogies. During the search process, factors such as path length restrictions (usually set to 2-4 hops), edge type restrictions, and semantic relevance are considered to avoid generating paths that are too long or invalid. Each path P consists of a node sequence and edge weights, representing a possible reasoning direction;

[0061] S32: Unify entities, documents and questions into vector space: To achieve unified comparison of cross-modal information, the entities in the path are represented by i , document fragment s corresponding to the entity i , the atomic query q itself is mapped to a vector representation. This process relies on a pre-trained medical-specific embedding model that can capture the semantic relevance and contextual information between medical terms, making the semantic similarity measurable and robust. The vectorized representation supports cosine similarity calculation: cos(s i ,q) and cos(e i ,q)

[0062] S33: Fusion of multiple features to calculate the path reasoning score: The rationality score of each path is calculated by combining multiple factors using a weighted combination method:

[0063]

[0064] The first item is the average semantic similarity between the entity-associated document fragment and the atomic query, the second item is the average semantic fit between the entity in the path and the question, and the third item is the average edge weight in the path structure. λ1, λ2, and λ3 are adjustable weight hyperparameters. The higher the score, the closer the path is semantically to the question.

[0065] In step S4, based on marginal ranking loss and contrastive learning mechanism, we use the retriever training tool to optimize the path scoring model. This tool consists of three core components: constructing positive and negative sample pairs, designing ranking loss function, and multi-module joint optimization. Specifically, it includes:

[0066] S41: Construct positive and negative path pairs to form a training sample set: Construct a set of positive example paths P based on manual annotation or rule deduction methods. + , that is, the knowledge chain that conforms to the actual medical logic; at the same time, the corresponding negative example path P is generated - , such as irrelevant paths, logical conflict paths, or semantic deviation paths. Positive example paths are constructed through expert annotation or based on verified medical literature, and negative example paths are generated through random sampling, path truncation, entity replacement, etc. These paths are related to (P + ,P - ) as training samples for retrieval training;

[0067] S42: Design a ranking loss function to guide the model to learn path preferences: Use a marginal ranking loss function to constrain the model to always give a higher score to the positive example path than to the negative example path. The loss function is defined as:

[0068]

[0069] Where m>0 is a marginal hyperparameter, which is minimized by To learn entity-related documents, atomic queries, question option embeddings, and edge weights to sort the correct paths. This mechanism avoids misleading single scores and effectively enhances the model's ability to distinguish complex path relationships.

[0070] S43: Jointly optimize parameters of multiple modules to train the retriever and improve overall retrieval performance: During training, the model simultaneously optimizes parameters for entity embeddings, document fragment representations, atomic question understanding, and path edge weight estimation. Through continuous iterative learning using the backpropagation algorithm, representations across different modalities are gradually aligned, making the path scoring mechanism more robust.

[0071] Step S5 is based on the large language model-based reasoning chain generation and evidence extraction mechanism. This module converts the highest-scoring reasoning path into a natural language explanation and extracts supporting evidence. It includes two core functions: reasoning text generation and evidence information extraction. Specifically, it includes:

[0072] S51: Call the language model to generate a complete reasoning chain text: After selecting the reasoning path P with the highest score, call the large-scale language model to convert the path into natural language. Generate a template through the designed reasoning:

[0073] R (t) =LLM text (P * ),

[0074] The model organizes information such as entities on the path, relationships between entities, and path structure into logically coherent and semantically clear reasoning explanation text. The generated prompt template is as follows:

[0075] {

[0076] Task setting: "Please generate a coherent medical reasoning explanation based on the given reasoning path, explaining the logical process from the starting concept to the conclusion.",

[0077] Output form: "Generates a reasoning chain in natural language, including key entities and their relationships, ensuring clear and understandable logic."

[0078] }

[0079] S52: Retrieval-enhanced generation: In the reasoning path, each entity may correspond to a medical document fragment. The system automatically extracts these fragments as factual supporting evidence in the reasoning process:

[0080]

[0081] At the final output, the inference text R (t) and corresponding evidence The system presents the evidence together, providing both the answer and the rationale, improving the explainability and auditability of the question-answering system. Evidence fragments are sorted by their importance in the reasoning path, prioritizing the document content most relevant to the key reasoning steps. The resulting prompt template for the generated response is as follows:

[0082]

[0083] Through the collaborative work of the above five steps, the present invention achieves atomic question reasoning for medical text question answering based on heterogeneous knowledge. This not only improves the accuracy of question answering, but also enhances the interpretability of the results through explicit reasoning chains and evidence support, effectively addressing the limitations of single data sources, insufficient complex problem handling capabilities, and poor interpretability of reasoning in existing technologies. Experiments were conducted using the open source models Llama-3.1-8B and Qwen2.5-7B-Instruct on open source medical question answering datasets such as MedQA and MMLU-Med. The proposed method achieved a 6.62% improvement in accuracy over the base Llama-3.1-8B model and an 8.45% improvement over the base Qwen2.5-7B-Instruct model.

Claims

1. A medical multi-hop text question answering retrieval enhancement method based on heterogeneous knowledge, characterized by: The following steps are involved: S1: Heterogeneous Graph Construction: Based on medical professional documents and existing medical knowledge graphs, a unified heterogeneous graph structure is constructed. The heterogeneous graph structure integrates entity nodes from the knowledge graph with fragment nodes extracted from documents such as medical books and clinical guidelines into the same graph. Through the mapping relationship between entities in the documents, connections are established between entity nodes and document fragment nodes, thus forming a heterogeneous graph. S2: Atomic Question Decomposition: For complex medical questions raised by users, we leverage a large-scale pre-trained language model for semantic understanding and task decomposition. The model iteratively parses the input question into several "atomic queries" with independent meaning, clear semantics, and logical coherence. Each atomic query focuses on a sub-question, resulting in a set of atomic queries for the question. S3: Path retrieval and scoring: In the constructed heterogeneous graph, for each atomic query, focus on the entity subgraph and use a multi-hop approach to find a reasonable reasoning path from the starting entity to the potential target entity. For each path, a comprehensive score is performed based on three types of information: the semantic similarity between the document fragments associated with each entity on the path and the query, the degree of match between the path endpoint entity and the query target, and the semantic weight of the edges in the path. Finally, the overall score of each path is determined in a weighted combination to identify the path with the most reasoning value. The entity subgraph is a local subgraph centered on the current entity and expanded through entity relationships within a predefined hop range. S4: Retrieval training: Construct a training sample set containing positive and negative paths. Positive paths are the most valuable inference paths; negative paths are misleading or irrelevant paths. The training sample set is used to train the model using a marginal ranking loss function. The marginal ranking loss function encourages the model to assign higher scores to positive paths, thereby optimizing the vector representation between entity nodes and queries, and dynamically adjusting the weights of edges in the graph to obtain a trained retriever. S5: Recall strategy and retrieval enhancement generation: Further process the highest-scoring and most valuable reasoning paths, use a large language model to generate reasoning explanation text in natural language, connect the entity nodes involved in the path and the relationships between them in a coherent manner to form a clear reasoning chain, and then combine the retrieved document fragments, reasoning path information and the original question as context input, use a large language model for retrieval enhancement generation, and finally make a response to the medical multi-hop question answering.

2. The method for enhancing medical multi-hop text question answering retrieval based on heterogeneous knowledge according to claim 1 is characterized by: The heterogeneous graph construction in step S1 includes: 1) Extracting knowledge graph entity nodes and relationship edges: Extract all entity nodes from the medical knowledge graph, including medical concepts such as diseases, symptoms, examination methods, treatment plans, and drugs, and identify the relationships between entities in the graph; 2) Segmenting medical documents into structured segments: Slicing unstructured medical documents ensures that each document segment is semantically complete and thematically focused. Each segment acts as a document node in the graph, carrying specific medical facts, instructions, or guidelines. 3) Establishing a mapping relationship between entities and document fragments: Using similarity calculation and entity linking technology, we identify the most relevant medical entities in a text fragment and link them to standard entity nodes in the knowledge graph to establish a semantic association relationship between the entity and the document fragment; 4) Fusion construction of heterogeneous graph structure: Entity nodes, document nodes and all relationship edges between them are fused to construct a heterogeneous graph, which contains the structured relationships defined in the knowledge graph and the semantic connections between entities and unstructured documents.

3. The method for enhancing medical multi-hop text question answering retrieval based on heterogeneous knowledge according to claim 1 is characterized by: The atomic problem decomposition in step S2 includes: 1) Designing a question decomposition prompt template: Targeting multi-sub-intent questions commonly encountered in medical question-answering scenarios, we designed a structured prompt template. This template, incorporating domain terminology, question patterns, and logical structure, guides the model to decompose a lengthy or complex main question into several smaller atomic queries. 2) Iteratively generate atomic queries at each step: Based on the user's initial input, the language model combines previously generated atomic queries and iteratively generates the next step of the query through contextual reasoning. Each generation comprehensively considers the overall semantics, existing information, and the current context. 3) Set termination conditions: During the problem decomposition process, set a reasonable termination strategy to avoid redundant generation. When the model determines that the original problem has been fully covered or no meaningful new sub-problems can be generated, the generation process is automatically terminated.

4. The method for enhancing medical multi-hop text question answering retrieval based on heterogeneous knowledge according to claim 1 is characterized by: The path retrieval and scoring in step S3 include: 1) Searching for multi-hop reasoning paths in the entity subgraph: Starting from the starting entity identified in the atomic query, explore multi-hop paths in the graph that can lead to other candidate end entities. The search process considers factors such as path length, hop limit, and edge type limit to avoid generating overly long or invalid paths; 2) Unifying entities, documents, and questions into a vector space: Entities in the path, their corresponding document fragments, the atomic query itself, and candidate options are mapped into vector representations. This process relies on a pre-trained medical-specific embedding model to capture the semantic relevance and contextual information between medical terms. 3) Fusion of multiple features to calculate the path reasoning score: The rationality score of each path is calculated based on a combination of factors, including the semantic similarity between the entity-associated document and the atomic query, the semantic fit between the entity in the path and the question, and the weight and type reliability of the edges in the path structure.

5. The method for enhancing medical multi-hop text question answering retrieval based on heterogeneous knowledge according to claim 1 is characterized by: The retriever training in step S4 includes: 1) Constructing positive and negative path pairs to form a training sample set: Based on manual annotation or rule-based inference, a set of positive example paths (i.e., knowledge chains that conform to actual medical logic) is constructed; at the same time, corresponding negative example paths are generated, such as irrelevant paths, logically conflicting paths, or semantically deviating paths; 2) Designing a ranking loss function: Using a ranking-oriented loss function, the model is constrained to always give positive paths higher scores than negative paths, forcing the model to establish judgment criteria based on the overall semantics, structure, and evidence support of the path. 3) Jointly optimize multiple module parameters: During training, the model simultaneously optimizes multiple parameters such as entity embedding, document fragment representation, atomic question understanding, and path edge weight estimation, so that the representations between different modalities are gradually aligned.

6. The method for enhancing medical multi-hop text question answering retrieval based on heterogeneous knowledge according to claim 1, characterized in that: The recall strategy in step S5 includes: 1) Using a language model to generate a complete reasoning chain text: After selecting the highest-scoring reasoning path, a large-scale language model is used to convert the path into natural language, organizing information such as the entities on the path, the relationships between entities, and the path structure into a piece of reasoning explanation text; 2) Combining the retrieved document fragments, reasoning path information, and the original question as contextual input, a large language model is used for retrieval enhancement generation to obtain medical multi-hop question answering responses.

Citation Information

Cited By

  • Medical decision-oriented multi-level knowledge graph construction and semantic reasoning method

    CN121168681A

  • Medical document intelligent generation method based on retrieval enhancement and multi-modal features

    CN121212086A

  • Medical question and answer method and system based on diverse retrieval and evidence-based reasoning

    CN121278068A

  • Chip parameter retrieval method and device, electronic equipment and storage medium

    CN121434329A

  • Medical question and answer method and system based on multi-stage preference alignment retrieval enhancement

    CN122198148A