Medical document slicing and retrieval method and device, equipment and storage medium

By constructing and storing child nodes of semantic summary text and structured keyword sets, and combining vector and keyword databases for dual-channel retrieval, the problems of semantic fragmentation and lack of context in existing technologies are solved, generating accurate answers that conform to clinical standards, and improving the speed and efficiency of medical document slicing and retrieval.

CN120994800APending Publication Date: 2025-11-21XIEHE HOSPITAL ATTACHED TO TONGJI MEDICAL COLLEGE HUAZHONG SCI & TECH UNIV

Patent Information

Application Number
CN202511528391.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing technologies suffer from semantic fragmentation, lack of contextual anchors, and disconnect between keyword retrieval and vector retrieval when processing professional medical literature. This results in low relevance of search results, poor clinical usability, and affects the quality of large model inference.

Method used

By constructing child nodes containing semantic summary text and structured keyword sets, storing them in vector and keyword databases, and performing dual-channel retrieval when receiving user queries, relevant target child nodes are obtained, and the original content of the target parent node is extracted and transmitted to the large language model to generate answers.

Benefits of technology

It significantly improves the relevance and accuracy of search results, and the generated answers strictly follow clinical guidelines, achieving a seamless connection from retrieval to decision-making. This enhances the usability of the medical question-and-answer system in clinical scenarios and provides doctors with immediate and accurate decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994800A_ABST
    Figure CN120994800A_ABST
Patent Text Reader

Abstract

The invention discloses a medical document slicing and retrieval method and device, equipment and a storage medium, and the method comprises the steps: generating a high-fidelity semantic summary text and a child node of a structured keyword set through a father node containing an original complete paragraph text, and storing the child node to a vector database; storing the semantic summary text and the structured keyword set into a keyword database; and when a user query instruction is received, performing dual-channel retrieval through the vector database and the keyword database, obtaining related target child nodes, extracting target original contents of a target father node from the target child nodes, transmitting the target original contents to the large language model, generating a final answer, and sending the final answer to the user. According to the method, the relevance and accuracy of retrieval results can be remarkably improved, instant and accurate decision support basis is provided for doctors, semantic integrity can be reserved, efficient multi-modal retrieval can be achieved, and the speed and efficiency of medical document slicing and retrieval are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical information processing technology, and in particular to a method, apparatus, device, and storage medium for medical document slicing and retrieval. Background Technology

[0002] Against the backdrop of rapid development in healthcare informatization, medical text data such as clinical documents, medical literature, and electronic medical records are experiencing explosive growth, posing a severe challenge to traditional retrieval methods. Existing technologies generally employ full-text keyword matching or basic semantic vector retrieval, but these have significant drawbacks: On the one hand, medical documents are usually lengthy (average length exceeding 1,000 characters), and direct full-text search results in severe noise interference, making it impossible to accurately locate key medical information (such as drug names, efficacy indicators, and target populations). On the other hand, existing systems lack structured processing for paragraph-level semantic integrity. Keyword matching relies solely on surface term matching, which easily overlooks medical context (such as the difference in efficacy of "aspirin" in different diseases). Pure vector retrieval, on the other hand, cannot ensure the accuracy of professional terms (such as the lack of biomarker naming standards), resulting in low relevance and poor clinical usability of search results.

[0003] Current mainstream Retrieval Augmented Generation (RAG) systems typically employ the following approach during document preprocessing: slide-segmenting long texts using a fixed window (e.g., 512 tokens); Each segment is independently vectorized and stored in a vector database (such as Pinecone, Weaviate, Milvus); when a user queries, the most relevant segment is matched based on vector similarity and fed into a large model to generate an answer.

[0004] The above methods have serious flaws when processing specialized medical literature: Semantic fragmentation: A complete clinical conclusion is truncated. For example, "trastuzumab can prolong progression-free survival (PFS) in human epidermal growth factor receptor 2 (HER2) positive patients" is split into two parts, resulting in semantic incompleteness.

[0005] Lack of contextual anchors: The search returns isolated fragments, and doctors cannot determine the source chapter, level of evidence, or research background.

[0006] Keyword retrieval is disconnected from vector retrieval: the vector library only supports semantic matching and cannot efficiently support "precise term search", such as "Combined Positive Score (CPS) ≥10" or "Level II recommendation".

[0007] Incomplete input fragment information can lead to errors in the generation of large models or over-inference. Summary of the Invention

[0008] The main objective of this invention is to provide a medical document slicing and retrieval method, apparatus, device, and storage medium. It aims to solve the technical problems in the prior art where direct full-text retrieval leads to severe noise interference and makes it impossible to accurately locate key medical information, while pure vector retrieval is difficult to ensure the accuracy of professional terminology, resulting in low relevance and poor clinical usability of retrieval results. Furthermore, it suffers from semantic fragmentation, lack of contextual anchors, and disconnect between keyword retrieval and vector retrieval when processing professional medical literature, which affects the inference quality of large models.

[0009] In a first aspect, the present invention provides a method for slicing and retrieving medical documents, the method comprising the following steps: Based on the medical document to be identified, construct a child node containing semantic summary text and a set of structured keywords, and a parent node containing the original content of the medical document to be identified; The child nodes are stored in a vector database, and the semantic summary text and the structured keyword set are stored in a keyword database. Upon receiving a user query command, a dual-channel retrieval is performed using the vector database and the keyword database to obtain relevant target child nodes. The original target content of the target parent node is then extracted from the target child nodes and transmitted to the large language model to generate the final answer.

[0010] Optionally, the step of constructing a child node containing semantic summary text and a set of structured keywords, and a parent node containing the original content of the medical document to be identified, includes: A large language model is used to generate semantically complete medical document paragraph units in the medical document to be identified, and semantic summary text is obtained. A set of structured keywords is extracted from the semantic summary text. Construct child nodes containing semantic summary text and a set of structured keywords, and parent nodes containing the original content of the medical document paragraph units.

