A dynamic emotional doctor-patient communication dialogue generation method and system based on a large language model

By defining emotion tags and conversion rules, the system analyzes doctor-patient dialogues in real time and generates emotionally rich patient responses, solving the problem of monotonous emotions in existing systems. This provides a high-quality communication training environment and improves doctors' communication skills.

CN122136035APending Publication Date: 2026-06-02INSPUR ENTERPRISE CLOUD TECHNOLOGY (SHANDONG) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INSPUR ENTERPRISE CLOUD TECHNOLOGY (SHANDONG) CO LTD
Filing Date
2026-02-26
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing doctor-patient communication systems based on large language models cannot simulate the emotional changes of real patients, resulting in a lack of emotional color and realism in communication, and making it difficult to provide a high-quality communication training environment.

Method used

By defining typical doctor-patient communication scenarios, emotion tags, and transition rules, the system analyzes dialogue content in real time, dynamically determines emotional states, and encodes them into prompt words for a large language model to generate emotionally rich patient responses.

Benefits of technology

It achieves realistic and dynamic simulation of patients' emotions, ensures professional and reasonable communication responses, provides a high-fidelity, low-cost communication training environment, and improves the effectiveness of doctors' communication skills training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122136035A_ABST
    Figure CN122136035A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for generating dynamic, emotionalized doctor-patient communication dialogues based on a large language model, belonging to the fields of artificial intelligence and medical education technology. The method includes: defining typical doctor-patient communication scenarios and basic emotion tags; establishing quantifiable intensity models for emotions; automatically mapping from keywords to emotion tags based on dialogue content; defining emotion conversion rules; real-time parsing of doctor-patient dialogue content; identifying the emotion types and specific doctor-patient communication scenarios involved in the current dialogue; outputting structured context objects; based on the context analysis results, applying preset emotion conversion rules, dynamically deciding the emotional state that the system should present, and outputting quantified objects of each emotion; encoding the state and the output quantified emotion objects into prompt words for the large language model, guiding the model to generate emotionally charged responses. This invention can provide doctors with a high-fidelity, repeatable, and low-cost communication training environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and medical education technology, specifically a method and system for generating dynamic and emotional doctor-patient communication dialogues based on a large language model. Background Technology

[0002] Doctor-patient communication is a core aspect of healthcare services. High-quality communication helps build trust between doctors and patients, improves patient compliance, and reduces medical risks. However, high-quality communication skills are an advanced skill that requires repeated practice. Traditional medical student communication skills training mainly relies on standardized patient role-playing, which is costly and difficult to scale up. With breakthroughs in natural language processing using large language models, AI-based standardized patient systems have emerged. These systems have a fundamental flaw: doctor-patient dialogue is characterized by neutral tone and simplistic emotions, lacking genuine emotional color and dynamic changes. These systems cannot simulate the shock and fear a real patient feels upon receiving bad news, the emotional relief upon hearing comforting words, or the frustration and anger felt when neglected. Summary of the Invention

[0003] The technical objective of this invention is to address the above-mentioned shortcomings by providing a method and system for generating dynamic and emotional doctor-patient communication dialogues based on a large language model. This method can generate more realistic and emotionally rich patient dialogues, providing doctors with a high-fidelity, repeatable, and low-cost communication training environment.

[0004] The technical solution adopted by this invention to solve its technical problem is: A method for generating dynamic, emotional doctor-patient communication dialogues based on a large language model, the implementation of which includes: (1) Define typical doctor-patient communication scenarios and basic emotion tags, establish a quantifiable intensity model for emotions, realize automatic mapping from keywords to emotion tags based on dialogue content, and define emotion conversion rules; (2) Analyze the doctor-patient dialogue content in real time, identify the emotional types and specific doctor-patient communication scenarios involved in the current dialogue, and output structured context objects; (3) Based on the context analysis results, apply the preset emotion conversion rules, dynamically decide the current emotional state that the system should present, and output the quantitative objects of each emotion; (4) Encode the state and output emotion quantification objects into prompt words of the large language model to guide the large model to generate responses with emotional color.

