Light inquiry decision tree generation method based on large language model

By annotating and fusing the dialogue text of "light consultation" using a large language model, a structured decision summary is generated and a multi-branch decision tree is constructed. This solves the problems of knowledge lag and structural inconsistency in the construction of decision trees for "light consultation" in existing technologies, and achieves efficient and interpretable auxiliary diagnostic support.

CN121833733APending Publication Date: 2026-04-10EAST CHINA UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing methods for constructing decision trees for "light consultation" suffer from problems such as knowledge lag, difficulty in integrating the latest research progress, inability to cover personalized diagnosis and treatment needs, non-standard structure, inconsistent node terminology, and path redundancy, making it difficult to generate efficient and interpretable decision trees.

Method used

Using a large language model, the dialogue text of "light consultation" is annotated, extracted, merged and validated to generate a structured decision summary, construct consultation decision path, and merge multiple paths to form a multi-branch decision tree through relation pair pattern and vectorized encoding. The decision tree library is then used as an external knowledge base for retrieval enhancement.

Benefits of technology

A "light consultation" decision tree that combines efficiency and standardization was constructed, which improves the accuracy and interpretability of intelligent assisted diagnosis. The generated decision tree can serve as a reliable external knowledge base, providing efficient and interpretable auxiliary decision support for intelligent medical consultation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121833733A_ABST
    Figure CN121833733A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of natural language processing and intelligent medical treatment, and aims to solve the problems that knowledge is lagged and diverse requirements are difficult to cover in the existing'light inquiry 'decision tree construction, the manual construction efficiency is low, and unified standardized representation is lacked. The invention provides an online light inquiry medical decision tree generation method based on a big language model, and the method comprises the steps: removing high noise from a real online light inquiry dialogue text data set through a decision information abstract generation module, and carrying out the structural extraction of diagnosis and treatment information through a big language model; and the inquiry paths of the same type of symptoms are standardized, clustered and merged through an inquiry decision path fusion module to generate a generalization decision tree. The decision tree library constructed by the method can be used as an external knowledge base of a retrieval enhancement generation framework, and is used for enhancing the decision ability of a large language model in the field of light inquiry and providing an interpretable basis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of natural language processing and smart healthcare, specifically to the fields of large language models (LLMs) and decision tree construction. More specifically, it relates to a method for automatically constructing a standardized and interpretable medical decision tree based on online "light consultation" dialogue text by generating decision information summaries and integrating consultation decision paths. Background Technology

[0002] With the rapid development of information technology and artificial intelligence, online "light consultation" services have become an important part of the medical service system, and the need to improve the efficiency and quality of consultations using decision tree-based intelligent auxiliary systems is increasingly urgent. However, existing methods for constructing decision trees for "light consultations" still have many limitations. One common method is based on authoritative medical literature or textbooks, but this method suffers from knowledge lag, making it difficult to integrate the latest clinical research progress and treatment plans in real time. Furthermore, decision trees based on static literature cannot cover the diverse and personalized diagnostic and treatment needs of patients in real "light consultation" scenarios. Another method relies on medical experts to manually construct decision trees based on individual experience, but this not only requires a lot of manpower and time and is inefficient, but more seriously, due to differences in the knowledge structure and experience focus of different experts, manually constructed decision trees often lack a unified standardized representation in terms of structure, node terminology, and decision logic, making it difficult to ensure the standardization and consistency of the decision trees.

[0003] To overcome the aforementioned problems, researchers attempted to use real-world "light medical consultation" dialogue text datasets as a knowledge source to construct decision trees. However, this data source also presents new challenges. First, "light medical consultation" dialogue texts typically contain complex contextual dependencies and significant noise, such as colloquial expressions and irrelevant information, making it technically difficult to accurately and completely extract key diagnostic information and generate high-quality structured decision summaries directly from them. Second, when generating decision paths for similar symptoms based on dialogue data, challenges such as path redundancy and inconsistent node descriptions arise, making it difficult to automatically and efficiently fuse multiple paths to construct a structurally sound, reliable, and interpretable deep multi-branch decision tree. In conclusion, how to efficiently and automatically extract knowledge from real-world "light medical consultation" dialogue texts using advanced large language modeling techniques, and generate structurally unified, standardized, and interpretable auxiliary decision trees, is a pressing technical challenge that needs to be addressed. Summary of the Invention

[0004] This invention proposes a method for generating decision trees for "light consultations" based on a large language model, comprising: using LLM to annotate, extract, merge, and validate "light consultation" dialogue text, outputting a structured core information summary; constructing consultation decision path instances, designing relation pair patterns, and generating linear consultation decision paths based on LLM; extracting and representing the features of decision path nodes, standardizing and vectorizing the path nodes; fusing multiple paths to form a multi-branch decision tree, applying clustering and cosine similarity algorithms to merge similar paths, and finally generating a structured multi-branch decision tree; finally, enhancing generation through retrieval, using the generated decision tree set as an external knowledge base to assist the large language model in making more accurate and interpretable "light consultation" decision outputs. To achieve the above objectives, this invention provides the following solution:

[0005] 1. A decision tree generation method based on a large language model for "light consultation" (DTGOLC), characterized by comprising:

[0006] S1: Generate a structured decision summary containing multi-turn interaction information. The feature is that, based on a large language model, the “light consultation” dialogue text is automatically annotated, information is extracted and semantics are merged, and through reflective iterative optimization, verification and confirmation and information denoising, a structured decision information summary containing core decision information is output.

[0007] S2: Constructing a consultation decision path instance, characterized by pre-defining a relation pair model triple structure, wherein the triple structure consists of a head category, a relation, and a tail category; and based on the triple structure, designing relation pair patterns that describe the semantic association between different categories of decision information according to the categories related to the decision information; generating specific relation pair instances based on the summary and the relation pair patterns; and finally, connecting the relation pair instances into a consultation decision path based on a large language model.

[0008] S3: Decision path node feature extraction and representation, characterized in that the node representations in the decision path are standardized based on a large language model to ensure the standardization of terminology; and the standardized node representations are mapped to a vector space to realize the vectorized encoding of node representations;

[0009] S4: A multi-branch decision tree is formed by merging multiple paths. The key feature is that, firstly, the vectorized nodes are clustered to find a candidate set of nodes to be merged; then, a cosine similarity algorithm is applied, and nodes with a similarity greater than 0.8 are designated as nodes to be merged. If multiple paths share a sub-path consisting of common nodes to be merged, the sub-paths are merged to form a generalized path; through iteration, a series of generalized paths are formed, ultimately constructing a "light consultation" decision tree themed around a specific symptom, and constructing decision trees covering different symptom types to form a decision tree library.

[0010] S5: Enhanced generation of consultation decision retrieval based on decision tree knowledge base, characterized in that the decision tree base is used as an external knowledge base and applied to the retrieval enhancement generation framework to assist the large language model in making "light consultation" decisions and enhance the interpretability of the decisions.

[0011] 2. The method according to claim 1, characterized in that, step S1, generating a structured decision summary containing multi-round interaction information, specifically includes the following steps:

[0012] 1) Structured information extraction and summary generation: The spoken information in the “light consultation” dialogue text is automatically labeled. The labeled categories include patient symptoms, historical examination results, past medical history, historical treatment, next examination items, diagnosis results, treatment suggestions, and suggested referral departments. The decision information is extracted and the information of the same category is semantically merged to form an overall summary.

[0013] 2) Reflective Iterative Optimization: Based on the large language model, reflective iterative optimization is performed on the overall summary to determine whether there is any missing information in the overall summary; if there is no missing information in both iterations, the iteration ends;

[0014] 3) Verification and information denoising: A judgment model is introduced to verify and confirm the summary information, and to remove interfering information that is mentioned in the dialogue but has been confirmed to be excluded or that the patient does not have.

[0015] 3. The method according to claim 1, characterized in that, step S2, constructing a consultation decision path instance, specifically includes the following steps:

[0016] 1) Design relation pair model triples: Based on the categories related to decision information, and based on the relation pair model triple structure consisting of a head category, relation, and tail category as described in claim 1, design specific relation pair patterns; the relation pair model triples include at least the following seven relation pair patterns:

[0017] A relational schema with the major category as the head entity and the category attribute as the relation;

[0018] A relational model with patient symptoms as the head entity and diagnosis as the relation;

[0019] A relational model that uses patient symptoms as the head entity and examination as the relationship;

[0020] A relational model using patient symptoms as the head entity and triage as the relationship;

[0021] A relational model that uses diagnostic results as the head entity and treatment as the relationship;

[0022] A relational model that uses past medical history as the head entity and treatment as the relationship;

[0023] A relational model is used, with past medical history and symptoms as the head entity and diagnosis as the relationship pair.

[0024] 2) Generate a decision path: Based on the decision information summary and the relation pair pattern, generate a specific relation pair instance, where the relation pair instance is an instantiation of the decision information that actually appears in the dialogue in the corresponding relation pair pattern; and based on the relation pair instance and the decision information summary, generate a consultation decision path based on the large language model. The consultation decision path consists of multiple sequentially connected nodes, with adjacent nodes connected by "→". The nodes include at least one of symptom nodes, classification attribute nodes, diagnosis nodes, examination nodes, treatment nodes, and triage nodes.

[0025] 4. The method according to claim 1, characterized in that the S3 decision path node feature extraction and representation specifically includes: standardizing the node representations in the decision path based on the large language model to unify the terminology standardization; the processing can be formally represented as:

[0026]

[0027] The input for standardization is the original node representation in the decision path. The output is a standardized node representation. , This represents a standardized function based on a large language model.

[0028] 5. The method according to claim 1, characterized in that the S3 decision path node feature extraction and representation specifically includes: mapping the standardized node representation to a vector space to achieve vectorized encoding of the node representation; specifically, using embedding technology to convert the text representation of the node into a high-dimensional vector representation; and introducing a fusion mechanism to enhance the robustness of the node vector representation by weighted averaging the multiple embedded representations of the node; the process can be formally represented as:

[0029]

[0030]

[0031] in, This represents the original node in the decision path. Represents the standardized node. Represents word embedding function, , The vector representation of a node. To integrate weights, , This is the final fusion vector representation.