[0011] Optionally, storing the child nodes in a vector database and storing the semantic summary text and the structured keyword set in a keyword database includes: Store the vector representation of the child nodes in the Milvus vector database; The semantic summary text and the original content of the structured keyword set are stored in the Elasticsearch keyword database, and the Elasticsearch keyword database is matched using structured field indexes.

[0012] Optionally, upon receiving a user query instruction, the step of performing a dual-channel retrieval through the vector database and the keyword database to obtain relevant target child nodes, extracting the original target content of the target parent node from the target child nodes, and transmitting the original target content to the large language model to generate the final answer includes: Upon receiving a user query command, the vector database and the keyword database are invoked simultaneously to obtain candidate child nodes with semantic relevance and term matching degree through dual-channel retrieval in parallel. The candidate child nodes are sorted according to the semantic relevance to select the target child node; Extract the corresponding target parent node from the target child node, obtain the original medical document paragraph of the target parent node, and use the original medical document paragraph as the target original content; The original target content is transmitted to a large language model to generate the final answer.

[0013] Optionally, upon receiving a user query instruction, the step of simultaneously invoking the vector database and the keyword database, and obtaining candidate child nodes with semantic relevance and term matching degree through dual-channel retrieval in parallel, includes: Upon receiving a user's query instruction, the vector database is invoked to vectorize the semantic summary text using a fine-tuned Sentence-BERT model, and an approximate nearest neighbor search is performed to obtain initial retrieval results. The keyword database is invoked to perform term matching through structured field indexing, and candidate child nodes with semantic relevance and term matching degree are obtained from the initial search results.

[0014] Optionally, the step of transmitting the original target content to a large language model to generate the final answer includes: The original target content is used as the input sequence and transmitted to the large language model; Based on preset prompts and engineering instructions, the large language model is controlled to perform a deep reading comprehension task on the target original content, generating a structured final answer that conforms to the clinical scenario.

[0015] Optionally, the step of controlling the large language model to perform a deep reading comprehension task on the target original content according to preset prompting engineering instructions, and generating a structured final answer that conforms to the clinical scenario, includes: Obtain the drug name, target population, efficacy indicators, and statistical values ​​to be retained from the preset prompt engineering instructions; Based on the drug name, the target population, the efficacy indicators, and the statistical values, the large language model is controlled to perform a deep reading comprehension task on the information using standardized terminology in the original target content, without adding information not mentioned in the original text, and generates a structured final answer that conforms to the clinical scenario through the structured output module.

[0016] Secondly, to achieve the above objectives, the present invention also proposes a medical document slicing and retrieval device, the medical document slicing and retrieval device comprising: The parent-child node construction module is used to construct child nodes containing semantic summary text and a set of structured keywords, and parent nodes containing the original content of the medical document to be identified, based on the medical document to be identified. The storage module is used to store the child nodes in a vector database and to store the semantic summary text and the structured keyword set in a keyword database. The retrieval and answer module is used to perform a dual-channel retrieval through the vector database and the keyword database when a user query instruction is received, obtain relevant target child nodes, extract the target original content of the target parent node from the target child nodes, transmit the target original content to the large language model, and generate the final answer.

[0017] Thirdly, to achieve the above objectives, the present invention also proposes a medical document slicing and retrieval device, the medical document slicing and retrieval device comprising: a memory, a processor, and a medical document slicing and retrieval program stored in the memory and executable on the processor, the medical document slicing and retrieval program being configured to implement the steps of the medical document slicing and retrieval method as described above.

[0018] Fourthly, to achieve the above objectives, the present invention also proposes a storage medium storing medical document slices and a retrieval program, wherein when the medical document slices and retrieval program is executed by a processor, the steps of the medical document slice and retrieval method described above are implemented.

[0019] The medical document slicing and retrieval method proposed in this invention constructs child nodes containing semantic summary text and a set of structured keywords, and parent nodes containing the original content of the medical document to be identified, based on the medical document to be identified. The child nodes are stored in a vector database, and the semantic summary text and the set of structured keywords are stored in a keyword database. Upon receiving a user query command, a dual-channel retrieval is performed through the vector database and the keyword database to obtain relevant target child nodes. The target original content of the target parent node is extracted from the target child nodes and transmitted to a large language model to generate the final answer. This significantly improves the relevance and accuracy of the retrieval results. It avoids the information loss caused by the direct reliance on semantic summaries in traditional RAG solutions. The generated structured answer strictly follows clinical norms, achieving seamless integration from retrieval to decision-making. This enhances the usability of the medical question-and-answer system in clinical scenarios, providing doctors with immediate and accurate decision support. It preserves semantic integrity while achieving efficient multimodal retrieval, improving the speed and efficiency of medical document slicing and retrieval. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention; Figure 2 This is a flowchart illustrating the first embodiment of the medical document slicing and retrieval method of the present invention; Figure 3 This is a schematic diagram of the parent-child node answer generation process in the medical document slicing and retrieval method of the present invention; Figure 4 This is a flowchart illustrating the second embodiment of the medical document slicing and retrieval method of the present invention; Figure 5 This is a flowchart illustrating the third embodiment of the medical document slicing and retrieval method of the present invention; Figure 6 This is a flowchart illustrating the fourth embodiment of the medical document slicing and retrieval method of the present invention; Figure 7 This is a functional block diagram of the first embodiment of the medical document slicing and retrieval device of the present invention.