[0005] Furthermore, the implementation of step (1) includes: Define a series of emotional labels that may appear in doctor-patient communication, including anxiety, doubt, fear, defensiveness, frustration, gratitude, confusion, optimism, etc. Build an emotional state model; Dialogue Content - Emotion Label Mapping: Based on the dialogue content, keywords, diseases, and dialogue history are mapped to emotion labels; for example, when a doctor mentions keywords such as "surgery" or "late stage," the emotion label "fear" or "anxiety" is triggered; when a chronic disease is diagnosed, the emotion label "frustration" is triggered; if the doctor interrupts the patient multiple times, the emotion label "anger" is triggered. Establish doctor-patient communication scenarios: These should include at least the following scenarios: taking medical history, delivering bad news, discussing treatment plans, and doctors providing empathetic responses; Establish rules for mood transition, including triggering conditions and actions to be taken.

[0006] Furthermore, the emotional state model uses a data structure to represent it: {emotion label, intensity value}; where the intensity value is an integer that can vary within a predefined range, with a larger value indicating a higher intensity of the emotion. The intensity value can be set to a range of 0-10, where 0 represents no emotion and 10 represents the highest intensity.

[0007] Furthermore, the doctor-patient communication scenario is described or triggered by the following conditions: Medical history taking: The doctor asks the patient for basic information, including symptoms, medical history, and lifestyle habits; the atmosphere is usually quite routine. Bad news: A doctor delivers a serious, unexpected, or life-threatening diagnosis to the patient (such as cancer or a poor prognosis). Discussing treatment options: The doctor explains the advantages, disadvantages, risks, and effects of different treatment options (such as surgery and chemotherapy) to the patient; Empathic response from doctors: Doctors respond to patients' emotional distress using understanding, comforting, and supportive language; The emotion transition rules include: Rule R-01: Scene Initialization: Trigger condition: Entering a new main scene; Perform the action: Set the basic emotional state for the current scene; For example, when the scene changes to <bad news notification>, the system immediately sets the emotional state to {shock:8, fear:7, anxiety:6}; Rule R-02: Keyword Triggering Rule: Triggering condition: Words belonging to a specific set of keywords are detected in the text entered by the doctor; Action to execute: Based on the sentiment valence of the keywords, immediately adjust the intensity value of the corresponding sentiment; the adjustment range is either a preset fixed value or a value calculated based on the context. Negative word trigger: If any of the words [late stage, metastasis, malignancy, recurrence] are detected, the intensity of {fear} increases by 3 and the intensity of {anxiety} increases by 2. Empathic word trigger: If any word from the word set [I understand, don't worry, we're together, it's not easy] is detected, the intensity of all currently active negative emotions (such as fear, anxiety) is reduced by 2.

[0008] Uncertainty word trigger: If the frequency of the word set [possible, not necessarily, let's see, hard to guarantee] is greater than 1 time, then the {confusion} intensity is increased by 3. Rule R-03: Emotional Decay Rule Triggering condition: After each round of dialogue ends, and no other strong emotion rules are triggered; Action: All currently active emotion intensity values ​​naturally decrease by 1 point; this rule simulates the psychological phenomenon of human emotions naturally calming down over time, preventing emotions from accumulating indefinitely and ensuring dynamic change. Rule R-04: Rules for Emotional Escalation and Transformation Triggering condition: The intensity of a specific negative emotion remains high (exceeding the threshold) in multiple consecutive conversation rounds and is not effectively alleviated; Execution action: Triggering a qualitative change in emotions, transforming one emotion into another, stronger or related emotion; For example, if the intensity of the emotion {anxiety} is greater than 7 for three consecutive rounds, the system has a 70% probability of converting {anxiety} into {anger}, with an initial intensity set to 6. This simulates the anger that may erupt after long-term unresolved anxiety. Rule R-05: Rule for the generation of complex emotions: Triggering condition: Two or more non-mutually exclusive emotions reach a moderate or higher intensity (e.g., >4) at the same time. Action execution: The system identifies the current state as "complex emotion" and performs special processing when generating prompts.

[0009] For example, when both {hope:5} and {fear:6} are present, the emotional expression generation module will construct a compound instruction like this: "You are comforted by the glimmer of hope, but also filled with fear of the treatment process and its outcome." This guides the large model to generate more profound and realistic responses.

[0010] Furthermore, step (2) involves collecting and analyzing the doctor's input text to generate a contextual feature object containing situational tags and emotional keyword information; specifically, this includes: Keyword matching layer: This layer quickly scans the input doctor's text and identifies high-risk keywords.<A、B> For example: <Late-stage lung cancer with metastasis>; Context recognition: Combining the high-risk keywords and sentence semantics, the current dialogue scenario is determined to be <bad news notification>; The final output object is as follows: Context tag: bad news delivery, keywords hit:<A、B>}