[0032] 6. The method according to claim 1, characterized in that, step S4, which integrates multiple paths to form a multi-branch decision tree, specifically includes: for a given set P of diagnostic decision path instances, selecting path instances... and Calculate the cosine similarity of their node representations; if the similarity is greater than 0.8, it is called a node to be merged, and the sub-paths formed by common nodes to be merged are merged into a shared sub-path. and will and Replace with generalization path The generalization path Shared subpath and , The non-shared parts are connected to reduce the redundancy of the decision path set.

[0033] 7. The method according to claim 1, characterized in that, step S4, which integrates multiple paths to form a multi-branch decision tree, specifically includes: based on a series of generalized paths formed iteratively, ultimately constructing a "light consultation" decision tree themed around specific symptoms. The root node For the symptom theme, The set of generalized paths after fusion This forms a decision multi-branch tree, formally represented as follows:

[0034]

[0035]

[0036] in, For the first The generalization path after fusion.

[0037] 8. The method according to claim 1, characterized in that, step S5, the consultation decision retrieval enhancement generation based on the decision tree knowledge base, specifically includes: using the decision tree base as an external knowledge base, employing a retrieval enhancement generation framework for consultation decision application, performing knowledge retrieval using the knowledge base based on user input queries, and obtaining relevant content; inputting the relevant content as enhanced knowledge into the large language model to guide the model to generate content consistent with credible knowledge in the knowledge base, thereby enhancing the large language model's ability to make clinical consultation decisions in the "light consultation" field and providing interpretable evidence.

[0038] Compared with the prior art, the present invention has the following core advantages:

[0039] 1. A novel decision tree generation task, DTGOLC, is proposed. This study is the first to be based on a real online "light consultation" dialogue text dataset. It focuses on the latest research progress in the disease field and constructs a "light consultation" decision tree that is both efficient and standardized, so as to improve the accuracy and interpretability of intelligent assisted diagnosis.

[0040] 2. To address the issues of complex contextual relationships and high noise interference in "light consultation" dialogue texts in the DTGOLC task, this invention proposes a decision information summarization generation method based on large language models, LCDTSG-LLM (Light Consultation Decision Text Summarization Generation Method Based on Large Language Models), aiming to effectively extract key information and assist in the subsequent construction of decision trees. This method takes real-world "light consultation" dialogue text as input and outputs a "light consultation" decision information summary. The summary includes core information related to the consultation decision, such as patient symptoms, historical examination results, past medical history, historical treatments, suggested referral departments, next examination items, diagnosis results, and treatment suggestions. Experimental results on a real "light consultation" dataset show that the proposed method outperforms the baseline model in generating "light consultation" decision information summaries.

[0041] 3. To address the issues of path redundancy and inconsistent representation in decision paths for similar symptoms generated based on the "light medical consultation" dialogue dataset in the DTGOLC task, this invention proposes a "light medical consultation" decision tree generation method, MDPFDT (Medical Decision Path Fusion for Decision Tree), based on medical consultation decision path fusion, to achieve effective integration of multiple paths and consistency in representation. This method generates decision paths based on "light medical consultation" decision information summaries and relation pair patterns, constructing a set containing 5547 decision paths. Furthermore, based on the path fusion algorithm, it generates nearly 30 deep multi-branch decision trees covering different symptom types such as dizziness, insomnia, and fever, forming a decision tree library. This provides interpretable reasoning for clinical decision-making in "light medical consultations." Experimental results on a publicly available medical question-and-answer dataset show that the retrieval enhancement method based on the "light medical consultation" decision tree library and a large language model proposed in this invention significantly outperforms the baseline model in medical consultation decision-making.

[0042] This invention addresses the core issues of existing "light medical consultation" decision tree construction—namely, the lag in knowledge sources, low accuracy in information extraction, and lack of structural uniformity—by constructing a complete technical process of "dialogue text -> decision information summarization -> standardized path fusion -> decision tree." It leverages the natural language understanding, reasoning, and self-correction capabilities of large language models. The resulting standardized, highly reliable decision tree serves as a reliable external knowledge base, providing efficient, reliable, and interpretable auxiliary decision support for intelligent medical consultation systems. Attached Figure Description

[0043] After reading the detailed embodiments of the present invention with reference to the accompanying drawings, the reader will gain a clearer understanding of various aspects of the present invention, wherein:

[0044] Figure 1 The flowchart illustrates the "light consultation" decision information summary generation method based on a large language model proposed in this invention.

[0045] Figure 2 The flowchart shows the "light consultation" decision tree generation method based on consultation path fusion proposed in this invention. Detailed Implementation

[0046] To verify the effectiveness of the proposed method, experiments were conducted using real medical dialogue data. The data, sourced from the Chunyu Doctor platform, comprised 5547 multi-round consultation dialogues. Statistics showed that 96.6% of the dialogues were within 50 rounds, primarily concentrated between 6 and 20 rounds, consistent with the characteristics of a "light consultation" scenario. Before being input into the model, all data underwent patient information anonymization and non-text content removal cleaning processes.

[0047] Specifically, the present invention provides a "lightweight consultation" decision tree generation method based on a large language model, comprising the following steps:

[0048] Step S1, based on a large language model, automatically annotates, extracts information, and merges semantics from the "light consultation" dialogue text. Through reflective iterative optimization, verification, and information denoising, it outputs a structured decision information summary containing core decision-making information. Specifically, this includes:

[0049] S11: Given a batch of m “light consultation” dialogue texts T, generate a corresponding decision information summary from each dialogue text to form a summary set S, which is formally represented as follows:

[0050]

[0051]

[0052]

[0053]

[0054] Among them, the "light consultation" dialogue text Statements from a group of doctors or patients composition, Representing text The Middle Second speech The corresponding abstract, Semantic merging Ultimately formed , This indicates that the text is from "light consultation". The generated decision information summary.

[0055] As attached Figure 1 As shown, this step sets the labeling categories related to decision-making information as follows: patient symptoms, historical examination results, past medical history, past treatment, next examination items, diagnosis results, treatment suggestions, and suggested referral departments. Among these, patient symptoms, historical examination results, past medical history, and past treatment are key information describing the patient's condition, while next examination items, diagnosis results, treatment suggestions, and suggested referral departments represent the doctor's consultation decisions based on the current patient information. This step automatically labels the multiple categories inherent in each speech based on a large language model. The prompt words used for dialogue category labeling are designed as follows:

[0056] {

[0057] Task setting: "Given a statement from a patient or doctor in a medical conversation, your task is to label this statement with multiple tags. A statement may involve 0, 1, or more categories. All possible categories are as follows: Symptoms, Next Steps, Previous Test Results, Medical History, Previous Treatments, Diagnosis, Treatment Recommendations, Suggested Referral Department."

[0058] Output form: "Output all category labels corresponding to the speech, separated by commas: [Category 1], [Category 2],..."

[0059] }

[0060] This step analyzes the results of each statement category labeling to discuss the dialogue characteristics of online "light consultations". In 5547 multi-round consultation dialogues, totaling 105389 statements, patient symptoms appeared most frequently, with over 31% of statements related to patient symptoms. This reflects the characteristic of the consultation process revolving around symptoms. Treatment suggestions ranked second in frequency, indicating that patients on the "light consultation" platform are more concerned with solutions to their health problems.

[0061] S12: As attached Figure 1 As shown, given the multi-labeled speech text, this step uses GPT4omini20240718 to extract decision information from each speech and generate a summary corresponding to the speech. The prompt words for summary generation are designed as follows:

[0062] {

[0063] Task setting: "Given a statement from a patient or doctor, and the corresponding tags for this statement, your task is to generate a corresponding summary in the format of..."

[0064] Output form: "The abstract must be output strictly according to the following format: [tag1]: [Abstract content1]; [tag2]: [Abstract content2];..."

[0065] }

[0066] S13: As attached Figure 1 As shown, this step semantically merges similar information from the summaries of all statements to form a general summary of the dialogue text. The semantic merging prompts are designed as follows:

[0067] {

[0068] Task setting: "Given a multi-turn 'brief consultation' dialogue between a patient and a doctor, and the decision entity information extracted from the dialogue, your task is to merge the decision entity information of the same category, retaining the complete and useful information."

[0069] Input form: {

[0070] "Decision Category": "[List of Decision Categories]",

[0071] "Enter Dialogue": "[Multi-turn consultation dialogue text]",

[0072] "Decision Entity Information": "[Preliminary Extracted Entity Summary]"

[0073] },

[0074] Output form: “Structured output according to decision category: [Decision Category 1]: [Merged Information 1]; [Decision Category 2]: [Merged Information 2]; ...”

[0075] }

[0076] S14: As attached Figure 1 As shown, after obtaining the preliminary decision information summary, this step reflects on the completeness of the summary information based on the large language model and optimizes the result through multiple iterations. Specifically, the original dialogue text and the current summary information are input into the large language model again to determine if there is any missing information. If there is any missing information, it is supplemented; if there is no missing information in two iterations, the iteration ends. The prompt words for the reflection iteration are designed as follows:

[0077] {

[0078] Task setting: "Given a multi-round consultation dialogue between a patient and a doctor, and summary information generated from this dialogue. Decision categories... Your task is to generate a new summary and determine if any information is missing from the summary."

[0079] Input form: {

[0080] "Enter Dialogue": "[Multi-turn consultation dialogue text]",

[0081] "Preliminary Summary": "[Preliminary generated summary]"

[0082] },

[0083] Output form: "Optimized summary: [Decision Category 1]: [Optimized Information 1]; [Decision Category 2]: [Optimized Information 2]; ...

[0084] }

[0085] The input for the reflection iteration is the output of the previous iteration. The model needs to reflect on the previous result and then determine whether it needs to be modified. After multiple iterations, it will move on to the next step of verification and confirmation.

[0086] S15: As attached Figure 1 As shown, this step uses a large language model to validate the results. Specifically, the model receives the summary information generated in the previous step and the original dialogue text as input, validates the summary information, and removes information such as symptoms and medical history mentioned in the dialogue but not possessed by the patient. Information that fails validation is removed from the summary information and reserved for manual verification in the next step. The validation confirmation prompts are designed as follows:

[0087] {

[0088] Task setting: "Given a multi-round consultation dialogue between a patient and a doctor, and a summary of the dialogue generated from this dialogue, the decision information relevance category is... Your task is to validate the information in the summary, removing information such as symptoms mentioned in the dialogue but not actually possessed by the patient."

[0089] Input form: {

[0090] "Decision Information Related Categories": "[List of decision categories that need to be verified]",

[0091] "Enter Dialogue": "[Multi-turn consultation dialogue text]",

[0092] "Abstract to be verified": "[Abstract to be verified]"

[0093] },

[0094] Output form: "Final summary after verification and confirmation: [Decision Category 1]: [Verified and confirmed information 1]; [Decision Category 2]: [Verified and confirmed information 2]; ...

[0095] }