[0021] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0022] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0023] The solution of this invention mainly involves: constructing child nodes containing semantic summary text and a set of structured keywords based on the medical document to be identified, and a parent node containing the original content of the medical document to be identified; storing the child nodes in a vector database, and storing the semantic summary text and the set of structured keywords in a keyword database; upon receiving a user query instruction, performing a dual-channel retrieval through the vector database and the keyword database to obtain relevant target child nodes, extracting the target original content of the target parent node from the target child nodes, and transmitting the target original content to a large language model to generate the final answer, which can significantly improve the relevance and accuracy of the retrieval results; and avoiding the direct reliance on semantics in traditional RAG solutions. The system addresses information loss caused by data loss and generates structured answers that strictly adhere to clinical guidelines, achieving a seamless transition from retrieval to decision-making. This enhances the usability of the medical question-and-answer system in clinical scenarios, providing doctors with immediate and accurate decision support. It preserves semantic integrity while enabling efficient multimodal retrieval, improving the speed and efficiency of medical document slicing and retrieval. It resolves the technical issues in existing technologies where direct full-text retrieval leads to severe noise interference, making it impossible to accurately locate key medical information, while pure vector retrieval struggles to ensure the accuracy of professional terminology, resulting in low relevance and poor clinical usability of search results. Furthermore, it addresses the semantic fragmentation, lack of contextual anchors, and disconnect between keyword retrieval and vector retrieval when processing professional medical literature, all of which negatively impact the quality of large-scale model inference.

[0024] Reference Figure 1 , Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention.

[0025] like Figure 1 As shown, the device may include: a processor 1001, such as a CPU; a communication bus 1002; a user interface 1003; a network interface 1004; and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0026] Those skilled in the art will understand that Figure 1The device structure shown does not constitute a limitation on the device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0027] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating device, a network communication module, a user interface module, and a medical document slicing and retrieval program.

[0028] The device of the present invention calls the medical document slices and retrieval program stored in the memory 1005 through the processor 1001, and performs the following operations: Based on the medical document to be identified, construct a child node containing semantic summary text and a set of structured keywords, and a parent node containing the original content of the medical document to be identified; The child nodes are stored in a vector database, and the semantic summary text and the structured keyword set are stored in a keyword database. Upon receiving a user query command, a dual-channel retrieval is performed using the vector database and the keyword database to obtain relevant target child nodes. The original target content of the target parent node is then extracted from the target child nodes and transmitted to the large language model to generate the final answer.

[0029] The device of the present invention, through processor 1001, calls the medical document slices and retrieval program stored in memory 1005, and also performs the following operations: A large language model is used to generate semantically complete medical document paragraph units in the medical document to be identified, and semantic summary text is obtained. A set of structured keywords is extracted from the semantic summary text. Construct child nodes containing semantic summary text and a set of structured keywords, and parent nodes containing the original content of the medical document paragraph units.

[0030] The device of the present invention, through processor 1001, calls the medical document slices and retrieval program stored in memory 1005, and also performs the following operations: Store the vector representation of the child nodes in the Milvus vector database; The semantic summary text and the original content of the structured keyword set are stored in the Elasticsearch keyword database, and the Elasticsearch keyword database is matched using structured field indexes.

[0031] The device of the present invention, through processor 1001, calls the medical document slices and retrieval program stored in memory 1005, and also performs the following operations: Upon receiving a user query command, the vector database and the keyword database are invoked simultaneously to obtain candidate child nodes with semantic relevance and term matching degree through dual-channel retrieval in parallel. The candidate child nodes are sorted according to the semantic relevance to select the target child node; Extract the corresponding target parent node from the target child node, obtain the original medical document paragraph of the target parent node, and use the original medical document paragraph as the target original content; The original target content is transmitted to a large language model to generate the final answer.

[0032] The device of the present invention, through processor 1001, calls the medical document slices and retrieval program stored in memory 1005, and also performs the following operations: Upon receiving a user's query instruction, the vector database is invoked to vectorize the semantic summary text using a fine-tuned Sentence-BERT model, and an approximate nearest neighbor search is performed to obtain initial retrieval results. The keyword database is invoked to perform term matching through structured field indexing, and candidate child nodes with semantic relevance and term matching degree are obtained from the initial search results.

[0033] The device of the present invention, through processor 1001, calls the medical document slices and retrieval program stored in memory 1005, and also performs the following operations: The original target content is used as the input sequence and transmitted to the large language model; Based on preset prompts and engineering instructions, the large language model is controlled to perform a deep reading comprehension task on the target original content, generating a structured final answer that conforms to the clinical scenario.

[0034] The device of the present invention, through processor 1001, calls the medical document slices and retrieval program stored in memory 1005, and also performs the following operations: Obtain the drug name, target population, efficacy indicators, and statistical values ​​to be retained from the preset prompt engineering instructions; Based on the drug name, the target population, the efficacy indicators, and the statistical values, the large language model is controlled to perform a deep reading comprehension task on the information using standardized terminology in the original target content, without adding information not mentioned in the original text, and generates a structured final answer that conforms to the clinical scenario through the structured output module.

[0035] This embodiment, through the above-described scheme, constructs child nodes containing semantic summary text and a set of structured keywords based on the medical document to be identified, and a parent node containing the original content of the medical document to be identified; stores the child nodes in a vector database, and stores the semantic summary text and the set of structured keywords in a keyword database; upon receiving a user query command, it performs a dual-channel retrieval through the vector database and the keyword database to obtain relevant target child nodes, extracts the target original content of the target parent node from the target child nodes, and transmits the target original content to the large language model to generate the final answer, which can significantly improve the relevance and accuracy of the retrieval results; avoids the information loss caused by the direct reliance on semantic summaries in traditional RAG schemes, and the generated structured answer strictly follows clinical norms, achieving seamless connection from retrieval to decision-making, improving the usability of the medical question-and-answer system in clinical scenarios, providing doctors with immediate and accurate decision support, preserving semantic integrity while achieving efficient multimodal retrieval, and improving the speed and efficiency of medical document slicing and retrieval.

[0036] Based on the above hardware structure, an embodiment of the medical document slicing and retrieval method of the present invention is proposed.

[0037] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the medical document slicing and retrieval method of the present invention.

[0038] In the first embodiment, the medical document slicing and retrieval method includes the following steps: Step S10: Construct a child node containing semantic summary text and a set of structured keywords, and a parent node containing the original content of the medical document to be identified, based on the medical document to be identified.

[0039] It should be noted that, based on the medical document to be identified, semantic summary text and structured keyword set can be constructed as child nodes, and the original content of the medical document to be identified can be constructed as parent nodes. This enables hierarchical storage of documents and provides a foundation for dual-channel retrieval and deep contextual understanding.