[0011] Further, step (3) involves receiving the context feature object and dynamically calculating and updating the quantitative data representing the patient's current emotional state according to a preset rule base and predefined rules; specifically, this includes: Step 1: The state machine recognizes the scenario as a "bad news notification" scenario, triggers rule R-01, and prepares to set the basic sentiment value for this scenario; Step 2: Based on the high-risk keywords found in step (2)<A、B> For example, the rule <Advanced Lung Cancer, Metastasis> and the <Dialogue Content-Emotion Label Mapping> in the rule base set the basic emotions as {Shock: 8, Fear: 7, Anxiety: 6}; Step 3: Rule rematch. The state machine finds the keywords <late-stage lung cancer, metastasis> given by the context analyzer, which further triggers the "negative word trigger" sub-rule in rule R-02, that is: if such words are detected, the fear intensity increases by 3 and the anxiety intensity increases by 2. Step 4: Conflict Resolution and Calculation: The state machine executes the following rules: First, apply the R-01 rule to set the state to {Shock: 8, Fear: 7, Anxiety: 6}; then, apply the R-02 rule to adjust the state based on the above: Fear = 7 + 3 = 10 (reaching the upper limit), Anxiety = 6 + 2 = 8; finally, calculate the new current emotion value: {Shock: 8, Fear: 10, Anxiety: 8}.

[0012] Furthermore, in step (4), the updated quantitative emotion data is converted into a natural language emotion description instruction, the emotion description instruction is concatenated with the doctor's original input text to form the final prompt word, and then input into the large language model to generate and output the patient's response with emotional color.

[0013] This invention also claims a dynamic, emotional doctor-patient communication dialogue generation system based on a large language model, comprising: An emotion rule base is used to define typical doctor-patient communication scenarios and basic emotion tags, establish quantifiable intensity models for emotions, and achieve automatic mapping from keywords to emotion tags based on dialogue content, as well as define emotion conversion rules. Context analyzer: Used to receive and deeply analyze the dialogue between doctors and patients in real time, transforming unstructured natural language text into structured objects that can be used by the emotion state machine for decision-making. It adopts a hierarchical processing architecture to understand the dialogue from shallow to deep. Emotional state machine: used to calculate and update the patient's emotional state in real time based on the objects provided by the context analyzer and the emotion transition rules in the rule base; Emotion Expression Generator: Used to encode the state and output emotion quantification objects into prompt words for large language models, guiding the large models to generate responses with emotional coloring; This system can implement the methods described above.

[0014] The present invention also claims a device for generating dynamic and emotional doctor-patient communication dialogues based on a large language model, comprising: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is used to call the machine-readable program to implement the above method.

[0015] The present invention also claims a computer-readable medium storing computer instructions that, when executed by a processor, enable the implementation of the above-described method.

[0016] Compared with existing technologies, the dynamic and emotional doctor-patient communication dialogue generation method and system based on a large language model of the present invention have the following advantages: 1. Realistic and dynamic emotions: Through the emotional state machine and built-in evolution rules (such as decay and escalation), the patient's emotions evolve continuously and naturally with the conversation, which completely overcomes the mechanical and abrupt defects of existing technologies and simulates a strong sense of realism.

[0017] 2. Professional and Rational Response: Based on preset scenarios and a medical keyword rule base, emotions are triggered to ensure that emotional responses always match the professional context of doctor-patient communication, avoiding mismatch between emotions and scenarios, and guaranteeing the professionalism and effectiveness of the training.

[0018] 3. Highly efficient and scalable system: The system adopts a modular architecture that separates perception, decision-making, and execution, allowing each part of the system to be independently optimized and upgraded. It is easy to adapt to the training needs of different specialties and has excellent maintainability and scalability.

[0019] 4. Improve training quality: Ultimately, it provides doctors with a high-fidelity, repeatable, and low-cost communication training environment, which can effectively practice key skills such as empathy and delivering bad news, thereby fundamentally improving the quality of medical services. Attached Figure Description

[0020] Figure 1 This is a flowchart illustrating the dynamic and emotional doctor-patient communication dialogue generation method based on a large language model provided in this embodiment of the invention. Figure 2This is a diagram illustrating the architecture of a dynamic, emotional doctor-patient communication dialogue generation system based on a large language model, provided in an embodiment of the present invention. Detailed Implementation