[0096] For information that fails the model validation, medical experts conduct a second validation manually, based on error analysis. If the manual validation result matches the model validation result, no action is taken; otherwise, if the manual validation does not accept the model validation result, the information is added back to the abstract.

[0097] S16: To verify the effectiveness of the method described in step S1, the comparative models HuatuoGPT2-7B and HuatuoGPT-o1-8B are compared with the method of the present invention GPT-4o-mini. The evaluation indicators include accuracy score, completeness score and relevance score, with a maximum score of 5 points.

[0098] The "accuracy" metric is defined as the proportion of correctly generated text samples out of the total sample size. The "completeness" metric is defined as the comprehensiveness of the decision-making information covered in the "light consultation" dialogue text contained in the generated text, including patient symptoms and diagnostic results. The "relevance" metric is defined as the degree of connection between the generated text and the decision-making logic in the "light consultation" dialogue text, and its effective coverage of decision nodes. Deepseek-v3 is introduced as a judging model to evaluate the quality of results generated by different methods and determine their merits.

[0099] As shown in Table 1, the decision information summarization method based on a large language model proposed in this invention has significant advantages in terms of extraction accuracy, completeness, and relevance.

[0100] Table 1. Experimental Results of Generating Decision Information Summary for "Light Consultation"

[0101] method Accuracy / % Integrity Correlation HuatuoGPT2-7B 44.80 3.67 4.47 HuatuoGPT-o1-8B 29.60 2.91 3.55 Method of the present invention 87.40 4.71 4.97

[0102] Step S2, as attached Figure 2 As shown, the input is the "light consultation" decision information summary generated in step S1, and the output is a consultation decision path instance. The steps of this module are as follows: First, predefine the relation pair model triple structure, which consists of a head category, a relation, and a tail category. Then, based on the triple structure, design relation pair patterns describing the semantic associations between different categories of decision information according to the categories related to the decision information. Next, generate specific relation pair instances based on the summary and the relation pair patterns. Finally, concatenate the relation pair instances into a consultation decision path based on a large language model. Specifically, this includes:

[0103] S21: Based on the categories related to decision information, this invention designs specific relation pair patterns based on the relation pair model triplet structure composed of head category, relation, and tail category; the relation pair model triplet includes at least the following seven relation pair patterns:

[0104] Relationship Pattern 1: A relationship pattern with a major category as the head entity and a category attribute as the relation;

[0105] Relationship Pattern 2: A relationship pair pattern with patient symptoms as the head entity and diagnosis as the relation;

[0106] Relationship Pattern 3: A relationship pair pattern with patient symptoms as the head entity and examination as the relation;

[0107] Relationship Pattern 4: A relationship pattern with patient symptoms as the head entity and triage as the relationship;

[0108] Relationship Pattern 5: A relationship pair pattern with the diagnosis result as the head entity and the treatment as the relation;

[0109] Relationship Pattern 6: A relationship pair pattern with past medical history as the head entity and treatment as the relationship;

[0110] Relationship Pattern 7: A relationship pair pattern with past medical history + symptoms as the head entity and diagnosis as the relationship.

[0111] The relation pair instances are instantiated representations of actual decision information appearing in the dialogue within corresponding relation pair patterns, transforming abstract category relationships into concrete entity relationships. Taking a summary of decision information as input, the large language model identifies the categories of decision information in the summary based on relation pair patterns and extracts the relationships between them. Specifically, the model first identifies the categories of decision information contained in the summary, such as patient symptoms, past medical history, diagnosis results, and treatment suggestions; based on the identified categories, the model applies seven relation pair patterns to determine whether corresponding relationships exist between the categories; for category combinations with existing relationships, the model extracts the specific entity content and generates relation pair instances; the output format is a triple: (head entity, relation, tail entity). The prompt words for generating relation pair instances are designed as follows:

[0112] {

[0113] Task setting: "Given a summary of decision information, your task is to extract relation pairs of triples between categories. Relation pair pattern triples (head category, relation, tail category) include the following 7 types: ...",

[0114] Output form: "Output all extracted relation pairs in list form, in the format: [(head category, relation, tail category)]".

[0115] }

[0116] S22: Based on the generated relation pairs and the decision information summary generated in S1, this invention uses a large language model to generate a consultation decision path. The consultation decision path simulates the doctor's thought process during a "light consultation" decision-making process and consists of multiple sequentially connected nodes, with adjacent nodes connected by "→". These nodes include at least one of the following: symptom nodes, classification attribute nodes, diagnosis nodes, examination nodes, treatment nodes, and triage nodes. The prompt words for generating the consultation decision path are designed as follows:

[0117] {

[0118] Task setting: "Given a summary of decision information and a pair of relational pairs generated from the 'Light Consultation' dialogue text, your task is to generate the current consultation decision path. The consultation decision path consists of... content, with different nodes in the path connected by ->."

[0119] Output form: "Output the complete consultation decision path, with different nodes in the path connected by ->, for example: [symptoms] -> [persistent symptoms] -> [diagnosis] -> [treatment recommendations]."

[0120] }