[0040] Step S20: Store the child nodes in the vector database, and store the semantic summary text and the structured keyword set in the keyword database.

[0041] It should be understood that storing the semantic vectors of child nodes in a vector database to support semantic similarity retrieval, while storing the semantic summary text and structured keyword set in a keyword database to support accurate term matching, can achieve synergistic optimization of dual-channel retrieval.

[0042] Step S30: Upon receiving a user query instruction, perform a dual-channel retrieval using the vector database and the keyword database to obtain relevant target child nodes, extract the original target content of the target parent node from the target child nodes, and transmit the original target content to the large language model to generate the final answer.

[0043] It is understandable that when a user query command is received, the relevant child nodes can be obtained through parallel retrieval of the vector database and the keyword database. Then, the original content of the target parent node is extracted from the target child node, that is, the original content of its parent node is extracted and transmitted to the large language model to generate an accurate answer that conforms to clinical standards.

[0044] In the specific implementation, see Figure 3 , Figure 3 This is a schematic diagram of the parent-child node answer generation process in the medical document slicing and retrieval method of the present invention, as shown below. Figure 3 As shown, the process involves: Step 0001, creating a parent node containing the original complete paragraph text; Step 0002, generating child nodes containing high-fidelity semantic summary text and a set of structured keywords; Step 0003, storing the child nodes in a vector database; Step 0004, storing the semantic summary text and the set of structured keywords in a keyword database; Step 0005, when a user issues a query, performing a dual-channel retrieval through the vector database and the keyword database; Step 0006, obtaining relevant target child nodes, extracting the original target content from the target parent node from the target child nodes, transmitting the original target content to the large language model, and generating the final answer.

[0045] This embodiment, through the above-described scheme, constructs child nodes containing semantic summary text and a set of structured keywords based on the medical document to be identified, and a parent node containing the original content of the medical document to be identified; stores the child nodes in a vector database, and stores the semantic summary text and the set of structured keywords in a keyword database; upon receiving a user query command, it performs a dual-channel retrieval through the vector database and the keyword database to obtain relevant target child nodes, extracts the target original content of the target parent node from the target child nodes, and transmits the target original content to the large language model to generate the final answer, which can significantly improve the relevance and accuracy of the retrieval results; avoids the information loss caused by the direct reliance on semantic summaries in traditional RAG schemes, and the generated structured answer strictly follows clinical norms, achieving seamless connection from retrieval to decision-making, improving the usability of the medical question-and-answer system in clinical scenarios, providing doctors with immediate and accurate decision support, preserving semantic integrity while achieving efficient multimodal retrieval, and improving the speed and efficiency of medical document slicing and retrieval.

[0046] Furthermore, Figure 4This is a flowchart illustrating the second embodiment of the medical document slicing and retrieval method of the present invention, as shown below. Figure 4 As shown, based on the first embodiment, a second embodiment of the medical document slicing and retrieval method of the present invention is proposed. In this embodiment, step S10 specifically includes the following steps: Step S11: Use a large language model to generate semantically complete medical document paragraph units in the medical document to be identified, obtain semantic summary text, and extract a set of structured keywords from the semantic summary text.

[0047] It should be noted that the large language model is used to automatically identify semantically complete paragraph units in medical documents, generate concise semantic summary text (e.g., length ≤ 80 characters), and extract a structured set of keywords from it.

[0048] In the specific implementation, the semantically complete paragraph recognition and preprocessing process is as follows: Input the original medical document (PDF / HTML / DOCX format); Using natural language processing tools (such as spaCy and LayoutParser) combined with a rule engine, semantically complete paragraph units are identified, such as: a complete clinical study description, a recommendation from an NCCN guideline, or a description of the indications for a drug. Each paragraph should be independently comprehensible and generally 200-600 characters in length; Example paragraph: "In the KEYNOTE-811 study, pembrolizumab combined with trastuzumab plus chemotherapy was used as first-line treatment for HER2-positive advanced gastric cancer, significantly improving the objective response rate (ORR 74.4% vs 51.9%), with manageable safety." Step S12: Construct a child node containing semantic summary text and a set of structured keywords, and a parent node containing the original content of the medical document paragraph unit.

[0049] It should be understood that dividing the semantically complete paragraph units of medical documents into child nodes (storing semantic summary text and structured keyword sets generated by large language models) and parent nodes (storing the original document content) enables hierarchical storage of documents to support efficient retrieval and deep contextual understanding.

[0050] In the specific implementation, a hierarchical parent-child node structure can be constructed. The child nodes store the semantically complete summary text (no more than 80 characters in length) generated by the large language model and the extracted set of structured keywords (covering diseases, drugs, biomarkers, population characteristics, and efficacy indicators) to support efficient semantic retrieval. The parent nodes completely retain the original content of the corresponding medical document paragraph units (200-600 characters in length), ensuring that after obtaining the relevant child nodes through dual-channel retrieval, the context can be quickly retrieved for in-depth reading comprehension, thereby generating an accurate final answer.

[0051] In practical implementation, large-model-driven semantic summarization and keyword extraction Perform the following operations on each semantically complete paragraph: (1) Semantic summary generation Perform hinting engineering using large language models (such as Qwen-Max, Claude3, GPT-4): You are an oncology expert. Please condense the following medical paragraphs into a concluding sentence that is semantically complete, logically clear, and retains key information, with a maximum length of 8. Require: -Retain drug name, target population, efficacy indicators, and statistical values; - Use standard terminology; - Do not add information not mentioned in the original text; Original text: [Enter paragraph] Output: Semantic complete summary text Example output: "Pembrolizumab combined with chemotherapy significantly improved the ORR to 74.4% in patients with HER2-positive gastric cancer, which was superior to the control group."