[0021] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0022] A method for generating dynamic, emotional doctor-patient communication dialogues based on a large language model, the implementation of which includes: (1) Define typical doctor-patient communication scenarios and basic emotion tags, establish a quantifiable intensity model for emotions, realize automatic mapping from keywords to emotion tags based on dialogue content, and define emotion conversion rules; (2) Analyze the doctor-patient dialogue content in real time, identify the emotional types and specific doctor-patient communication scenarios involved in the current dialogue, and output structured context objects; (3) Based on the context analysis results, apply the preset emotion conversion rules, dynamically decide the current emotional state that the system should present, and output the quantitative objects of each emotion; (4) Encode the state and output emotion quantification objects into prompt words of the large language model to guide the large model to generate responses with emotional color.

[0023] This method is implemented through the synergistic action of the following four modules: I. Emotion Rule Base 1. Emotional Labels: Define a series of emotional labels that may appear in doctor-patient communication, including [anxiety, doubt, fear, defensiveness, frustration, gratitude, confusion, optimism], etc.

[0024] 2. Emotional State Model: A data structure is used to represent this: {emotion label, intensity value}. The intensity value is an integer that can vary within a predefined range; a higher value indicates a stronger emotion. In this embodiment, the intensity value range is set to 0-10, where 0 represents no emotion and 10 represents the highest intensity.

[0025] 3. Dialogue Content - Emotion Tag Mapping: Based on the dialogue content, keywords, disease, and dialogue history are mapped to emotion tags. In this embodiment, when the doctor mentions keywords such as "surgery" or "late stage," the emotion tag "fear" or "anxiety" is triggered; when a chronic disease is diagnosed, the emotion tag "frustration" is triggered; and if the doctor interrupts the patient multiple times, the emotion tag "anger" is triggered.

[0026] 4. Doctor-patient communication scenarios: should include at least the four scenarios shown in Table 1 below: Table 1. Doctor-patient communication scenarios

[0027] 5. Emotional transition rules: consist of two parts: "triggering conditions" and "actions to be performed".

[0028] Rule R-01: Scene initialization.

[0029] Triggering condition: Entering a new main scene.

[0030] Perform the action: Set the basic emotional state for the current scene.

[0031] Example: When the scene switches to <Bad News Information>, the system immediately sets the emotional state to {Shock:8, Fear:7, Anxiety:6}.

[0032] Rule R-02: Keyword triggering rule.

[0033] Triggering condition: Words belonging to a specific set of keywords are detected in the text entered by the doctor.

[0034] Action performed: Immediately adjust the intensity of the corresponding emotion based on the sentiment valence of the keywords. The adjustment range can be a preset fixed value or a value calculated based on the context.

[0035] Negative word trigger: If any of the words [late stage, metastasis, malignancy, recurrence] are detected, the intensity of {fear} increases by 3 and the intensity of {anxiety} increases by 2.

