A method for generating simulated patient dialogues based on TCM syndrome type constraints
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-08-14
AI Technical Summary
[0006]本发明的目的是提供一种基于中医证型约束的模拟患者对话生成方法,解决现有基于大语言模型的模拟患者对话生成方法缺乏中医证型约束和症状逐轮披露控制,导致生成症状偏离目标证型、关键症状提前泄露以及多轮对话前后不一致的技术问题
[0030]本发明通过构建包括核心症状集合、共性症状集合、干扰症状集合、症状触发表及问诊约束规则的证型约束库,并依据目标证型生成满足核心症状覆盖条件、干扰症状占比条件和冲突症状排除条件的患者症状画像,使患者智能体的可回答内容被限定在符合目标证型的症状范围内,从而减少不同证型症状混杂及无关症状生成;通过为各症状建立触发问法、披露状态和披露轮次,并仅将当前问诊内容所触发的症状及历史已披露内容输入患者智能体,使症状信息随问诊过程逐轮披露,从而避免关键症状提前泄露;通过在每轮回答后更新症状披露状态,并在后续问诊中调用历史已披露内容,使同一症状的多轮对话保持一致,进而提高模拟患者的证型一致性、对话稳定性和临床问诊真实性,提升中医辨证问诊教学、训练及考核的标准化程度。
Smart Images