[0052] (2) Keyword set extraction Extracting a set of structured keywords using LLM: Please extract the most important medical entities and concepts from the following paragraphs and categorize them for output: -disease:... -drug:... -Biomarkers: ... -Population characteristics:... -Therapeutic indicators: ... Original text: [Enter paragraph] Output: A structured set of keywords (KeyConcepts) Example output: Disease: Stomach cancer Drugs: Pembrolizumab, Trastuzumab, Chemotherapy; Biomarker: HER2 positive Population characteristics: advanced stage, first-line treatment. Efficacy indicators: ORR, safety. Step 3: Construct and store the parent-child node structure. Define a two-level node structure:

[0053] Storage strategy: 1. Vectorization and Vector Library Writing (Milvus) The summary text of the child nodes is vectorized using the fine-tuned Sentence-BERT model; the vectors are then stored in Milvus. The following fields will also be stored as scalar fields: Summary_texte: Summary text keywords+: A collection of keywords (in JSON format) parent.content: The original paragraph (complete text) of the parent node. Meta-information such as sourcedocidd, section, and evidencelevel. 2. Keyword Index Building (Elasticsearch) Import summary_text and keywords+ into Elasticsearch; Create full-text indexes and structured field indexes (such as drug.kevword+, biomarker.keyword+); It supports both "precise terminology search" and "fuzzy semantic retrieval" modes.

[0054] This embodiment utilizes the above-described scheme to generate semantically complete medical document paragraph units from the medical documents to be identified using a large language model, thereby obtaining semantic summary text. A structured keyword set is then extracted from this semantic summary text. Sub-nodes containing the semantic summary text and the structured keyword set, and parent nodes containing the original content of the medical document paragraph units, are constructed. This effectively eliminates semantic noise in traditional full-text retrieval, ensures the contextual relevance of semantic retrieval and the terminology accuracy of keyword retrieval, provides a high-quality data foundation for subsequent dual-channel retrieval, and improves the key information recall rate and accurate matching degree of the medical question-and-answer system in clinical scenarios.

[0055] Furthermore, Figure 5 This is a flowchart illustrating the third embodiment of the medical document slicing and retrieval method of the present invention, as shown below. Figure 5 As shown, based on the first embodiment, a third embodiment of the medical document slicing and retrieval method of the present invention is proposed. In this embodiment, step S20 specifically includes the following steps: Step S21: Store the vector representation of the child node in the Milvus vector database.

[0056] It should be noted that the vector representations of child nodes (including semantic summary text and structured keyword sets generated by the large language model) are stored in the Milvus vector database to support semantic similarity approximate nearest neighbor search based on the Sentence-BERT fine-tuning model.

[0057] Step S22: Store the original content of the semantic summary text and the structured keyword set in the Elasticsearch keyword database, and match the Elasticsearch keyword database using the structured field index.

[0058] Understandably, storing the original content of semantic summary text (strictly limited to ≤80 characters) and structured keyword set (covering classification information such as diseases, drugs, biomarkers, population characteristics and efficacy indicators) in the Elasticsearch keyword database, and achieving accurate term matching through structured field indexing, allows for the simultaneous acquisition of efficient results of semantic relevance and keyword matching in dual-channel retrieval.

[0059] This embodiment, through the above-described scheme, stores the vector representation of the child nodes in the Milvus vector database; stores the original content of the semantic summary text and the structured keyword set in the Elasticsearch keyword database, and matches the Elasticsearch keyword database through structured field indexing; effectively bridging the gap between the semantic ambiguity of traditional vector retrieval and the terminology accuracy of keyword retrieval, significantly improving the system's ability to capture key medical information and the reliability of decision support.

[0060] Furthermore, Figure 6 This is a flowchart illustrating the fourth embodiment of the medical document slicing and retrieval method of the present invention, as shown below. Figure 6 As shown, based on the first embodiment, a fourth embodiment of the medical document slicing and retrieval method of the present invention is proposed. In this embodiment, step S30 specifically includes the following steps: Step S31: After receiving the user's query instruction, the vector database and the keyword database are called simultaneously, and candidate child nodes with semantic relevance and term matching degree are obtained in parallel through dual-channel retrieval.

[0061] It should be noted that after receiving a user's query command, the system can simultaneously call the vector database (to perform semantic similarity retrieval) and the keyword database (to perform precise term matching), and efficiently obtain a set of candidate child nodes that simultaneously satisfy semantic relevance and term matching through a dual-channel parallel mechanism.

[0062] Furthermore, step S31 specifically includes the following steps: Upon receiving a user's query instruction, the vector database is invoked to vectorize the semantic summary text using a fine-tuned Sentence-BERT model, and an approximate nearest neighbor search is performed to obtain initial retrieval results. The keyword database is invoked to perform term matching through structured field indexing, and candidate child nodes with semantic relevance and term matching degree are obtained from the initial search results.

[0063] It should be understood that after receiving a user's query command, the system synchronously calls the Milvus vector database (which performs semantic similarity approximate nearest neighbor search based on a fine-tuned Sentence-BERT model) and the Elasticsearch keyword database (which achieves accurate matching of keywords such as diseases, drugs, and biomarkers based on structured field indexes) to obtain candidate child nodes with semantic relevance and term matching degree in parallel through dual-channel retrieval.

[0064] Step S32: Sort the candidate child nodes according to the semantic relevance and filter out the target child nodes.

[0065] It is understood that the candidate child nodes can be sorted according to the semantic relevance, thereby selecting the target child node.

[0066] Step S33: Extract the corresponding target parent node from the target child node, obtain the original medical document paragraph of the target parent node, and use the original medical document paragraph as the target original content.

[0067] It should be understood that the corresponding parent node can be extracted from the target child node, thereby obtaining the original medical document paragraph of the target parent node, and using the original medical document paragraph as the target original content for subsequent deep reading comprehension of the large language model.

[0068] Step S34: Transmit the original target content to the large language model to generate the final answer.

[0069] Understandably, after inputting the original target content into a large language model, the large language model can generate a structured, accurate, and clinically relevant final answer.

[0070] Furthermore, step S34 specifically includes the following steps: The original target content is used as the input sequence and transmitted to the large language model; Based on preset prompts and engineering instructions, the large language model is controlled to perform a deep reading comprehension task on the target original content, generating a structured final answer that conforms to the clinical scenario.