[0036] Empathic word trigger: If any word from the word set [I understand, don't worry, we're together, it's not easy] is detected, the intensity of all currently active negative emotions (such as fear, anxiety) is reduced by 2.

[0037] Uncertainty word trigger: If the frequency of the word set [possible, not necessarily, let's see, hard to guarantee] is greater than 1 time, the intensity of {confusion} will be increased by 3.

[0038] Rule R-03: Emotional Decay Rule.

[0039] Triggering condition: After each round of dialogue ends, and no other strong emotion rules are triggered.

[0040] Action: All currently active emotion intensity values ​​naturally decrease by 1 point. This rule simulates the psychological phenomenon of human emotions naturally subsiding over time, preventing emotions from accumulating indefinitely and ensuring dynamic change.

[0041] Rule R-04: Rules for Emotional Escalation and Transformation.

[0042] Triggering condition: The intensity of a specific negative emotion remains high (exceeding the threshold) in multiple consecutive conversation rounds and is not effectively alleviated.

[0043] Execution action: Triggering a qualitative change in emotions, transforming one emotion into another, stronger or related emotion.

[0044] Example: If the intensity value of {anxiety} is >7 for three consecutive rounds, the system has a 70% probability of converting {anxiety} into {anger}, with an initial intensity set to 6. This simulates the anger that may erupt after long-term unresolved anxiety.

[0045] Rule R-05: Rule for generating complex emotions.

[0046] Triggering condition: Two or more non-mutually exclusive emotions reach a moderate or higher intensity (e.g., >4) at the same time.

[0047] Action execution: The system identifies the current state as "complex emotion" and performs special processing when generating prompts.

[0048] Example: When both {hope:5} and {fear:6} are present, the emotional expression generation module constructs a compound instruction as follows: "You are comforted by the glimmer of hope, but also filled with fear about the treatment process and outcome." This guides the large model to generate more profound and realistic responses.

[0049] II. Context Analyzer It is responsible for receiving and deeply analyzing the dialogue between doctors and patients in real time. Its core function is to transform unstructured natural language text into structured objects that can be used by the emotion state machine for decision-making, using a layered processing architecture to understand the dialogue from shallow to deep: Step 1: Keyword matching layer. This layer quickly scans the input doctor's text and identifies high-risk keywords: <late-stage lung cancer, metastasis>.

[0050] Step 2: Context Recognition: Combining these keywords and sentence semantics, determine that the current dialogue context is <informing bad news>.

[0051] The final output object is as follows: {Scenario tag: bad news, keywords: <late-stage lung cancer, metastasis>}.

[0052] III. Emotional State Machine The emotion state machine is the core of realizing the dynamic evolution of emotions. It calculates and updates the patient's emotional state in real time based on objects provided by the context analyzer and emotion transition rules in the rule base. Internally, the state machine maintains the patient's current emotional state. The emotional state includes the primary emotion (the most dominant emotion type, such as {fear: 10}) and a set of secondary emotions (a list containing other coexisting emotions and their intensities, such as {anxiety: 5, confusion: 3}).

[0053] Step 1: The state machine recognizes the scenario as "bad news notification" and triggers rule R-01, preparing to set the basic sentiment value for this scenario.

[0054] Step 2: Based on the keywords <late-stage lung cancer, metastasis> hit by the context analyzer and the <dialogue content-emotion label mapping> rule in the rule base, the state machine sets the basic emotions to {shock: 8, fear: 7, anxiety: 6}.

[0055] Step 3: Rule rematch. The state machine detects that the context analyzer provides the keywords "late-stage lung cancer, metastasis," which triggers the "negative word trigger" sub-rule in rule R-02. The rule stipulates that if such a word is detected, the fear intensity increases by 3, and the anxiety intensity increases by 2.

[0056] Step 4: Conflict Resolution and Calculation: The state machine comprehensively executes these rules: First, applying rule R-01, the state is set to {Shock: 8, Fear: 7, Anxiety: 6}. Next, applying rule R-02, adjustments are made: Fear = 7 + 3 = 10 (reaching the upper limit), Anxiety = 6 + 2 = 8. Finally, the new current emotion value is calculated: {Shock: 8, Fear: 10, Anxiety: 8}.

[0057] IV. Emotional Expression Generator Step 1: The generator "translates" the output of the emotion state machine into a language that the larger model can understand. For example, after receiving emotion values ​​{shock: 8, fear: 10, anxiety: 8}, it might generate an instruction prefix like this: "You are a patient who has just been diagnosed with lung cancer, and you are filled with shock (intensity 8 / 10), extreme fear (intensity 10 / 10), and deep anxiety (intensity 8 / 10). Please respond to the doctor's words with a trembling, hesitant, and slightly desperate tone." Step 2: Send the assembled complete prompt to the large language model interface and obtain the large model's response as the answer.

[0058] This invention also provides a dynamic, emotional doctor-patient communication dialogue generation system based on a large language model, comprising: An emotion rule base is used to define typical doctor-patient communication scenarios and basic emotion tags, establish quantifiable intensity models for emotions, and achieve automatic mapping from keywords to emotion tags based on dialogue content, as well as define emotion conversion rules. Context analyzer: Used to receive and deeply analyze the dialogue between doctors and patients in real time, transforming unstructured natural language text into structured objects that can be used by the emotion state machine for decision-making. It adopts a hierarchical processing architecture to understand the dialogue from shallow to deep. Emotional state machine: used to calculate and update the patient's emotional state in real time based on the objects provided by the context analyzer and the emotion transition rules in the rule base; Emotion Expression Generator: Used to encode the state and output emotion quantification objects into prompt words for large language models, guiding the large models to generate responses with emotional color.

[0059] The emotion rule base defines emotion tags, emotion state models, dialogue content-emotion tag mappings, doctor-patient communication scenarios, and emotion transition rules. The emotion state model uses a data structure: {emotion tag, intensity value}. The intensity value is an integer that can vary within a predefined range; a higher value indicates a stronger emotion. Doctor-patient communication includes at least four scenarios: taking medical history, delivering bad news, discussing treatment plans, and the doctor's empathetic response.

[0060] The analyzer receives and analyzes the doctor's input text, generating a context feature object containing situational labels and emotional keywords.

[0061] The emotional state machine receives the context feature object and dynamically calculates and updates the quantitative data representing the patient's current emotional state according to the preset rule base and predefined rules.

[0062] The emotional expression generator converts the updated quantified emotion data into a natural language emotion description instruction. The emotion description instruction is then concatenated with the doctor's original input text to form the final prompt word, which is then input into the large language model to generate and output a patient response with emotional coloring.

[0063] This system implements the dynamic, emotionalized doctor-patient communication dialogue generation method based on a large language model, as described in the above embodiments, through an emotion rule base, a context analyzer, an emotion state machine, and an emotion expression generator.

[0064] This invention also provides a dynamic and emotional doctor-patient communication dialogue generation device based on a large language model, comprising: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is used to call the machine-readable program to implement the dynamic and emotional doctor-patient communication dialogue generation method based on a large language model as described in the above embodiments.

[0065] This invention also provides a computer-readable medium storing computer instructions. When executed by a processor, the computer instructions cause the processor to perform the dynamic, emotional doctor-patient communication dialogue generation method based on a large language model described in the above embodiments. Specifically, a system or apparatus equipped with a storage medium storing software program code that implements the functions of any of the embodiments described above can be provided, and the computer (or CPU or MPU) of the system or apparatus can read and execute the program code stored in the storage medium.

[0066] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0067] Storage media embodiments for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0068] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0069] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion unit connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion unit execute some and all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0070] The present invention has been shown and described in detail above with reference to the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above embodiments, those skilled in the art will know that more embodiments of the present invention can be obtained by combining the code review methods in the different embodiments. These embodiments are also within the protection scope of the present invention.