[0121] Through the above process, this invention generates a total of 5,547 consultation decision paths covering various decision scenarios in the "light consultation" dataset.

[0122] S23: Building upon S22, this invention categorizes decision paths based on the patient's primary symptoms. The purpose of this categorization is to aggregate decision paths with similar symptoms together, facilitating the subsequent construction of decision trees focused on specific symptoms. Path classification uses the starting node of the decision path as the classification basis. The starting node typically reflects the patient's primary need for medical attention and is the starting point for consultation decisions. The primary symptom categories identified by this invention include, but are not limited to, nearly 30 symptom categories such as dizziness, insomnia, fever, cough, abdominal pain, chest tightness, palpitations, and fatigue.

[0123] S24: To verify the effectiveness of constructing decision paths based on relation-based pattern triples in step S2, the quality of the generated consultation decision paths is evaluated. The experiment compares the method of this invention with traditional zero-shot, few-shot, and thought-chain generation methods. A referee model is applied to evaluate the decision path generation performance of the method of this invention compared to the zero-shot, few-shot, and thought-chain methods. The method that more accurately describes the consultation decision logic based on the dialogue text wins.

[0124] Table 2 Comparison of Decision Path Generation Experiment Results

[0125] Method 1 Method 2 Method 1 win rate / % Method 2 win rate / % Method of the present invention Zero samples 80.0 20.0 Method of the present invention Small sample 77.5 22.5 Method of the present invention Mind Chain 77.5 22.5

[0126] Table 2 shows that the generation strategy of "relationship pair instance + large language model" adopted in this invention has significant performance advantages: compared with the zero-shot method, the win rate of this invention is 80.0%; compared with the few-shot method, the win rate of this invention is 77.5%; compared with the thought chain method, the win rate of this invention is 77.5%. The data indicates that by pre-defining seven relationship pair patterns and generating instances, the logic and accuracy of the diagnostic decision path generation can be significantly improved.

[0127] Step S3 involves standardizing the node representations in the decision path based on a large language model to unify the terminology norms; and then mapping the standardized node representations to a vector space to achieve vectorized encoding of node representations.

[0128] S31: The node representations of the decision path originate from the original dialogue in the "Light Consultation" system. The expression of the same term exhibits diversity. This invention standardizes the node representations in the decision path based on LLM (Limited Linear Model). For example, in real-world scenarios, different doctors might refer to the disease "benign paroxysmal positional vertigo" as "otolithiasis," "benign positional vertigo," or "Benign Paroxysmal Positional Vertigo" in different ways. By unifying these expressions to "benign paroxysmal positional vertigo," the terminology standardization of the "Light Consultation" decision tree model is effectively improved.

[0129] The input for standardization is the original node representation in the decision path. The output is a standardized node representation. The processing procedure can be represented as follows:

[0130]

[0131] in, This represents a standardized function based on a large language model.

[0132] S32: Map the standardized node representations to a vector space to achieve vectorized encoding of node representations. The standardized node representations are still in text form and cannot be directly used for numerical calculations or similarity measurements. To support subsequent node clustering and path fusion operations, the standardized node representations need to be mapped to a vector space to achieve vectorized encoding of node representations.

[0133] This invention employs embedding technology to convert the text representation of nodes into a high-dimensional vector representation. Specifically, the vectorization encoding process is represented as follows:

[0134]

[0135] in, This represents the original node in the decision path. Represents the standardized node. Represents word embedding function, , A vector representation of a node.

[0136] To enhance the robustness of node vector representations, this invention further introduces a fusion mechanism to fuse multiple embedding representations of a node. Specifically, for the vector representation of a node... , The fusion is performed using a weighted average:

[0137]

[0138] in To integrate weights, , This is the final fusion vector representation.

[0139] For all nodes in the decision path, repeat the above vectorization encoding process to obtain node vectors. gather:

[0140]

[0141] in This represents the total number of distinct nodes across all decision paths.

[0142] Step S4 first clusters the vectorized nodes to find a candidate set of nodes to be merged. Then, a cosine similarity algorithm is applied, and nodes with a similarity greater than 0.8 are designated as nodes to be merged. If multiple paths share a sub-path consisting of common nodes to be merged, these sub-paths are merged to form a generalized path. Through iteration, a series of generalized paths are formed, ultimately constructing a "light consultation" decision tree themed around a specific symptom.

[0143] S41: This invention clusters vectorized nodes to find a candidate set of nodes to be merged. Specifically, the HDBSCAN (Hierarchical DensityBased Spatial Clustering of Applications with Noise) clustering algorithm is used to cluster the node vector set. Cluster analysis is performed. The HDBSCAN algorithm takes a set of node vectors as input and outputs the clustering results. This algorithm can automatically determine the number of clusters and effectively identify noise points, making it suitable for scenarios such as medical decision-making nodes where outliers may exist. The formal representation of the clustering process is as follows:

[0144]

[0145] in, The clustering result contains multiple clusters. Each cluster It contains several similar node vectors. By clustering, semantically similar nodes are grouped into the same cluster, providing a candidate range for subsequent identification of nodes to be merged, significantly reducing the number of node pairs that need to be calculated for similarity and improving algorithm efficiency.

