Medical inquiry logic chain generation and verification method and system based on large language model
Patent Information
- Application Number
- CN202511218462.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2045-08-28
AI Technical Summary
然而,现有医学问诊语料的构建模式存在显著局限:一方面,传统依赖人工标注的方式不仅耗时费力、成本高昂,且受标注人员专业背景差异影响,易导致语料标准不一,难以形成规模化、规范化的数据集;另一方面,虽有研究尝试通过自然语言处理(Natural Language Processing,NLP)技术自动生成语料,但因缺乏结构化逻辑框架的指导,生成内容常出现逻辑混乱、医学知识错误等问题,无法满足专业问诊场景对语料结构化的要求
1)提升医学问诊语料质量,通过构建结构化的逻辑链生成规则及多维度一致性验证机制,有效过滤语料中存在的逻辑断层、信息冗余或表述歧义等问题,确保语料能完整映射真实问诊场景中的病情问询、症状描述、诊断推理及诊疗建议等核心环节,显著提升语料的完整性、准确性和场景适配性。
Smart Images

Figure CN121029942B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to a method and system for generating and verifying medical consultation logic chains based on a large language model. Background Technology
[0002] With the deep penetration of artificial intelligence (AI) technology into the healthcare field, intelligent medical dialogue systems, as important carriers for assisted diagnosis and health management, directly depend on the quality of the underlying professional medical consultation datasets for their performance. High-quality medical consultation corpora can provide rich knowledge support for AI Large Language Models (LLMs), significantly improving the model's accuracy in identifying symptoms, the logic of diagnostic reasoning, and its adaptability to different scenarios. This is a core foundation for promoting the practical application of intelligent medical technologies. However, existing methods for constructing medical consultation corpora have significant limitations: on the one hand, traditional methods relying on manual annotation are not only time-consuming, labor-intensive, and costly, but also prone to inconsistent corpus standards due to differences in the professional backgrounds of annotators, making it difficult to form large-scale, standardized datasets; on the other hand, although some studies have attempted to automatically generate corpora using Natural Language Processing (NLP) technology, the lack of a structured logical framework often results in logical inconsistencies and errors in medical knowledge, failing to meet the structured requirements of professional consultation scenarios.
[0003] In recent years, large language models have shown broad application prospects in the medical field due to their powerful natural language generation capabilities. However, their output in medical consultation scenarios still has obvious defects: semantic redundancy and logical jumps are prone to occur in the generation. Moreover, due to insufficient deep understanding of medical professional knowledge, it is often accompanied by errors in professional concepts. At present, there is no perfect mechanism to ensure that its generated results conform to the logical rules of real medical consultation, which limits its reliable application in medical scenarios.
[0004] As a highly structured professional interactive process, medical consultation requires its corpus to strictly follow a progressive logical chain of "chief complaint - present illness - past medical history - family history - physical examination - medical diagnosis - treatment recommendations". Each logical node must meet the requirements of semantic coherence, clear causal relationship, and consistency of medical knowledge. For example, "present illness" must be directly related to "chief complaint", and "diagnosis" must be derived from information such as "physical examination" and "past medical history". Any logical break or knowledge conflict in any link may lead to diagnostic errors. The shortcomings of existing technologies in the aforementioned areas are specifically manifested in the following ways: First, there is a lack of a specialized generation framework for the logical chain structure of medical consultations, making it impossible to systematically generate structured corpora that conform to complete logical chains, or only able to generate fragmented content, which is insufficient to support the model in training complete diagnostic reasoning. Second, no effective verification method has been established for the logical consistency and medical rationality of the generated corpora, making it impossible to verify core dimensions such as "matching of symptoms and diagnoses" and "adaptability of treatment suggestions to symptoms," leading to doubts about the reliability of the generated corpora. Third, there is a lack of a general and efficient modeling and evaluation mechanism for the structure of medical consultation corpora, making it difficult to quantitatively evaluate and iteratively optimize the quality of the corpora, thus restricting the continuous upgrading of the dataset.
[0005] In medical consultation scenarios based on large language models, the aforementioned technical deficiencies directly lead to non-standard logical chains and a lack of consistency in the generated corpora. This, in turn, exposes models trained on such corpora to the risk of misdiagnosis, severely impacting the reliability of intelligent medical dialogue systems. Therefore, it is urgent to construct a professional logical chain generation method and consistency verification mechanism specifically for medical consultation corpora to overcome existing technical bottlenecks, provide high-quality corpus support for intelligent medical dialogue systems, and ensure the professionalism and security of the consultation process. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for generating and verifying medical consultation logic chains based on a large language model.
[0007] The objective of this invention is achieved through the following technical solution: In a first aspect, this invention discloses a method for generating and verifying medical consultation logic chains based on a large language model, including: S1. Generate a logical chain framework and construct a medical consultation logical chain generation model. The model uses a large language model as the core engine and embeds structured logical templates and professional knowledge constraints. The logical template includes hierarchical nodes based on the standard medical consultation process. The hierarchical nodes include chief complaint, present illness, past medical history, family history, physical examination, medical diagnosis, and treatment suggestions. Each node is associated with a medical knowledge graph, which includes symptom terms, disease codes, and treatment guidelines. S2. Design a two-dimensional, multi-level verification framework to automatically verify the consistency and medical rationality of the generated corpus logical chain. S3. Design an evaluation index system and dynamic optimization strategy. Classify and label the problematic data identified in the verification. Simple logical contradictions or expression errors are automatically corrected by the algorithm. Complex medical knowledge deviations trigger medical experts to review and correct them. Feedback the correction results to the model training stage, update the prompt engineering and model parameters, and optimize the logic chain generation rules.
[0008] Based on the first aspect, step S1 employs a multi-stage guided generation strategy to generate the logical chain framework, specifically including the following steps: S11. Node initialization: The logical chain node framework is input into the large language model through prompting engineering, clarifying the medical definition and content boundaries of each node. S12. Knowledge anchoring: At each node generation stage, the medical knowledge graph is called to perform entity verification to ensure that the disease names, symptom descriptions and examination items in the generated content conform to the professional terminology standards. S13. Logical progression control: Through a cross-node attention mechanism, the large language model is forced to associate key information of the preceding node when generating subsequent nodes, thus avoiding logical jumps. S14. Redundancy pruning: Integrating a semantic compression module to remove redundant descriptions in the generated content that are irrelevant to the current node, thereby enhancing the structured features of the corpus.
[0009] Based on the first aspect, the dual-dimensional, multi-level verification described in step S2 includes logical structure verification and medical knowledge verification, specifically including the following steps: S21. Logical structure verification: A graph structure matching algorithm is used to map the generated corpus logical chain into a node-relationship graph. The graph is compared with the preset standard logical chain topology to identify missing nodes or incorrect connections. The semantic coherence across nodes is verified through the Natural Language Inference (NLI) model. The semantic similarity and causal correlation between adjacent nodes are calculated to filter out logically broken content. S22. Medical knowledge verification: Construct a professional knowledge base retrieval interface to perform knowledge matching on the diagnostic conclusions and treatment suggestions in the generated content, and verify their medical relevance to the symptom description; introduce a discriminant model pre-trained by domain experts to perform error detection on key information, including drug contraindications and examination indications.
[0010] Based on the first aspect, the evaluation index system mentioned in step S3 includes the design of quantitative indicators, which include logical completeness, semantic consistency, knowledge accuracy, and redundancy.
[0011] Based on the first aspect, the dynamic optimization strategy described in step S3 includes: adjusting the generation parameters of the large language model or supplementing the content of the professional knowledge graph based on the evaluation results, and generating secondary corpora that do not meet the preset target quality.
[0012] Secondly, this invention discloses a medical consultation logic chain generation and verification system based on a large language model, used in the aforementioned medical consultation logic chain generation and verification method based on a large language model, comprising: The corpus logic chain template construction module is used to build standardized logic chain templates based on clinical diagnosis and treatment pathways and consultation standards; and to form reusable structured frameworks for different disease types. The corpus generation module utilizes a pre-trained large language model and imports logical chain templates and disease domain knowledge through prompting engineering. The corpus structure annotation module uses natural language processing tools to perform word segmentation and syntactic analysis on the generated continuous text corpus; according to the link definition in the logical chain template, it assigns corresponding structural tags to each consultation segment; then the annotated corpus is stored in a structured database for subsequent retrieval. The multi-dimensional consistency verification module verifies semantic consistency through Natural Language Inference (NLI) technology, then verifies the consistency of medical logic through Medical Entity Recognition (NER) and relation extraction technology, and finally compares the medical terms in the corpus with an authoritative knowledge base to verify knowledge compliance. The quality control and feedback optimization module classifies and labels the problematic data identified during the verification process, and makes corresponding corrections based on the labeling results. The correction results are fed back to the model training stage to update the prompt engineering and model parameters, optimize the logic chain generation rules, and form a continuous iterative closed loop.
[0013] Based on the second aspect, the quality control and feedback optimization module also provides a configurable logic chain template editor and evaluation index interface, which supports personalized adjustments for different departmental consultation scenarios.
[0014] The beneficial effects of this invention are: 1) Improve the quality of medical consultation corpora by constructing structured logical chain generation rules and multi-dimensional consistency verification mechanisms to effectively filter out problems such as logical gaps, information redundancy or ambiguity in the corpora, ensuring that the corpora can fully map the core links such as disease inquiry, symptom description, diagnostic reasoning and treatment suggestions in real consultation scenarios, and significantly improve the completeness, accuracy and scenario adaptability of the corpora.
[0015] 2) Improve the efficiency of corpus construction and reduce manual costs. The structured construction of consultation corpus is achieved through an automated logic chain generation algorithm, and the intelligent verification module replaces the traditional mode of relying on medical experts to review sentence by sentence, which greatly reduces the frequency and intensity of manual intervention. At the same time, through the reuse and iterative optimization of logic chain templates, the disease types and consultation scenarios covered by the corpus can be quickly expanded, significantly shortening the corpus construction cycle and reducing the time and manpower costs of manual annotation and review.
[0016] 3) Ensuring the medical professionalism and consistency of the generated corpus: By introducing medical knowledge graphs, clinical diagnosis and treatment guidelines, and terminology standards as the basis for generating and verifying logical chains, this application can ensure that the disease names, symptom descriptions, diagnostic criteria, treatment plans, and other content involved in the corpus all comply with medical professional standards. At the same time, through a cross-corpus logical consistency verification mechanism, it avoids logical conflicts or contradictory expressions between different case corpora, ensuring the uniformity of the corpus in terms of medical professionalism and logical consistency.
[0017] 4) Promote the development and optimization of intelligent consultation systems. The high-quality and highly consistent medical consultation corpus generated by this application provides excellent data support for the training and fine-tuning of large language models, helping intelligent consultation systems to more accurately understand patient descriptions and generate consultation processes and treatment suggestions that conform to clinical logic. At the same time, through the traceability of the logical chain of the corpus, it is easy for developers to locate the root cause of system output deviations, providing clear data basis for algorithm optimization and functional iteration of intelligent consultation systems, and accelerating the improvement of the clinical applicability of the system. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the method for generating and verifying medical consultation logic chains based on a large language model, according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of the medical consultation logic chain generation and verification system based on a large language model according to an embodiment of the present invention. Detailed Implementation
[0019] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] This patent discloses a method and system for generating and verifying logical chains in medical consultations based on a large language model. The aim is to address issues such as non-standard logical generation and lack of effective consistency verification in existing medical consultation corpora. The method integrates natural language processing technology, language model generation mechanisms, medical knowledge structure analysis, and intelligent verification algorithms to model, generate, and evaluate the semantic structure, logical chains, and consistency with medical knowledge in medical consultation corpora. This aims to improve the quality, structure, and application value of medical consultation datasets in intelligent consultation systems, providing high-quality and controllable professional corpus support for the training and evaluation of intelligent medical dialogue systems. The method specifically includes the following steps: S1. Generate a logical chain framework and construct a medical consultation logical chain generation model. The model uses a large language model as the core engine and embeds structured logical templates and professional knowledge constraints. The logical template includes hierarchical nodes based on the standard medical consultation process. The hierarchical nodes include chief complaint, present illness, past medical history, family history, physical examination, medical diagnosis, and treatment suggestions. Each node is associated with a medical knowledge graph, which includes symptom terms, disease codes, and treatment guidelines. S2. Design a two-dimensional, multi-level verification framework to automatically verify the consistency and medical rationality of the generated corpus logical chain. S3. Design an evaluation index system and dynamic optimization strategy. Classify and label the problematic data identified in the verification. Simple logical contradictions or expression errors are automatically corrected by the algorithm. Complex medical knowledge deviations trigger medical experts to review and correct them. Feedback the correction results to the model training stage, update the prompt engineering and model parameters, and optimize the logic chain generation rules.
[0021] For example, step S1 employs a multi-stage guided generation strategy to generate the logic chain framework, specifically including the following steps: S11. Node initialization: The logical chain node framework is input into the large language model through prompting engineering, clarifying the medical definition and content boundaries of each node. S12. Knowledge anchoring: At each node generation stage, the medical knowledge graph is called to perform entity verification to ensure that the disease names, symptom descriptions and examination items in the generated content conform to the professional terminology standards. S13. Logical progression control: Through a cross-node attention mechanism, the large language model is forced to associate key information of the preceding node when generating subsequent nodes, thus avoiding logical jumps. S14. Redundancy pruning: Integrating a semantic compression module to remove redundant descriptions in the generated content that are irrelevant to the current node, thereby enhancing the structured features of the corpus.
[0022] For example, the two-dimensional, multi-level verification described in step S2 includes logical structure verification and medical knowledge verification, specifically including the following steps: S21. Logical structure verification: A graph structure matching algorithm is used to map the generated corpus logical chain into a node-relationship graph and compare it with the preset standard logical chain topology. In this embodiment, the preset standard logical chain topology is, for example, chief complaint → present medical history, where there must be a causal relationship. Missing nodes or incorrect connections are identified, and cross-node semantic coherence is verified through a Natural Language Inference (NLI) model. The semantic similarity and causal relationship between adjacent nodes are calculated, and logically broken content is filtered out. S22. Medical knowledge verification: Construct a professional knowledge base retrieval interface, perform knowledge matching on the diagnostic conclusions and treatment suggestions in the generated content, and verify their medical relevance to the symptom description. In this embodiment, for example, the diagnosis corresponding to cough and fever must include the category of respiratory diseases; introduce a discriminant model pre-trained by domain experts to perform error detection on key information, including drug contraindications and examination indications.
[0023] For example, the evaluation index system described in step S3 includes the design of quantitative indicators, which include dimensions such as logical completeness, semantic consistency, knowledge accuracy, and redundancy.
[0024] For example, the dynamic optimization strategy described in step S3 includes: adjusting the generation parameters of the large language model or supplementing the content of the professional knowledge graph based on the evaluation results, and generating secondary corpora that do not meet the preset target quality.
[0025] For example, the flowchart of the method is as follows: Figure 1 As shown, the process can be divided into the following steps: Based on the disease classification system and clinical consultation standards, define and initialize the logical chain template structure of the corpus, clarifying the information elements and association rules of each link; write phased prompt texts, embedding the template structure and domain knowledge into the prompt engineering, guiding the large language model to generate consultation corpus according to the logical order of "chief complaint → present illness → past medical history → examination → diagnosis → suggestion"; automatically parse the generated results through the corpus structure annotation module, matching structured tags to each content fragment to form traceable logical chain data; the consistency verification module performs multi-dimensional verification: introducing algorithms such as Natural Language Inference (NLI), Entity Recognition (NER), and relation extraction to evaluate the semantic consistency, medical logic consistency, and knowledge rationality of the generated corpus; for corpus that fails verification, automatically correct or mark content requiring medical expert review according to the problem level, score, mark, and automatically correct inconsistent or unreasonable content, and guide the model to regenerate if necessary; finally, complete the corpus optimization. Output standardized consultation corpus samples that have passed verification, have complete structure, and meet medical consistency standards, and store them in the corpus.
[0026] Specifically, this invention also discloses a medical consultation logic chain generation and verification system based on a large language model, used in the aforementioned medical consultation logic chain generation and verification method based on a large language model, as shown in the schematic diagram below. Figure 2 As shown, it includes: The corpus logic chain template construction module is used to build standardized logic chain templates based on clinical diagnosis and treatment pathways and consultation standards. For different disease types, it includes core links such as chief complaint collection, present medical history collection, past medical history verification, physical examination points, auxiliary examination items, preliminary diagnosis basis and medical advice. It forms a reusable structured framework to ensure that the information elements and association rules of each link are clear and unambiguous. The corpus generation module is driven by a large language model, such as a pre-trained large language model (e.g., Deepseek). It imports logical chain templates and disease domain knowledge through prompting engineering; following the clinical consultation logic of "chief complaint – present illness – past medical history – examination – diagnosis – recommendations," it guides the large model to generate content step by step. Taking diabetes as an example, it guides the large model to generate descriptions such as "recently frequent thirst and polyuria" in the chief complaint stage, ensuring that the corpus is relevant to the clinical scenario. The corpus structure annotation module uses natural language processing tools (such as NLTK and spaCy) to perform word segmentation and syntactic analysis on the generated continuous text corpus; according to the link definition in the logical chain template, it assigns corresponding structural tags to each consultation segment; for example, it labels the patient's worsening cough in the past week as the present medical history segment; then the annotated corpus is stored in a structured database for subsequent retrieval. The multi-dimensional consistency verification module verifies semantic consistency using Natural Language Inference (NLI) technology. Specifically, it uses NLI to determine the coherence of the corpus's contextual expressions, identifying semantic contradictions such as "severe headache" and "no discomfort." Next, it verifies the consistency of medical logic using Medical Entity Recognition (NER) and relation extraction technologies. Specifically, it verifies the causal relationships between symptoms and diagnoses, and between examinations and diagnoses, such as identifying the irrational diagnosis of "cough and sputum" as "diabetes." Finally, it compares the medical terminology in the corpus with an authoritative knowledge base to verify knowledge compliance. Specifically, it compares the medical terminology in the corpus with an authoritative knowledge base to ensure accurate and standardized terminology, such as correcting "heart attack" to "myocardial infarction." The quality control and feedback optimization module categorizes and labels problematic data identified during validation, and makes corresponding corrections based on the labeling results. Specifically, it automatically corrects simple logical contradictions or expression errors using algorithms, while complex medical knowledge biases trigger a manual intervention process for review and correction by medical experts. The correction results are fed back to the model training stage to update prompts, model parameters, and optimize logic chain generation rules, forming a continuous iterative closed loop. The quality control and feedback optimization module also provides a configurable logic chain template editor and evaluation indicator interface, supporting personalized adjustments for different departmental (e.g., internal medicine, pediatrics) consultation scenarios, improving the method's versatility and adaptability.
[0027] For example, taking a patient's consultation for "headache for 3 days" as an example, the specific procedures include: Corpus generation process: Present illness: The headache is throbbing, without nausea or vomiting, and has no obvious cause; the severity gradually increases. Past medical history: The patient suffered a head injury in a car accident one year ago, recovered with conservative treatment, and has experienced occasional headaches since then. Recommended examination: A head CT scan is recommended to rule out intracranial organic lesions. Preliminary diagnosis: Migraine is suspected. Medical advice: Rest, take ibuprofen orally to relieve pain, and seek medical attention promptly if symptoms do not improve.
[0028] The system automatically verifies: Verify whether the chief complaint matches the diagnostic logic, i.e., whether the headache lasting 3 days and the throbbing pain match the diagnosis of migraine; verify whether the recommended examinations are consistent with the preliminary diagnosis, and determine whether a head CT scan can assist in the diagnosis of migraine; verify whether the semantics are coherent, such as checking whether there are any irrelevant descriptions in the present medical history.
[0029] Problem identification and correction: If there is an inconsistency between the suggestion of a lung CT scan and a headache without fever, the system will identify the problem through natural language reasoning and medical knowledge analysis. The problem will be marked and fed back to the quality control and feedback optimization module. The algorithm will be optimized first, and if it cannot be corrected, it will trigger expert review and modification.
[0030] For example, this application first breaks down medical consultation into a node-based template of "chief complaint → present illness → past medical history → examination → diagnosis → recommendation," and then guides the model output node by node in sequence to ensure that the corpus conforms to the real clinical consultation path in terms of structure, temporality, and causality. This solves the problem that existing technologies often generate text in a "one-time" manner based on keywords or entire descriptions, lacking explicit logical constraints and easily generating disjointed and fragmented text. The consistency verification module constructed in this application automatically verifies at three dimensions: semantic layer, medical knowledge layer, and terminology layer, locating and quantifying logical conflicts and knowledge deviations. This solves the problem that existing technologies lack verification mechanisms or rely solely on manual sampling and general BLEU / ROUGE index evaluation, failing to systematically discover medical logical contradictions, causal errors, and terminological inconsistencies. This application outputs logical chain data with structured labels, which can be directly mapped to input-output pairs of training samples, realizing traceable and reusable corpus assets. This solves the problem that existing technologies often output unstructured or weakly structured text, which is difficult to use directly for downstream model training and evaluation. This application automatically processes data in a hierarchical manner after verification and feeds back the correction results to the prompting engineering and model fine-tuning, forming a continuous iterative closed loop of "generation-verification-correction-retraining". This significantly shortens the iteration cycle, reduces labor costs, and solves the problems of existing technologies, which are mostly unidirectional generation processes with long cycles and delayed feedback.
[0031] In summary, this application realizes the automatic generation of structured medical consultation corpora based on large language models, ensuring that the generated content conforms to the professional logical chain of "chief complaint-diagnosis-treatment", and that the semantics between each node are coherent and the knowledge is consistent. It effectively solves the problems of chaotic corpus logic and frequent medical errors in existing technologies, provides high-quality dataset support for intelligent medical dialogue systems, reduces the risk of misdiagnosis, and improves the reliability of consultation.
[0032] The above description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the concept described herein through the above teachings or related technologies or knowledge. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.
Claims
1. A method for generating and validating medical consultation logic chains based on a large language model, characterized in that, include: S1. Generate a logical chain framework and construct a medical consultation logical chain generation model. The model uses a large language model as the core engine and embeds structured logical templates and professional knowledge constraints. The logical template includes hierarchical nodes based on the standard medical consultation process. The hierarchical nodes include chief complaint, present illness, past medical history, family history, physical examination, medical diagnosis, and treatment suggestions. Each node is associated with a medical knowledge graph, which includes symptom terms, disease codes, and treatment guidelines. S2. Design a two-dimensional, multi-level verification framework to automatically verify the consistency and medical rationality of the generated corpus logical chain. S3. Design an evaluation index system and dynamic optimization strategy. Classify and label the problematic data identified in the verification. Simple logical contradictions or expression errors are automatically corrected by the algorithm. Complex medical knowledge deviations trigger medical experts to review and correct them. Feedback the correction results to the model training stage, update the prompt engineering and model parameters, and optimize the logic chain generation rules. Step S1 employs a multi-stage guided generation strategy to generate the logic chain framework, specifically including the following steps: S11. Node initialization: The logical chain node framework is input into the large language model through prompting engineering, clarifying the medical definition and content boundaries of each node. S12. Knowledge anchoring: At each node generation stage, the medical knowledge graph is called to perform entity verification to ensure that the disease names, symptom descriptions and examination items in the generated content conform to the professional terminology standards. S13. Logical progression control: Through a cross-node attention mechanism, the large language model is forced to associate key information of the preceding node when generating subsequent nodes, thus avoiding logical jumps. S14. Redundancy pruning: Integrating a semantic compression module to remove redundant descriptions in the generated content that are irrelevant to the current node, thereby enhancing the structured features of the corpus. The dual-dimensional, multi-level verification described in step S2 includes logical structure verification and medical knowledge verification, specifically including the following steps: S21. Logical structure verification: A graph structure matching algorithm is used to map the generated corpus logical chain into a node-relationship graph. The graph is compared with the preset standard logical chain topology to identify missing nodes or incorrect connections. The semantic coherence across nodes is verified through the Natural Language Inference (NLI) model. The semantic similarity and causal correlation between adjacent nodes are calculated to filter out logically broken content. S22. Medical knowledge verification: Construct a professional knowledge base retrieval interface to perform knowledge matching on the diagnostic conclusions and treatment suggestions in the generated content, and verify their medical relevance to the symptom description; introduce a discriminant model pre-trained by domain experts to perform error detection on key information, including drug contraindications and examination indications.
2. The method for generating and verifying medical consultation logic chains based on a large language model according to claim 1, characterized in that: The evaluation index system described in step S3 includes the design of quantitative indicators, which include logical completeness, semantic consistency, knowledge accuracy, and redundancy.
3. The method for generating and verifying medical consultation logic chains based on a large language model according to claim 1, characterized in that, The dynamic optimization strategy described in step S3 includes: adjusting the generation parameters of the large language model or supplementing the content of the professional knowledge graph based on the evaluation results, and generating secondary corpora that do not meet the preset target quality.
4. A medical consultation logic chain generation and verification system based on a large language model, used in the medical consultation logic chain generation and verification method based on a large language model as described in any one of claims 1-3, characterized in that, include: The corpus logic chain template construction module is used to construct standardized logic chain templates based on clinical diagnosis and treatment pathways and consultation standards. Develop reusable structured frameworks for different disease types; The corpus generation module utilizes a pre-trained large language model and imports logical chain templates and disease domain knowledge through prompting engineering. The corpus structure annotation module uses natural language processing tools to perform word segmentation and syntactic analysis on the generated continuous text corpus; according to the link definition in the logical chain template, it assigns corresponding structural tags to each consultation segment; then the annotated corpus is stored in a structured database for subsequent retrieval. The multi-dimensional consistency verification module verifies semantic consistency through Natural Language Inference (NLI) technology, then verifies the consistency of medical logic through Medical Entity Recognition (NER) and relation extraction technology, and finally compares the medical terms in the corpus with an authoritative knowledge base to verify knowledge compliance. The quality control and feedback optimization module classifies and labels the problematic data identified during the verification process, and makes corresponding corrections based on the labeling results. The correction results are fed back to the model training stage to update the prompt engineering and model parameters, optimize the logic chain generation rules, and form a continuous iterative closed loop.
5. The medical consultation logic chain generation and verification system based on a large language model according to claim 4, characterized in that: The quality control and feedback optimization module also provides a configurable logic chain template editor and evaluation index interface, which supports personalized adjustments for different departmental consultation scenarios.
Citation Information
Patent Citations
Medical history identification method and system based on large model and expert strategy
CN120032782A
Interrogation model training method and device based on long thinking chain
CN120527037A