[0071] It should be noted that the target original content (i.e., medical document paragraph units, strictly limited to 200-600 characters in length) is used as the input sequence and transmitted to a large language model (such as Claude 3 or GPT-4). Based on preset prompting engineering instructions (requiring the model to strictly retain core information such as drug names, target populations, efficacy indicators and statistical values, use standardized medical terminology, and prohibit the addition of content not mentioned in the original text), a deep reading comprehension task is performed to generate a structured, accurate, and clinically relevant final answer, ensuring that the output content can be directly used for medical decision support. Further, the steps described above, which control the large language model to perform a deep reading comprehension task on the target original content according to preset prompting engineering instructions to generate a structured and clinically relevant final answer, specifically include the following steps: Obtain the drug name, target population, efficacy indicators, and statistical values ​​to be retained from the preset prompt engineering instructions; Based on the drug name, the target population, the efficacy indicators, and the statistical values, the large language model is controlled to perform a deep reading comprehension task on the information using standardized terminology in the original target content, without adding information not mentioned in the original text, and generates a structured final answer that conforms to the clinical scenario through the structured output module.

[0072] Understandably, based on preset engineering instructions (strictly limiting the model to retain only core information such as drug name, target population, efficacy indicators and statistical values, mandating the use of ICD-11 / ATC standardized medical terminology, and prohibiting the addition of content not mentioned in the original text), the system controls a large language model (such as GPT-4) to perform a deep reading comprehension task on the target original content (medical document paragraph units of 200~600 characters). Through structured output templates (such as JSON format containing "drug-population-efficacy" triples), it generates accurate and unambiguous clinical decision support answers, ensuring that the output content fully complies with medical standards and can be directly embedded into the electronic medical record system.

[0073] In the actual implementation, when a user initiates a query, the following process is executed: 1. Query rewriting and expansion Standardize user input terms and complete abbreviations (e.g., "immunotherapy drugs" → "PD-1 inhibitors"). 2. Dual-channel retrieval Channel 1: Vector Search (Milvus) Vectorize queries using a fine-tuned recall model; Perform an approximate nearest neighbor (ANN) search in Milvus and return the Top-K child nodes; Each result carries metadata such as parentcontent.

[0074] Channel Two: Keyword Search (Elasticsearch) Use keyword matching (e.g., +biomarker:"HER2 positive") or Boolean query filtering; Return the IDs of the child nodes that meet the criteria, and then retrieve the vector and the content of the parent node from Milvus.

[0075] 3. Results fusion and reordering Merge vector and keyword search results; The candidate paragraphs are scored for relevance using a ranking model (Re-Ranker); the final ranked list is then output.

[0076] 4. Large-scale reading comprehension The original paragraph of the parent node for each candidate result (rather than just the child node summary) is fed into the large language model; example prompt words: Please answer user questions based on the following authoritative medical literature: [Original text] {parent_content} [User Issue] {query} Please answer based solely on the above information; do not speculate.

[0077] 5. Generate the final answer The large model generates accurate and traceable answers based on complete context; the system also returns the source paragraph and the level of evidence to enhance credibility.

[0078] Scenario: Processing according to CSCO gastric cancer diagnosis and treatment guidelines 1. Input: CSCO 2024 Gastric Cancer Guidelines PDF 2. Semantic paragraph recognition: Identified recommended entries under the section "First-line treatment of HER2-positive advanced gastric cancer". 3. Summary Generation: Original text: "For patients with HER2-positive advanced gastric cancer, pembrolizumab in combination with trastuzumab and chemotherapy is recommended as first-line treatment (Class IA evidence)." In summary: "Pembrolizumab + trastuzumab + chemotherapy is a first-line recommendation for HER2-positive advanced gastric cancer (Class IA evidence)." 4. Keyword extraction: "disease":"stomach cancer". "biomarker":"HER2 positive", "stage":"late stage", "treatmentline":"first line", "drugs":["pembrolizumab","trastuzumab","chemotherapy"], ww "evidencelevel": "IA" 5. Storage: Milvus vector: summary_text vectorization Scalar fields: include parent_content, keywords, etc. ES index: create an index on the keywords field. 6. Search Example: A user asked: "What immunotherapy drugs are used as first-line treatment for HER2-positive gastric cancer?" Vector retrieval hits the child node → returns the original text of the parent node → large model generation: "According to the CSCO guidelines, pembrolizumab is recommended in combination with trastuzumab and chemotherapy...".

[0079] It should be noted that this embodiment achieves a leap from "mechanical segmentation" to "intelligent organization" of medical document slicing through a semantically enhanced parent-child node structure. This not only solves the long-standing problem of "taking things out of context" that has plagued the RAG system, but also improves the system's flexibility and accuracy through a dual-database collaborative retrieval mechanism. This method can be widely applied to high-precision knowledge service scenarios such as oncology, rare diseases, and pharmaceutical consultation, and is one of the key infrastructures for building a trustworthy medical AI system.

[0080] This embodiment, through the above-described scheme, synchronously calls the vector database and the keyword database after receiving a user's query instruction, and obtains candidate child nodes with semantic relevance and term matching degree through dual-channel retrieval in parallel; sorts the candidate child nodes according to semantic relevance, and filters out target child nodes; extracts the corresponding target parent node from the target child node, obtains the original medical document paragraph of the target parent node, and uses the original medical document paragraph as the target original content; transmits the target original content to the large language model to generate the final answer, which can significantly improve the relevance and accuracy of the retrieval results; avoids the information loss caused by the direct reliance on semantic summarization in traditional RAG schemes, and the generated structured answer strictly follows clinical norms, achieving seamless connection from retrieval to decision-making, improving the usability of the medical question-and-answer system in clinical scenarios, providing doctors with immediate and accurate decision support, preserving semantic integrity, and achieving efficient multimodal retrieval, thus improving the speed and efficiency of medical document slicing and retrieval.