[0146] S42: Based on S41, this invention applies the Cosine Similarity algorithm to identify nodes to be merged and performs node clustering. Each cluster Extract two different node vectors from , And calculate their similarity. , similarity Node vectors greater than 0.8 , corresponding nodes , These are called nodes to be merged, and all nodes that meet the conditions are paired. Collect the set of nodes to be merged The table contains all node pairs that need to be merged. Node similarity is calculated. The representation is as follows:

[0147]

[0148] S43: Building upon S42, this invention further identifies common sub-paths containing these nodes to be merged. Specifically, for the path set... Any two paths in and If they share a sub-path consisting of common nodes to be merged, then these sub-paths are merged to form a generalized path. This invention collects all identified common sub-paths into a set. In this way, for multiple paths with shared sub-paths, their common parts are merged into a single path node sequence, and the non-common parts are treated as different branches of that node. This method integrates originally independent paths into a generalized path with a branching structure, preserving the specific information of each path while extracting their common decision-making logic.

[0149] The process of constructing a decision tree can be described as follows: First, start with the generalization path set... Choose the longest path. Inserted into the tree as the main path Then, sequentially remove the items that are not present in other paths. Subpaths in the mount to New branches are formed at the corresponding nodes. In this way, all generalization paths are gradually integrated into a unified tree structure.

[0150] Each generalization path A decision tree is formed by connecting a series of nodes using "->", representing a complete decision-making logic chain from symptoms to diagnosis and treatment. The root node is a specific symptom topic, and the generalization paths originating from the root node are... The different branches that make up the decision tree, with leaf nodes representing the final diagnosis, treatment recommendations, or referral departments.

[0151] By iteratively identifying and merging common sub-paths, this invention ultimately forms a series of generalized paths, constructing a "light consultation" decision tree themed around specific symptoms. The root node For the symptom theme, The set of generalized paths after fusion This forms a decision multi-branch tree, formally represented as follows:

[0152]

[0153]

[0154] in, For the first The generalization path after fusion.

[0155] In step S5, the decision tree base is used as an external knowledge base. Based on the user's input query, knowledge retrieval is performed using the knowledge base to obtain relevant content. Subsequently, the relevant content is input as enhanced knowledge into the large language model to guide the model to generate content consistent with the credible knowledge in the knowledge base, thereby enhancing the large language model's ability to make clinical consultation decisions in the "light consultation" field and providing interpretable evidence. This invention uses the "light consultation" decision tree set generated in steps S1 to S4 as an external knowledge base and employs the Retrieval Augmented Generation (RAG) framework for consultation decision application.

[0156] To verify the effectiveness of the decision tree RAG method applied in this invention for assisting medical question-answering tasks, the generated decision tree set was used as an external knowledge base and compared with several RAG baseline methods. The dataset used was the Huatuo26M-Lite dataset, and 541 question-answer records related to dizziness were selected. Evaluation metrics included automated evaluation metrics F1, Accuracy, Precision, and Recall.

[0157] Table 3 shows that the decision tree RAG method used in this invention has significant advantages over other RAG baseline methods. Taking GPT-4o-mini as an example, the F1 score of the decision tree RAG is 90.43%, which is higher than that of path RAG (82.03%), dialogue RAG (65.98%), and no RAG (51.10%). Compared with no RAG, the F1 score of the decision tree RAG is improved by 79.84%; compared with dialogue RAG, the F1 score is improved by 27.58%; and compared with path RAG, the F1 score is improved by 10.47%. Compared with large medical models, the F1 score of the decision tree RAG (90.43%) is significantly better than that of the dedicated large medical models HuatuoGPT2-7B (34.88%) and HuatuoGPT-o1-8B (31.78%).

[0158] Table 3. Experimental Results of the Medical Question Answering Task

[0159]

Claims

1. A method for generating a "lightweight consultation" decision tree based on a large language model, characterized in that, include: S1: Generate a structured decision summary containing multi-turn interaction information. Its feature is that, based on a large language model, the "light consultation" dialogue text is automatically annotated, information is extracted and semantics are merged, and through reflective iterative optimization, verification and confirmation and information denoising, a structured decision information summary containing core decision information is output. S2: Constructing a consultation decision path instance, characterized by pre-defining a relation pair model triple structure, wherein the triple structure consists of a head category, a relation, and a tail category; and based on the triple structure, designing relation pair patterns that describe the semantic association between different categories of decision information according to the categories related to the decision information; generating specific relation pair instances based on the summary and the relation pair patterns; and finally, connecting the relation pair instances into a consultation decision path based on a large language model. S3: Decision path node feature extraction and representation, characterized in that the node representations in the decision path are standardized based on a large language model to ensure the standardization of terminology; and the standardized node representations are mapped to a vector space to realize the vectorized encoding of node representations; S4: A multi-branch decision tree is formed by merging multiple paths. The key feature is that, firstly, the vectorized nodes are clustered to find a candidate set of nodes to be merged; then, a cosine similarity algorithm is applied, and nodes with a similarity greater than 0.8 are designated as nodes to be merged. If multiple paths share a sub-path consisting of common nodes to be merged, the sub-paths are merged to form a generalized path; through iteration, a series of generalized paths are formed, ultimately constructing a "light consultation" decision tree themed around a specific symptom, and constructing decision trees covering different symptom types to form a decision tree library. S5: Enhanced generation of consultation decision retrieval based on decision tree knowledge base, characterized in that the decision tree base is used as an external knowledge base and applied to the retrieval enhancement generation framework to assist the large language model in making "light consultation" decisions and enhance the interpretability of the decisions.