Claims

1. A method for generating dynamic, emotional doctor-patient communication dialogues based on a large language model, characterized in that, The implementation of this method includes: (1) Define typical doctor-patient communication scenarios and basic emotion tags, establish a quantifiable intensity model for emotions, realize automatic mapping from keywords to emotion tags based on dialogue content, and define emotion conversion rules; (2) Analyze the doctor-patient dialogue content in real time, identify the emotional types and specific doctor-patient communication scenarios involved in the current dialogue, and output structured context objects; (3) Based on the context analysis results, apply the preset emotion conversion rules, dynamically decide the current emotional state that the system should present, and output the quantitative objects of each emotion; (4) Encode the state and output emotion quantification objects into prompt words of the large language model to guide the large model to generate responses with emotional color.

2. The method for generating dynamic, emotional doctor-patient communication dialogue based on a large language model according to claim 1, characterized in that, The implementation of step (1) includes: Define the various emotional labels that may appear in doctor-patient communication; Build an emotional state model; Dialogue content-emotion tag mapping: Based on the dialogue content, it is mapped to emotion tags according to keywords, diseases and dialogue history; Establish doctor-patient communication scenarios: These should include at least the following scenarios: taking medical history, delivering bad news, discussing treatment plans, and doctors providing empathetic responses; Establish rules for mood transition, including triggering conditions and actions to be taken.

3. A method for generating dynamic, emotional doctor-patient communication dialogue based on a large language model according to claim 1 or 2, characterized in that, The emotional state model is represented by a data structure: {emotional label, intensity value}; The intensity value is an integer that can vary within a predefined range; the larger the value, the stronger the emotion.