Figure CN122575685A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical teaching simulation technology, specifically to a method for generating simulated patient dialogues based on traditional Chinese medicine syndrome type constraints. Background Technology
[0002] Traditional Chinese medicine (TCM) diagnosis and treatment revolves around syndrome differentiation and treatment. Doctors typically gather information about a patient's symptoms, signs, and disease progression through observation, auscultation and olfaction, inquiry, and palpation, and then determine the corresponding syndrome type by considering the relationships between symptoms. Inquiry is a crucial step in obtaining information about the patient's subjective feelings, symptom changes, and triggering factors. The inquirer needs to adjust the questions based on the patient's answers to obtain effective information for syndrome differentiation. Therefore, developing TCM inquiry skills requires learners not only to master the symptom characteristics corresponding to different syndrome types but also to possess the ability to rationally organize the inquiry sequence, identify key information, and eliminate interfering information.
[0003] Current TCM consultation teaching methods mainly employ real patient interaction, teacher role-playing as patient, or pre-set case question-and-answer sessions. Real patients are influenced by their condition, expression habits, and level of cooperation, making it difficult to form a repeatable standardized training process; teacher role-playing as patient relies heavily on the teacher's experience, resulting in low consistency among different trainees; pre-set case question-and-answer sessions typically only allow interaction based on fixed questions and answers, making it difficult to accommodate learners using synonymous, ambiguous, or non-standard questioning.
[0004] With the development of natural language processing technology and large language models, using intelligent agents to generate simulated patient dialogues has become a feasible method for training TCM (Traditional Chinese Medicine) consultations. However, existing methods for generating simulated patient dialogues often rely directly on case texts or prompts to generate responses, lacking structured constraints specific to TCM syndrome types. This can easily lead to the generation of symptoms that do not belong to the target syndrome type, or the mixing of core symptoms from different syndrome types. Furthermore, existing methods typically fail to establish symptom triggering conditions and disclosure states, potentially revealing crucial information that has not yet been asked in the early stages of the consultation, and resulting in repetitive, omitted, or contradictory symptom content in subsequent dialogues.
[0005] In view of this, the present invention provides a method for generating simulated patient dialogue based on TCM syndrome type constraints, thereby solving the above problems. Summary of the Invention
[0006] The purpose of this invention is to provide a method for generating simulated patient dialogues based on TCM syndrome type constraints, which solves the technical problems of existing simulated patient dialogue generation methods based on large language models that lack TCM syndrome type constraints and symptom disclosure control in turn, resulting in generated symptoms deviating from the target syndrome type, premature disclosure of key symptoms, and inconsistencies between multiple rounds of dialogue.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] This invention provides a method for generating simulated patient dialogues based on TCM syndrome type constraints, comprising the following steps:
[0009] S1, perform structured parsing of TCM syndrome texts, and establish a syndrome constraint library including a core symptom set, a common symptom set, a distracting symptom set, a symptom trigger table, and consultation constraint rules;
[0010] S2, determine the target syndrome type, select symptoms from each symptom set according to the corresponding consultation constraint rules, generate a target patient symptom profile that meets the core symptom coverage condition, the interfering symptom proportion condition, and the conflicting symptom exclusion condition, and generate a patient-specific description of each symptom.
[0011] S3 initializes the patient agent based on the patient's basic information and the target patient's symptom profile, and establishes a symptom disclosure status record for each symptom, including the trigger question, disclosure status, and disclosure round.
[0012] S4, semantically match the current round of consultation content with the triggering questions for each symptom to obtain the set of symptoms that can be disclosed in this round;
[0013] S5 inputs the current round of consultation content, patient basic information, historically disclosed content, and the set of symptoms that can be disclosed in this round into the patient agent to generate the patient's answer. Symptoms that have not been triggered and have not been disclosed are not included in the current round of input.
[0014] S6 updates the disclosure status and disclosure round of the symptoms that can be disclosed in this round, and proceeds to the next round of consultation if the termination conditions are not met.
[0015] As a preferred technical solution of the present invention, the syndrome constraint library establishes a syndrome constraint unit for each syndrome, and any syndrome constraint unit includes a core symptom set, a common symptom set, an interfering symptom set, a symptom trigger table, and a consultation constraint rule;
[0016] The symptom trigger table consists of a set of symptoms and their corresponding trigger questions. The consultation constraint rules record the core symptom coverage threshold, the proportion threshold of interfering symptoms, the strength relationship of symptoms, and conflicting symptoms that are incompatible with the corresponding syndrome type, so that the generation of the target patient's symptom profile is constrained by both the symptom category and the symptom combination relationship.
[0017] As a preferred embodiment of the present invention, when generating the symptom profile of the target patient, a subset of core symptoms, a subset of common symptoms, and a subset of interfering symptoms are selected from the core symptom set, the common symptom set, and the interfering symptom set of the target syndrome, respectively, and the symptom profile of the target patient is composed of the subset of core symptoms, the subset of common symptoms, and the subset of interfering symptoms; wherein:
[0018] The ratio of the number of symptoms contained in the core symptom subset to the number of symptoms contained in the core symptom set of the target syndrome is not less than the core symptom coverage threshold, the ratio of the number of symptoms contained in the interference symptom subset to the total number of symptoms contained in the target patient symptom profile is not higher than the interference symptom proportion threshold, and the target patient symptom profile does not contain the conflicting symptoms.
[0019] As a preferred technical solution of the present invention, a patient-specific description is generated for each symptom in the symptom profile of the target patient, and the symptom, symptom category, symptom severity, patient-specific description, set of triggering questions, disclosure status and disclosure round are associated to form a corresponding symptom disclosure status record; the patient-specific description includes at least two of the following: presence or absence of symptom, severity, duration, triggering factors, aggravating factors, relieving factors, accompanying manifestations and natural language expression.
[0020] As a preferred embodiment of the present invention, the set of triggering questions includes direct questions, synonymous questions, and ambiguous questions set for the same symptom;
[0021] When performing semantic matching, only the content of the current round of consultation is matched with the set of trigger questions corresponding to each symptom in the symptom profile of the target patient. One or more symptoms that are successfully matched are added to the set of symptoms that can be disclosed in this round. Symptoms that are not in the symptom profile of the target patient are not added to the set of symptoms that can be disclosed in this round.
[0022] As a preferred technical solution of the present invention, when initializing the patient intelligent agent, the patient's chief complaint or necessary background information is set as the initial disclosable content, and the symptoms in the target patient's symptom profile other than the initial disclosable content are set as undisclosed.
[0023] In any round of consultation, only the patient-specific descriptions of the symptoms that can be disclosed in this round and the previously disclosed content are input into the patient's AI agent. Symptoms in the target patient's symptom profile that are not disclosed and are not triggered by the current round of consultation content, as well as their patient-specific descriptions, are not input into the patient's AI agent.
[0024] As a preferred embodiment of the present invention, the patient agent generates the patient's response in the following manner:
[0025] When the current round of consultation triggers an undisclosed symptom, the corresponding patient description is used to generate an answer; when the current round of consultation triggers a disclosed symptom, existing answer information corresponding to that symptom in the historical disclosed content is used to generate an answer.
[0026] If the current round of consultation does not trigger any symptoms in the target patient's symptom profile, an answer will be generated based solely on the patient's chief complaint, basic patient information, or negative statements regarding the current round of consultation.
[0027] As a preferred technical solution of the present invention, after each round of patient response is generated, the symptoms that can be disclosed in this round are incorporated into the historical disclosed symptom set, the disclosure status of the corresponding symptom is updated from undisclosed to disclosed, and the consultation round corresponding to the first or second disclosure of the symptom is recorded.
[0028] When a previously disclosed symptom is triggered again during a subsequent consultation, a patient response consistent with the previous response is generated based on the symptom's disclosure cycle and historical disclosed content, instead of re-invoking other symptoms that are currently undisclosed.
[0029] The technical effects and advantages provided by the present invention in the above technical solution are as follows:
[0030] This invention constructs a syndrome constraint library comprising a core symptom set, a common symptom set, a set of interfering symptoms, a symptom trigger table, and consultation constraint rules. Based on the target syndrome, it generates patient symptom profiles that meet the conditions for core symptom coverage, interfering symptom proportion, and conflicting symptom exclusion. This limits the respondable content of the patient agent to the range of symptoms conforming to the target syndrome, thereby reducing the mixing of symptoms from different syndromes and the generation of irrelevant symptoms. By establishing trigger questions, disclosure status, and disclosure rounds for each symptom, and only inputting the symptoms triggered by the current consultation content and previously disclosed content into the patient agent, symptom information is disclosed round by round during the consultation process, thus avoiding premature disclosure of key symptoms. By updating the symptom disclosure status after each round of responses and recalling previously disclosed content in subsequent consultations, the consistency of multiple rounds of dialogue for the same symptom is maintained, thereby improving the consistency of syndromes in simulated patients, the stability of dialogue, and the realism of clinical consultation, and enhancing the standardization of TCM syndrome differentiation and consultation teaching, training, and assessment. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0032] Figure 1 This is a flowchart of the patient consultation simulation method of the present invention. Detailed Implementation
[0033] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that the description of the invention will be more complete and fully convey the concept of the exemplary embodiments to those skilled in the art. The drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.
[0034] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more exemplary embodiments. Numerous specific details are provided in the following description to give a full understanding of exemplary embodiments of the invention. However, those skilled in the art will be able to omit some non-essential details or implement the invention using other equivalent methods, components, or steps without departing from the inventive concept. In other instances, well-known structures, methods, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of the invention.
[0035] Example 1
[0036] See Figure 1 This invention provides a method for generating simulated patient dialogue based on TCM syndrome type constraints, including constructing a syndrome type constraint library, generating a target patient symptom profile, initializing the patient agent, matching consultation content, generating patient responses, and updating symptom disclosure status. By limiting the symptom content usable by the patient agent to the target patient symptom profile and releasing corresponding symptoms in turn according to the consultation content, the method avoids the patient agent arbitrarily generating symptoms or prematurely disclosing key information that has not been asked. The method includes the following steps.
[0037] S1, perform structured parsing of TCM syndrome texts, and establish a syndrome constraint library including a core symptom set, a common symptom set, a distracting symptom set, a symptom trigger table, and consultation constraint rules;
[0038] Specifically, this involves: obtaining TCM syndrome texts from TCM textbooks, clinical guidelines, standardized cases, and expert-compiled materials; performing structured parsing on these TCM syndrome texts; extracting the syndrome name, main symptoms, concurrent symptoms, etiology and pathogenesis descriptions, and corresponding commonly used patient expressions; and establishing a syndrome constraint database for patient consultation simulation.
[0039] The certificate type constraint library includes multiple certificate type constraint units. For the k-th certificate type, its certificate type constraint unit is represented as: Z k ={C k G k N k Q k R k};
[0040] Among them, Z k C represents the k-th certificate type; k This is a set of core symptoms for this syndrome type, used to record the symptoms that constitute the main diagnostic basis for this syndrome type; G k This is a set of common symptoms for this syndrome type, used to record non-specific symptoms that may appear simultaneously in multiple syndrome types; N k This is a set of interfering symptoms used to record subjective symptoms that are weakly related to or unrelated to the syndrome type, but may be expressed by patients in actual consultations; Q k This is a symptom trigger table used to describe the correspondence between the content of the medical history and the symptoms; R k These are consultation constraint rules used to limit symptom combinations, symptom strength, proportion of interfering symptoms, and range of conflicting symptoms.
[0041] The symptom trigger table Q k Represented as: Q k ={(s i T i )|s i ∈C k ∪G k ∪N k}
[0042] Among them, s i T represents the i-th symptom in the syndrome constraint unit; i Indicates symptoms s i The corresponding set of trigger questions. Each set of trigger questions includes direct questions, synonymous questions, and vague questions set for the same symptoms.
[0043] For example, for the symptom of "poor appetite," direct questions could include "How is your appetite lately?", synonymous questions could include "Have you been eating a lot lately?", and vague questions could include "Are you experiencing any discomfort related to eating?". For the symptom of "loose stools," direct questions could include "Are your stools loose?", synonymous questions could include "Are your stools formed?", and vague questions could include "How have your bowel movements been lately?"
[0044] The consultation constraint rules (R_k) are used to limit the symptom combination relationships, symptom strength relationships, core symptom coverage, proportion of interfering symptoms, and range of conflicting symptoms under the corresponding syndrome type. The consultation constraint rules for different syndrome types are associated and stored with the corresponding core symptom set, common symptom set, and interfering symptom set, respectively.
[0045] In this step, the large language model is used to perform structured parsing of the syndrome text. However, the syndrome name, symptom category and symptom correspondence obtained from the parsing can be limited by the pre-set syndrome data before being written into the syndrome constraint database, so that the symptom content in the syndrome constraint database is consistent with the TCM syndrome data.
[0046] S2, determine the target syndrome type, select symptoms from each symptom set according to the corresponding consultation constraint rules, generate a target patient symptom profile that meets the core symptom coverage condition, the interfering symptom proportion condition, and the conflicting symptom exclusion condition, and generate a patient-specific description of each symptom.
[0047] Specifically, this involves determining the target syndrome Z corresponding to this patient consultation simulation from the syndrome type constraint library. t Where t represents the index of the target certificate type in the certificate type constraint library, and the target certificate type Z is read. t The corresponding core symptom set C t Common Symptom Set G t Interference symptom set N t and consultation constraint rules R t Symptoms were selected from the three symptom sets to form a core symptom subset, a common symptom subset, and a interference symptom subset.
[0048] Target patient symptom profile S p Represented as: S p =C * ∪G * ∪N * ;
[0049] Among them, C * G represents a subset of the core symptoms actually possessed by the target patients. * N represents a subset of common symptoms actually present in the target patients. * This refers to a subset of the interfering symptoms actually present in the target patient.
[0050] To ensure that the generated symptom profile of the target patient does not deviate from the target syndrome type, the consultation constraint rule R is followed. t Constrain the symptom profile.
[0051] The core symptom subset should satisfy: ;
[0052] The subset of interfering symptoms should satisfy: ;
[0053] Among them, C * Indicates the number of symptoms in the core symptom subset; C t N represents the number of symptoms in the core symptom set of the target syndrome; * S represents the number of symptoms in the subset of interfering symptoms; p This indicates the total number of symptoms in the symptom profile of the target patient; The preset core symptom coverage threshold; This is the preset threshold for the proportion of interfering symptoms.
[0054] When generating a symptom profile for a target patient, core symptoms are first selected from the core symptom set, and the coverage ratio of these core symptoms is calculated. When the core symptom coverage ratio is less than... Continue to supplement symptoms from the core symptom set until the core symptom coverage criteria are met.
[0055] Subsequently, corresponding symptoms are selected from the common symptom set and the interfering symptom set, and the proportion of interfering symptoms in the target patient's symptom profile is calculated. When the proportion of interfering symptoms is greater than... At the same time, reduce the number of interfering symptoms until the condition for the proportion of interfering symptoms is met.
[0056] At the same time, the selected symptoms are checked for conflicts according to the consultation constraint rules. If a candidate symptom falls within the range of conflicting symptoms corresponding to the target syndrome, or if the candidate symptom does not meet the preset symptom combination relationship with the selected core symptoms, then the candidate symptom will not be added to the target patient's symptom profile.
[0057] Once the symptom profile of the target patient is determined, a patient-specific description is generated for each symptom in the target patient's symptom profile using a large language model. The patient-specific description includes the presence or absence of symptoms, severity, duration, triggers, aggravating factors, alleviating factors, accompanying manifestations, and natural language expression.
[0058] For example, for the structured symptom "poor appetite", the generated patient description could be "I haven't had a good appetite lately, and I don't want to eat anymore after eating just a little bit each time"; for the structured symptom "loose stools", the generated patient description could be "My stools are not very formed and are sometimes loose"; for the structured symptom "fatigue", the generated patient description could be "I get tired easily lately, and I feel weak after a little activity".
[0059] The patient-specific description is only used to change the way symptoms are expressed, and does not change the category and basic attributes of the symptoms in the target patient's symptom profile.
[0060] S3 initializes the patient agent based on the patient's basic information and the target patient's symptom profile, and establishes a symptom disclosure status record for each symptom, including the trigger question, disclosure status, and disclosure round.
[0061] Specifically, this involves obtaining basic patient information (P). This basic patient information includes age, gender, chief complaint, course of illness, and necessary life background.
[0062] Based on the patient's basic information P and the target patient's symptom profile S p Initialize the patient agent, which is represented as follows:
[0063] Agent = {P, S} p ,D};
[0064] Where Agent represents the patient's intelligent agent; P represents the patient's basic information; S p D represents the symptom profile of the target patient; D represents the symptom disclosure status table.
[0065] Targeted patient symptom profile S p Each symptom in i Establish corresponding symptom disclosure status records D i , is represented as:
[0066] D i= {s i type i level i T i status i ,round i};
[0067] Among them, s i Indicates symptoms; type i This indicates the symptom type, which includes core symptoms, common symptoms, and interfering symptoms; level i Indicates the severity of symptoms; T i This represents the set of triggering questions corresponding to this symptom; status i Indicates the disclosure status of the symptom; round i This indicates the disclosure round corresponding to the symptom.
[0068] Symptom disclosure status can include undisclosed and disclosed status. During patient agent initialization, only the patient's chief complaint or necessary background information is initially disclosed. All symptoms in the target patient's symptom profile other than those mentioned in the chief complaint are set to undisclosed status, i.e., status. i =0; For symptoms that have not yet been disclosed in the initial state, their disclosure round status i Specific rounds are not recorded. After the patient's intelligent agent is initialized, the patient's chief complaint and necessary background information are written into the initially disclosed content, serving as the historical information basis for subsequent rounds of consultations.
[0069] S4, semantically match the current round of consultation content with the triggering questions for each symptom to obtain the set of symptoms that can be disclosed in this round;
[0070] In the r-th round of consultation, receive the current round of consultation content q input by the user. r and the content of the current round of consultations q r The set of trigger questions T corresponding to each symptom in the target patient's symptom profile. i Perform semantic matching.
[0071] The set of symptoms triggered in this round O rRepresented as:
[0072] O r ={s i |s i ∈S p match(q) r T i )=1};
[0073] Among them, O r This represents the set of symptoms that can be disclosed in the current round of consultation (round r); s i ∈S p This indicates that the symptoms included in the matching are limited to the symptom profile of the target patient; match(q) r T i ) represents the matching relationship between the current round of consultation content and the set of symptom-triggered questions; when match(q r T i When )=1, it means that the content of the current round of consultation has successfully matched the set of trigger questions for the corresponding symptoms.
[0074] Semantic matching can identify the semantic correspondence between the content of the consultation and direct, synonymous, or ambiguous questions. The matching process only occurs within the target patient's symptom profile S. p It operates within the scope of included symptoms and does not call symptoms from other syndrome constraint units in the syndrome constraint library.
[0075] When the current round of consultation content triggers multiple symptoms simultaneously, all successfully matched symptoms will be added to the set of symptoms that can be disclosed in this round. r If the content of the current round of consultation does not match the symptoms in the symptom profile of the target patient, the set of symptoms that can be disclosed in this round is empty.
[0076] S5 inputs the current round of consultation content, patient basic information, historically disclosed content, and the set of symptoms that can be disclosed in this round into the patient agent to generate the patient's answer. Symptoms that have not been triggered and have not been disclosed are not included in the current round of input.
[0077] Specifically, this involves obtaining historically disclosed information (E) after the (r-1)th round of consultations. r-1 q will be the content of the current round of consultations. r Patient basic information (P), previously disclosed information (E) r-1 And the set of symptoms that can be disclosed in this round O r Input the patient's AI agent and generate the patient's response A in the r-th round. r , represented as: A r =LLM(q r P, E r-1 O r );
[0078] Among them, A rrepresents the patient's response in the r-th round; LLM() represents the large language model generation function.
[0079] When constructing the current round of input content for the large language model, only the set of disclosable symptoms O in this round is included. r The patient-specific descriptions, basic patient information, and previously disclosed data for each symptom are input into the large language model. For symptoms in the target patient's symptom profile that are not disclosed and are not triggered by the current round of consultation, their symptom names, symptom attributes, and patient-specific descriptions are not input into the large language model in this round.
[0080] The patient's AI agent generates responses in the following manner.
[0081] When the current round of consultation triggers a symptom that is not disclosed in the target patient's symptom profile, the corresponding patient-specific description is used to generate an answer.
[0082] When the current round of consultation triggers a disclosed symptom, an answer consistent with the previous content is generated based on existing answers corresponding to that symptom in the previously disclosed content.
[0083] When the current round of consultation does not trigger any symptoms in the target patient's symptom profile, an answer is generated based on the patient's chief complaint, basic patient information, or negative statements, and other symptoms that are not yet disclosed are not invoked.
[0084] For example, when a user asks about symptoms that do not fall within the target patient's symptom profile, the patient agent can answer "This is not obvious" or "I don't feel particularly uncomfortable in this regard," without automatically adding symptoms outside the target patient's symptom profile.
[0085] S6 updates the disclosure status and disclosure round of the symptoms that can be disclosed in this round, and proceeds to the next round of consultation if the termination conditions are not met.
[0086] After the r-th round of patient responses are generated, the set of symptoms that can be disclosed in this round, O, will be... r Incorporate previously disclosed symptom sets into the updated previously disclosed symptom set E. r Represented as:
[0087] E r =E r-1 ∪O r ;
[0088] Regarding the set of disclosable symptoms in this round O r For symptoms disclosed for the first time, the disclosure status of the corresponding symptoms will be updated from undisclosed to disclosed, i.e.:
[0089] status i =1;
[0090] Among them, statusi =1 indicates symptoms s i This has already been disclosed during the consultation process, and the consultation round corresponding to the first disclosure of this symptom has been written into the round. i .
[0091] For symptoms that have already been disclosed and are triggered again in this round, their disclosure status will remain as disclosed, and responses will be generated based on previously disclosed content. For undisclosed symptoms that are not included in the set of disclosable symptoms in this round, their status will remain unchanged. i =0.
[0092] After updating the symptom disclosure status, it is determined whether the preset termination conditions are met. These preset termination conditions include the user actively ending the consultation, or the current consultation round reaching a preset number of rounds. If the preset termination conditions are not met, the next round of consultation begins; if the preset termination conditions are met, the current patient consultation simulation ends.
[0093] Example 2: Simulated patient interview with spleen qi deficiency syndrome as the target syndrome
[0094] Based on Example 1, this embodiment takes spleen qi deficiency syndrome as the target syndrome type and further explains the generation of symptom profiles for target patients and the multi-round consultation process.
[0095] Symptom information corresponding to spleen qi deficiency syndrome was extracted from TCM syndrome data to establish a spleen qi deficiency syndrome constraint unit: Z t ={C t G t N t Q t R t};
[0096] Among them, the core symptom set C t Symptoms include poor appetite, postprandial abdominal distension, loose stools, fatigue, shortness of breath, and reluctance to speak; common symptom set G t Includes general sleep and poor mental state; interference symptom set N t Symptoms include mild dry mouth and occasional dizziness.
[0097] Symptom Trigger Table Q t Record each symptom and its corresponding set of trigger questions. For example:
[0098] The set of triggering questions for eating less includes "How is your appetite?", "Do you eat a lot?", "Do you not feel like eating anything?", etc.
[0099] The set of triggering questions for postprandial bloating includes "Does your stomach feel bloated after eating?" and "Do you feel uncomfortable after eating?"
[0100] The set of triggering questions for loose stools includes "How is your stool?", "Is your stool formed?", "Do you have diarrhea?", etc.
[0101] The set of questions that trigger fatigue includes "Are you easily tired lately?", "Do you feel weak?", "How do you feel after an activity?", etc.
[0102] Consultation constraint rule R t Record the core symptom coverage threshold corresponding to spleen qi deficiency syndrome Threshold for the proportion of interfering symptoms The relationship between the severity of symptoms and the scope of conflicting symptoms.
[0103] From the core symptom set C t The symptoms of poor appetite, postprandial abdominal distension, loose stools, and fatigue are:
[0104] C * ={Poor appetite, abdominal distension after meals, loose stools, fatigue};
[0105] From the common symptom set G t Choosing to sleep generally leads to:
[0106] G * ={Sleep is generally normal};
[0107] From the set of interfering symptoms N t The option to occasionally experience dizziness is:
[0108] N * ={Occasionally I feel dizzy};
[0109] The symptom profile of the target patient is as follows:
[0110] S p =C * ∪G * ∪N * ;
[0111] That is: S p ={Poor appetite, abdominal distension after meals, loose stools, fatigue, fair sleep, occasional dizziness};
[0112] In this embodiment, the core symptom set C t It includes 5 symptoms in total, with the core symptom subset C. * It includes 4 symptoms in total, therefore the coverage rate of core symptoms is:
[0113] ;
[0114] The system will compare this ratio with a preset core symptom coverage threshold. Compare and confirm:
[0115] ];
[0116] Target patient symptom profile S pIt includes 6 symptoms in total, with N subsets of interfering symptoms. * Including 1 symptom, the percentage of interfering symptoms is: ;
[0117] The system will compare this ratio with a preset threshold for the proportion of interfering symptoms. Compare and confirm: ;
[0118] When the above two constraints are met, and the selected symptoms do not fall within the range of conflicting symptoms recorded in the consultation constraint rule (R_t), the symptom profile of the target patient is determined.
[0119] Generate patient-specific descriptions for the symptoms in the target patient's symptom profile. For example:
[0120] The patient-specific description of poor appetite is "I haven't had a good appetite lately, and I don't want to eat anymore after eating just a little bit";
[0121] The patient-specific description of postprandial abdominal bloating is "My stomach tends to bloat after eating, but it will ease up a little after a while."
[0122] The patient-specific description of loose stools is "the stool is not well formed and is sometimes loose";
[0123] The patient-specific description of fatigue is "I get tired easily lately, and I feel listless after doing even a little bit of work";
[0124] The typical patient description of sleep is "I can fall asleep at night, but I don't sleep very well";
[0125] The patient's description of occasional dizziness is "sometimes I feel a little dizzy, but it doesn't happen often."
[0126] Patient basic information P: Female, 35 years old, chief complaint: "poor appetite and easy fatigue recently", duration of illness: about two weeks.
[0127] Initialize the patient agent based on the patient's basic information and the target patient's symptom profile:
[0128] Agent = {P, S} p ,D};
[0129] Taking "poor appetite" as an example, the symptom disclosure status record is as follows:
[0130] D 1= {s1, type1, level1, T1, status1, round1};
[0131] Among them, s1 is poor appetite; type1 is the core symptom; level1 is moderate; T1 includes triggering questions such as "How is your appetite?", "Do you eat a lot?", and "Do you have any loss of appetite?"; initially: status1=0; other symptoms that are not initially disclosed through the chief complaint are also set to undisclosed status.
[0132] In the first round of consultation, the user inputs: q1={“How is your appetite lately?”} This consultation content matches the set of trigger questions corresponding to “poor appetite”, therefore: match(q1, T1)=1; The set of symptoms that can be disclosed in this round is: O1={poor appetite};
[0133] Input q1, patient basic information P, initial disclosed content E0, and the set of symptoms that can be disclosed in this round O1 into the patient agent: A1=LLM(q1,P,E0,O1);
[0134] The patient agent generates the response: "I haven't had a good appetite lately, and I don't want to eat anymore after eating just a little." After the response is generated, the historical set of disclosed symptoms is updated: E1=E0∪O1; the disclosure status of poor appetite is updated to: status1=1; and the disclosure round of poor appetite is recorded as the first round.
[0135] In the second round of consultation, the user inputs "How are your bowel movements?" This question matches the set of trigger questions corresponding to "loose stools." The set of symptoms that can be disclosed in this round is: O2 = {loose stools};
[0136] The patient agent generates a response based on the patient-specific description of loose stool: "The stool is not very formed, and sometimes it is loose." After the response is generated, E2 is updated to E1∪O2; the disclosure status of loose stool is updated to disclosed, and the disclosure round is recorded as the second round.
[0137] In the third round of consultation, the user entered "Does my stomach feel bloated after eating?" This question triggered postprandial bloating, and the patient agent replied, "My stomach tends to feel bloated after eating, but it gets a little better after a while." Postprandial bloating was then added to the historical disclosed symptom set, and its disclosure status and disclosure round were updated.
[0138] In the fourth round of consultation, the user entered "Have you been getting tired easily lately?" This question triggered fatigue, and the patient AI agent replied, "I've been getting tired easily lately, and I feel listless after doing even a little bit of work." Fatigue was then added to the historical set of disclosed symptoms, and its disclosure status and disclosure round were updated.
[0139] In the fifth round of consultation, the user asked again, "Do you eat a lot these days?" The system determined that this question triggered the previously disclosed symptom "reduced appetite." The patient's AI agent retrieved information related to reduced appetite from the previously disclosed content and answered, "I still don't eat much; I only eat a little and then I don't feel like eating anymore." This answer was consistent with the reduced appetite symptom disclosed in the first round, and no other undisclosed symptoms were re-invoked.
[0140] If a user asks "Do you have a noticeable bitter taste in your mouth?", and "bitter taste in the mouth" is not a symptom profile of the target patient, then... p If the patient's basic information and negative statement are not disclosed, then bitter taste in the mouth cannot be included in the set of symptoms that can be disclosed in this round of consultation. The patient's agent answers: "No obvious bitter taste in the mouth".
[0141] If, during the above consultation process, the user does not ask any questions related to "occasional dizziness," then the occasional dizziness will remain undisclosed, the patient description will not be entered into the input of the large language model in each round, and the patient agent will not proactively disclose the symptom.
[0142] The patient consultation simulation ends when the user actively ends the consultation or when the preset consultation rounds are reached.
[0143] In this embodiment, the symptoms disclosed by the patient's intelligent agent are always limited to the symptom profile of the target patient corresponding to spleen deficiency syndrome; the timing of disclosure of different symptoms is controlled by the set of symptom trigger questions; the disclosed information is recorded by the symptom disclosure status and disclosure round; and the input content of the large language model in this round is limited to prevent untriggered symptoms from appearing prematurely and to ensure that the answers to the same symptom are consistent in multiple rounds of consultation.
[0144] The foregoing has only described certain exemplary embodiments of the present invention by way of illustration. Undoubtedly, those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the foregoing drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.
Claims
1. A method for generating simulated patient dialogue based on TCM syndrome type constraints, characterized in that, Includes the following steps: S1, perform structured parsing of TCM syndrome texts, and establish a syndrome constraint library including a core symptom set, a common symptom set, a distracting symptom set, a symptom trigger table, and consultation constraint rules; S2, determine the target syndrome type, select symptoms from each symptom set according to the corresponding consultation constraint rules, generate a target patient symptom profile that meets the core symptom coverage condition, the interfering symptom proportion condition, and the conflicting symptom exclusion condition, and generate a patient-specific description of each symptom. S3 initializes the patient agent based on the patient's basic information and the target patient's symptom profile, and establishes a symptom disclosure status record for each symptom, including the trigger question, disclosure status, and disclosure round. S4, semantically match the current round of consultation content with the triggering questions for each symptom to obtain the set of symptoms that can be disclosed in this round; S5 inputs the current round of consultation content, patient basic information, historically disclosed content, and the set of symptoms that can be disclosed in this round into the patient agent to generate the patient's answer. Symptoms that have not been triggered and have not been disclosed are not included in the current round of input. S6 updates the disclosure status and disclosure round of the symptoms that can be disclosed in this round, and proceeds to the next round of consultation if the termination conditions are not met.
2. The method for generating simulated patient dialogue based on TCM syndrome type constraints according to claim 1, characterized in that, The syndrome constraint library establishes a syndrome constraint unit for each syndrome. Each syndrome constraint unit includes a core symptom set, a common symptom set, a set of interfering symptoms, a symptom trigger table, and consultation constraint rules. The symptom trigger table consists of a set of symptoms and their corresponding trigger questions. The consultation constraint rules record the core symptom coverage threshold, the proportion threshold of interfering symptoms, the strength relationship of symptoms, and conflicting symptoms that are incompatible with the corresponding syndrome type, so that the generation of the target patient's symptom profile is constrained by both the symptom category and the symptom combination relationship.
3. The method for generating simulated patient dialogue based on TCM syndrome type constraints according to claim 2, characterized in that, When generating the symptom profile of the target patient, a subset of core symptoms, a subset of common symptoms, and a subset of interfering symptoms are selected from the core symptom set, the common symptom set, and the interfering symptom set of the target syndrome, respectively. The symptom profile of the target patient is then composed of these subsets. The ratio of the number of symptoms contained in the core symptom subset to the number of symptoms contained in the core symptom set of the target syndrome is not less than the core symptom coverage threshold, the ratio of the number of symptoms contained in the interference symptom subset to the total number of symptoms contained in the target patient symptom profile is not higher than the interference symptom proportion threshold, and the target patient symptom profile does not contain the conflicting symptoms.
4. The method for generating simulated patient dialogue based on TCM syndrome type constraints according to claim 3, characterized in that, For each symptom in the target patient's symptom profile, a patient-specific description is generated, and the symptom, symptom category, symptom severity, patient-specific description, set of triggering questions, disclosure status, and disclosure round are associated to form a corresponding symptom disclosure status record; the patient-specific description includes at least two of the following: presence or absence of symptom, severity, duration, triggering factors, aggravating factors, relieving factors, accompanying manifestations, and natural language expression.
5. The method for generating simulated patient dialogue based on TCM syndrome type constraints according to claim 4, characterized in that, The set of triggering questions includes direct questions, synonymous questions, and ambiguous questions set for the same symptom; When performing semantic matching, only the content of the current round of consultation is matched with the set of trigger questions corresponding to each symptom in the symptom profile of the target patient. One or more symptoms that are successfully matched are added to the set of symptoms that can be disclosed in this round. Symptoms that are not in the symptom profile of the target patient are not added to the set of symptoms that can be disclosed in this round.
6. The method for generating simulated patient dialogue based on TCM syndrome type constraints according to claim 5, characterized in that, When initializing the patient's intelligent agent, the patient's chief complaint or necessary background information is set as the initial disclosable content, and the symptoms in the target patient's symptom profile other than the initial disclosable content are set as undisclosed. In any round of consultation, only the patient-specific descriptions of the symptoms that can be disclosed in this round and the previously disclosed content are input into the patient's AI agent. Symptoms in the target patient's symptom profile that are not disclosed and are not triggered by the current round of consultation content, as well as their patient-specific descriptions, are not input into the patient's AI agent.
7. The method for generating simulated patient dialogue based on TCM syndrome type constraints according to claim 6, characterized in that, The patient agent generates the patient's response in the following manner: When the current round of consultation triggers an undisclosed symptom, the corresponding patient description is used to generate an answer; when the current round of consultation triggers a disclosed symptom, existing answer information corresponding to that symptom in the historical disclosed content is used to generate an answer. If the current round of consultation does not trigger any symptoms in the target patient's symptom profile, an answer will be generated based solely on the patient's chief complaint, basic patient information, or negative statements regarding the current round of consultation.
8. The method for generating simulated patient dialogue based on TCM syndrome type constraints according to claim 7, characterized in that, After each round of patient responses is generated, the symptoms that can be disclosed in this round are added to the historical set of disclosed symptoms, the disclosure status of the corresponding symptom is updated from undisclosed to disclosed, and the consultation round corresponding to the first or second disclosure of the symptom is recorded. When a previously disclosed symptom is triggered again during a subsequent consultation, a patient response consistent with the previous response is generated based on the symptom's disclosure cycle and historical disclosed content, instead of re-invoking other symptoms that are currently undisclosed.