2. The method according to claim 1, characterized in that, The step S1 generates a structured decision summary containing multi-round interaction information, specifically including the following steps: 1) Structured information extraction and summary generation: The spoken information in the "light consultation" dialogue text is automatically labeled. The labeled categories include patient symptoms, historical examination results, past medical history, historical treatment, next examination items, diagnosis results, treatment suggestions, and suggested referral departments. The decision information is extracted and the information of the same category is semantically merged to form an overall summary. 2) Reflective Iterative Optimization: Based on the large language model, reflective iterative optimization is performed on the overall summary to determine whether there is any missing information in the overall summary; if no missing information is found in two iterations, the iteration ends. 3) Verification and information denoising: A judgment model is introduced to verify and confirm the summary information, and to remove interfering information that is mentioned in the dialogue but has been confirmed to be excluded or that the patient does not have.

3. The method according to claim 1, characterized in that, The S2 method for constructing a consultation decision path instance specifically includes the following steps: 1) Design relation pair model triples: Based on the categories related to decision information, and based on the relation pair model triple structure consisting of a head category, relation, and tail category as described in claim 1, design specific relation pair patterns; the relation pair model triples include at least the following seven relation pair patterns: A relational schema with the major category as the head entity and the category attribute as the relation; A relational model with patient symptoms as the head entity and diagnosis as the relation; A relational model that uses patient symptoms as the head entity and examination as the relationship; A relational model using patient symptoms as the head entity and triage as the relationship; A relational model that uses diagnostic results as the head entity and treatment as the relationship; A relational model that uses past medical history as the head entity and treatment as the relationship; A relational model is used, with past medical history and symptoms as the head entity and diagnosis as the relationship pair. 2) Generate a decision path: Based on the decision information summary and the relation pair pattern, generate a specific relation pair instance, where the relation pair instance is an instantiation of the decision information that actually appears in the dialogue in the corresponding relation pair pattern; and based on the relation pair instance and the decision information summary, generate a consultation decision path based on the large language model. The consultation decision path consists of multiple sequentially connected nodes, with adjacent nodes connected by "→". The nodes include at least one of symptom nodes, classification attribute nodes, diagnosis nodes, examination nodes, treatment nodes, and triage nodes.

4. The method according to claim 1, characterized in that, The S3 decision path node feature extraction and representation specifically includes: standardizing the node representations in the decision path based on the large language model to unify the terminology standardization; the processing can be formally represented as: n′=LLM_Normalize(n) The input to the standardization process is the original node representation n in the decision path, and the output is the standardized node representation n'. LLM_Normalize represents the standardization function based on the large language model.

5. The method according to claim 1, characterized in that, The S3 decision path node feature extraction and representation specifically includes: mapping the standardized node representation to a vector space to achieve vectorized encoding of the node representation; specifically, using embedding technology to convert the text representation of the node into a high-dimensional vector representation; and introducing a fusion mechanism to enhance the robustness of the node vector representation by weighted averaging the multiple embedded representations of the node; the process can be formally represented as: v=Embedding(n),v′=Embedding(n) v * =λ*v+(1-λ)*v′ Where n represents the original node in the decision path, n' represents the standardized node, Embedding represents the word embedding function, v and v' represent the vector representation of the node, λ is the fusion weight, λ∈[0,1], v * This is the final fusion vector representation.

6. The method according to claim 1, characterized in that, The S4 method integrates multiple paths to form a multi-branch decision tree, specifically including: for a given set P of consultation decision path instances, selecting path instance p. i and p j Calculate the cosine similarity of their node representations; if the similarity is greater than 0.8, then it is called a node to be merged, and the sub-paths formed by the common nodes to be merged are merged into a shared sub-path S. k and p i and p j Replace with generalized path p g The generalization path p g Shared subpath S k and p i p j The non-shared parts are connected to reduce the redundancy of the decision path set.

7. The method according to claim 1, characterized in that, The S4 method integrates multiple paths to form a multi-branch decision tree, specifically including: based on a series of generalized paths formed through iteration, a "light consultation" decision tree DT is finally built with a specific symptom as the theme, where the root node R sym For the symptom theme, the set P of k fused generalized paths forms a decision multi-way tree, which is formally represented as follows: DT=[R sym ,P] in, Let be the i-th fused generalized path.

8. The method according to claim 1, characterized in that, The S5 method, which enhances the generation of consultation decision retrieval based on a decision tree knowledge base, specifically includes: using the decision tree knowledge base as an external knowledge base, employing a retrieval enhancement generation framework for consultation decision application, performing knowledge retrieval using the knowledge base based on user input queries to obtain relevant content; and inputting the relevant content as enhanced knowledge into a large language model to guide the model to generate content consistent with credible knowledge in the knowledge base, thereby enhancing the large language model's ability to make clinical consultation decisions in the "light consultation" field and providing interpretable evidence.