[0081] Accordingly, the present invention further provides a medical document slicing and retrieval device.

[0082] Reference Figure 7 , Figure 7 This is a functional block diagram of the first embodiment of the medical document slicing and retrieval device of the present invention.

[0083] In a first embodiment of the medical document slicing and retrieval device of the present invention, the medical document slicing and retrieval device includes: The parent-child node construction module 10 is used to construct child nodes containing semantic summary text and a set of structured keywords, and parent nodes containing the original content of the medical document to be identified, based on the medical document to be identified.

[0084] Storage module 20 is used to store the child nodes to a vector database and to store the semantic summary text and the structured keyword set to a keyword database.

[0085] The retrieval and answer module 30 is used to perform a dual-channel retrieval through the vector database and the keyword database when a user query instruction is received, obtain relevant target child nodes, extract the target original content of the target parent node from the target child nodes, transmit the target original content to the large language model, and generate the final answer.

[0086] The parent-child node construction module 10 is further configured to use a large language model to generate semantically complete medical document paragraph units in the medical document to be identified, obtain semantic summary text, extract a set of structured keywords from the semantic summary text, construct a child node containing the semantic summary text and the set of structured keywords, and a parent node containing the original content of the medical document paragraph unit.

[0087] The storage module 20 is further configured to store the vector representation of the child node in the Milvus vector database; store the original content of the semantic summary text and the structured keyword set in the Elasticsearch keyword database; and match the Elasticsearch keyword database through structured field indexes.

[0088] The retrieval and answer module 30 is further configured to, upon receiving a user query instruction, simultaneously invoke the vector database and the keyword database, and obtain candidate child nodes with semantic relevance and term matching degree through dual-channel retrieval in parallel; sort the candidate child nodes according to the semantic relevance, and filter out target child nodes; extract the corresponding target parent node from the target child node, obtain the original medical document paragraph of the target parent node, and use the original medical document paragraph as the target original content; transmit the target original content to the large language model to generate the final answer.

[0089] The retrieval and response module 30 is further configured to, upon receiving a user query instruction, call the vector database to vectorize the semantic summary text using a fine-tuned Sentence-BERT model and perform an approximate nearest neighbor search to obtain initial retrieval results; call the keyword database to perform term matching using a structured field index and obtain candidate child nodes with semantic relevance and term matching degree from the initial retrieval results.

[0090] The retrieval and answer module 30 is also used to transmit the target original content as an input sequence to the large language model; and control the large language model to perform a deep reading comprehension task on the target original content according to preset prompting engineering instructions, so as to generate a structured final answer that conforms to the clinical scenario.

[0091] The retrieval and answer module 30 is also used to obtain the drug name, target population, efficacy indicators and statistical values ​​to be retained from the preset prompt engineering instructions; based on the drug name, the target population, the efficacy indicators and the statistical values, it controls the large language model to perform a deep reading comprehension task on the information using standardized terminology in the target original content, without adding information not mentioned in the original text, and generates a structured final answer that conforms to the clinical scenario through the structured output module.

[0092] The steps for implementing each functional module of the medical document slicing and retrieval device can be referred to in the various embodiments of the medical document slicing and retrieval method of the present invention, and will not be repeated here.

[0093] Furthermore, embodiments of the present invention also propose a storage medium storing medical document slices and a retrieval program, wherein the medical document slices and the retrieval program, when executed by a processor, perform the following operations: Based on the medical document to be identified, construct a child node containing semantic summary text and a set of structured keywords, and a parent node containing the original content of the medical document to be identified; The child nodes are stored in a vector database, and the semantic summary text and the structured keyword set are stored in a keyword database. Upon receiving a user query command, a dual-channel retrieval is performed using the vector database and the keyword database to obtain relevant target child nodes. The original target content of the target parent node is then extracted from the target child nodes and transmitted to the large language model to generate the final answer.

[0094] Furthermore, when the medical document slicing and retrieval program is executed by the processor, it also performs the following operations: A large language model is used to generate semantically complete medical document paragraph units in the medical document to be identified, and semantic summary text is obtained. A set of structured keywords is extracted from the semantic summary text. Construct child nodes containing semantic summary text and a set of structured keywords, and parent nodes containing the original content of the medical document paragraph units.

[0095] Furthermore, when the medical document slicing and retrieval program is executed by the processor, it also performs the following operations: Store the vector representation of the child nodes in the Milvus vector database; The semantic summary text and the original content of the structured keyword set are stored in the Elasticsearch keyword database, and the Elasticsearch keyword database is matched using structured field indexes.

[0096] Furthermore, when the medical document slicing and retrieval program is executed by the processor, it also performs the following operations: Upon receiving a user query command, the vector database and the keyword database are invoked simultaneously to obtain candidate child nodes with semantic relevance and term matching degree through dual-channel retrieval in parallel. The candidate child nodes are sorted according to the semantic relevance to select the target child node; Extract the corresponding target parent node from the target child node, obtain the original medical document paragraph of the target parent node, and use the original medical document paragraph as the target original content; The original target content is transmitted to a large language model to generate the final answer.

[0097] Furthermore, when the medical document slicing and retrieval program is executed by the processor, it also performs the following operations: Upon receiving a user's query instruction, the vector database is invoked to vectorize the semantic summary text using a fine-tuned Sentence-BERT model, and an approximate nearest neighbor search is performed to obtain initial retrieval results. The keyword database is invoked to perform term matching through structured field indexing, and candidate child nodes with semantic relevance and term matching degree are obtained from the initial search results.

[0098] Furthermore, when the medical document slicing and retrieval program is executed by the processor, it also performs the following operations: The original target content is used as the input sequence and transmitted to the large language model; Based on preset prompts and engineering instructions, the large language model is controlled to perform a deep reading comprehension task on the target original content, generating a structured final answer that conforms to the clinical scenario.