4. The method for generating dynamic, emotional doctor-patient communication dialogue based on a large language model according to claim 1, characterized in that, The doctor-patient communication scenario is described or triggered by the following conditions: Medical history taking: The doctor asks the patient for basic information, including symptoms, medical history, and lifestyle habits; Bad news: A doctor delivers a serious, unexpected, or life-threatening diagnosis to the patient; Discussing treatment options: The doctor explains the advantages, disadvantages, risks, and effects of different treatment options to the patient; Empathic response from doctors: Doctors respond to patients' emotional distress using understanding, comforting, and supportive language; The emotion transition rules include: Rule R-01: Scene Initialization: Trigger condition: Entering a new main scene; Perform the action: Set the basic emotional state for the current scene; Rule R-02: Keyword Triggering Rule: Triggering condition: Words belonging to a specific set of keywords are detected in the text entered by the doctor; Action to execute: Based on the sentiment valence of the keywords, immediately adjust the intensity value of the corresponding sentiment; the adjustment range is either a preset fixed value or a value calculated based on the context. This includes sub-rules triggered by negative words, sub-rules triggered by empathic words, and sub-rules triggered by uncertain words; Rule R-03: Emotional Decay Rule Triggering condition: After each round of dialogue ends, and no other strong emotion rules are triggered; Action performed: All currently active emotion intensity values ​​naturally decrease by 1 point; Rule R-04: Rules for Emotional Escalation and Transformation Triggering condition: The intensity of a specific negative emotion remains high across multiple consecutive conversation rounds without being effectively alleviated; Execution action: Triggering a qualitative change in emotions, transforming one emotion into another, stronger or related emotion; Rule R-05: Rule for the generation of complex emotions: Triggering condition: Two or more non-mutually exclusive emotions simultaneously reach a moderate or higher intensity; Action execution: The system identifies the current state as "complex emotion" and performs special processing when generating prompts.

5. A method for generating dynamic, emotional doctor-patient communication dialogue based on a large language model, as described in claim 1 or 4, characterized in that... Step (2) involves collecting and analyzing the doctor's input text to generate a contextual feature object containing situational tags and emotional keywords; specifically, this includes: Keyword matching layer: This layer quickly scans the input doctor's text and identifies high-risk keywords.<A、B> ; Context recognition: Combining the high-risk keywords and sentence semantics, the current dialogue scenario is determined to be <bad news notification>; The final output object is as follows: Context tag: bad news delivery, keywords hit:<A、B>} 6. The method for generating dynamic, emotional doctor-patient communication dialogue based on a large language model according to claim 5, characterized in that, Step (3) involves receiving the context feature object and dynamically calculating and updating the quantitative data representing the patient's current emotional state according to a preset rule base and predefined rules; specifically, this includes: Step 1: The state machine recognizes the scenario as a "bad news notification" scenario, triggers rule R-01, and prepares to set the basic sentiment value for this scenario; Step 2: Based on the high-risk keywords found in step (2)<A、B> Set the basic emotion using the <Dialogue Content-Emotion Tag Mapping> rule in the rule base; Step 3: Rule rematching, the state machine discovers high-risk keywords given by the context analyzer.<A、B> This further triggers the negative word trigger sub-rule in rule R-02; Step 4: Conflict Resolution and Calculation: The state machine comprehensively executes the following rules: First, apply the R-01 rule to set the basic emotional state; then, apply the R-02 rule to adjust the basic emotional state; finally, calculate the new current emotional value.

7. The method for generating dynamic, emotional doctor-patient communication dialogue based on a large language model according to claim 1, characterized in that, In step (4), the updated quantitative emotion data is converted into a natural language emotion description instruction. The emotion description instruction is then concatenated with the doctor's original input text to form the final prompt word, which is then input into the large language model to generate and output the patient's response with emotional coloring.

8. A dynamic, emotional doctor-patient communication dialogue generation system based on a large language model, characterized in that, include: An emotion rule base is used to define typical doctor-patient communication scenarios and basic emotion tags, establish quantifiable intensity models for emotions, and achieve automatic mapping from keywords to emotion tags based on dialogue content, as well as define emotion conversion rules. Context analyzer: Used to receive and deeply analyze the dialogue between doctors and patients in real time, transforming unstructured natural language text into structured objects that can be used by the emotion state machine for decision-making. It adopts a hierarchical processing architecture to understand the dialogue from shallow to deep. Emotional state machine: used to calculate and update the patient's emotional state in real time based on the objects provided by the context analyzer and the emotion transition rules in the rule base; Emotion Expression Generator: Used to encode the state and output emotion quantification objects into prompt words for large language models, guiding the large models to generate responses with emotional coloring; The system is capable of implementing the method described in any one of claims 1 to 7.

9. A dynamic, emotional doctor-patient communication dialogue generation device based on a large language model, characterized in that, include: At least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to invoke the machine-readable program to implement the method according to any one of claims 1 to 7.

10. A computer-readable medium, characterized in that, The computer-readable medium stores computer instructions that, when executed by a processor, enable the implementation of the method described in any one of claims 1 to 7.