[0099] Furthermore, when the medical document slicing and retrieval program is executed by the processor, it also performs the following operations: Obtain the drug name, target population, efficacy indicators, and statistical values ​​to be retained from the preset prompt engineering instructions; Based on the drug name, the target population, the efficacy indicators, and the statistical values, the large language model is controlled to perform a deep reading comprehension task on the information using standardized terminology in the original target content, without adding information not mentioned in the original text, and generates a structured final answer that conforms to the clinical scenario through the structured output module.

[0100] Those skilled in the art will understand that all or part of the steps in the methods described above can be implemented by a program instructing related hardware. The program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium is a computer-readable storage medium, including: USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other media that can store program code.

[0101] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0102] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0103] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for slicing and retrieving medical documents, characterized in that, The medical document slicing and retrieval method includes: Based on the medical document to be identified, construct a child node containing semantic summary text and a set of structured keywords, and a parent node containing the original content of the medical document to be identified; The child nodes are stored in a vector database, and the semantic summary text and the structured keyword set are stored in a keyword database. Upon receiving a user query command, a dual-channel retrieval is performed using the vector database and the keyword database to obtain relevant target child nodes. The original target content of the target parent node is then extracted from the target child nodes and transmitted to the large language model to generate the final answer.

2. The medical document slicing and retrieval method as described in claim 1, characterized in that, The step of constructing a child node containing semantic summary text and a set of structured keywords based on the medical document to be identified, and a parent node containing the original content of the medical document to be identified, includes: A large language model is used to generate semantically complete medical document paragraph units in the medical document to be identified, and semantic summary text is obtained. A set of structured keywords is extracted from the semantic summary text. Construct child nodes containing semantic summary text and a set of structured keywords, and parent nodes containing the original content of the medical document paragraph units.

3. The medical document slicing and retrieval method as described in claim 1, characterized in that, The step of storing the child nodes in a vector database and storing the semantic summary text and the structured keyword set in a keyword database includes: Store the vector representation of the child nodes in the Milvus vector database; The semantic summary text and the original content of the structured keyword set are stored in the Elasticsearch keyword database, and the Elasticsearch keyword database is matched using structured field indexes.

4. The medical document slicing and retrieval method as described in claim 1, characterized in that, Upon receiving a user query command, the process involves performing a dual-channel retrieval using the vector database and the keyword database to obtain relevant target child nodes, extracting the original target content of the target parent node from the target child nodes, and transmitting the original target content to the large language model to generate the final answer, including: Upon receiving a user query command, the vector database and the keyword database are invoked simultaneously to obtain candidate child nodes with semantic relevance and term matching degree through dual-channel retrieval in parallel. The candidate child nodes are sorted according to the semantic relevance to select the target child node; Extract the corresponding target parent node from the target child node, obtain the original medical document paragraph of the target parent node, and use the original medical document paragraph as the target original content; The original target content is transmitted to a large language model to generate the final answer.

5. The medical document slicing and retrieval method as described in claim 4, characterized in that, Upon receiving a user query command, the process involves simultaneously invoking the vector database and the keyword database, and using a dual-channel retrieval system to obtain candidate child nodes based on semantic relevance and term matching degree in parallel. This includes: Upon receiving a user's query instruction, the vector database is invoked to vectorize the semantic summary text using a fine-tuned Sentence-BERT model, and an approximate nearest neighbor search is performed to obtain initial retrieval results. The keyword database is invoked to perform term matching through structured field indexing, and candidate child nodes with semantic relevance and term matching degree are obtained from the initial search results.

6. The medical document slicing and retrieval method as described in claim 4, characterized in that, The step of transmitting the original target content to a large language model to generate the final answer includes: The original target content is used as the input sequence and transmitted to the large language model; Based on preset prompts and engineering instructions, the large language model is controlled to perform a deep reading comprehension task on the target original content, generating a structured final answer that conforms to the clinical scenario.

7. The medical document slicing and retrieval method as described in claim 5, characterized in that, The step of controlling the large language model to perform a deep reading comprehension task on the target original content according to preset prompts and engineering instructions, and generating a structured final answer that conforms to the clinical scenario, includes: Obtain the drug name, target population, efficacy indicators, and statistical values ​​to be retained from the preset prompt engineering instructions; Based on the drug name, the target population, the efficacy indicators, and the statistical values, the large language model is controlled to perform a deep reading comprehension task on the information using standardized terminology in the original target content, without adding information not mentioned in the original text, and generates a structured final answer that conforms to the clinical scenario through the structured output module.

8. A medical document slicing and retrieval device, characterized in that, The medical document slicing and retrieval device includes: The parent-child node construction module is used to construct child nodes containing semantic summary text and a set of structured keywords, and parent nodes containing the original content of the medical document to be identified, based on the medical document to be identified. The storage module is used to store the child nodes in a vector database and to store the semantic summary text and the structured keyword set in a keyword database. The retrieval and answer module is used to perform a dual-channel retrieval through the vector database and the keyword database when a user query instruction is received, obtain relevant target child nodes, extract the target original content of the target parent node from the target child nodes, transmit the target original content to the large language model, and generate the final answer.

9. A medical document slicing and retrieval device, characterized in that, The medical document slicing and retrieval device includes: a memory, a processor, and a medical document slicing and retrieval program stored in the memory and executable on the processor, wherein the medical document slicing and retrieval program is configured to implement the steps of the medical document slicing and retrieval method as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium stores medical document slices and retrieval programs, which, when executed by a processor, implement the steps of the medical document slice and retrieval method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Medical text mixed retrieval method and system

    CN118363981A

  • RAG storage and retrieval method and device based on graph database

    CN118939782A

  • Contract retrieval enhancement optimization method, equipment and medium

    CN120596647A

  • Enhanced retrieval generation method based on father-child segmentation and multi-source recall

    CN120723894A

  • Rainf integrated battery case top plate assembly structure

    KR102824776B1

Cited By

  • Medical document retrieval enhancement generation method and system based on father-child node structure

    CN122087089A

  • Medical document retrieval method and system based on hierarchical knowledge graph

    CN122087090A

  • A medical document retrieval method and system based on a hierarchical knowledge graph

    CN122087090B