Self-adaptive regulation and control method and system for response knowledge density in medical dialogue
By constructing a professional dictionary and quantification rules, and combining dialogue history and user input to predict target knowledge density, a response that matches the user's cognitive level is generated. This solves the problem of uncontrollable response content in existing technologies and realizes an efficient, professional, and humanized medical dialogue system.
Patent Information
- Application Number
- CN202511400409.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2026-01-13
AI Technical Summary
Existing medical dialogue systems lack sophisticated and adaptive adjustment mechanisms for responding to the professional level of content, resulting in fixed or uncontrollable knowledge density. This makes it difficult to adapt to different users' cognitive levels and dynamically changing dialogue scenarios, creating communication barriers and reducing consultation efficiency and user experience.
A specialized dictionary containing multiple medical entities is constructed, knowledge intensity scores are calculated, quantification rules are defined, and the target knowledge density value is predicted through dialogue history and user input. This value is then used as a constraint to input into a large language model to generate a response, thereby achieving adaptive control.
It achieves quantitative and adaptive adjustment of responsive professionalism, significantly improves communication efficiency, ensures professional accuracy and user experience, enhances the interpretability and controllability of the system, and bridges the cognitive gap between doctors and patients.
Smart Images

Figure CN121328678A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and medical information processing technology, particularly to natural language processing and human-computer dialogue technology. Specifically, it relates to an adaptive control method and system for knowledge density in medical dialogue. It falls within the interdisciplinary application field of intelligent medical question-answering systems, medical natural language processing, and medical dialogue management. Background Technology
[0002] With the rapid development of information technology and the increasing public awareness of health, the application of artificial intelligence technology in the medical and health field is deepening. Among them, Medical Dialogue Systems (MDS), as an important bridge connecting users with medical knowledge and services, have shown great application potential in assisting doctors in online consultations, providing health advice, conducting preliminary disease screenings, and carrying out post-treatment follow-up and health management, and have become a research hotspot in the field of human-computer interaction. An ideal medical dialogue system should be able to efficiently and accurately understand the user's intent and description of their condition, and respond in a way that is both medically professional and easy for users to understand, thereby simulating or even optimizing the real doctor's consultation experience in some aspects.
[0003] To achieve this goal, researchers in this field have explored a variety of technical approaches. While these approaches have achieved certain results in their evolution, they have also exposed their limitations. In particular, there are still technical challenges that have not been effectively solved in terms of effectively regulating the level of professionalism of the response content to adapt to the different cognitive abilities of users.
[0004] In recent years, the emergence of large-scale language models (LLMs) such as GPT and LLaMA has brought revolutionary breakthroughs to medical dialogue systems. LLM-based systems, with their powerful contextual understanding, knowledge reasoning, and natural language generation capabilities, can conduct extremely fluent, natural, and knowledge-rich multi-turn dialogues. However, the inventors, through in-depth research, discovered that directly applying general-purpose LLMs to medical dialogue scenarios, while solving some fluency issues, has pushed the contradiction of uncontrollable professionalism in response content to a new level. Specifically, this manifests in the following two extreme and prevalent problems:
[0005] First, generating "high knowledge density" responses creates new communication barriers. LLM learns from a vast amount of professional medical literature and doctor-patient communication texts in its massive training data. When an ordinary user verbally describes feeling bloated and unable to eat much shortly after eating, the model might generate responses containing professional terms such as "early satiety" or "digestive motility disorders." These terms are precise and efficient for doctors, but are incomprehensible to users lacking medical background. Users are forced to interrupt their original description of symptoms and ask, "What is early satiety?", thus initiating a sub-dialogue of "explanation of terminology." This not only fails to resolve the user's original question but also increases additional communication costs and time, severely contradicting the original intention of using artificial intelligence to improve medical efficiency. This phenomenon is a manifestation of the existing "expertise gap" between doctors and patients in human-computer interaction.
[0006] Secondly, oversimplification in an attempt to mitigate risks leads to a reduction in the level of expertise required. To make models more "safe" and "universal," developers sometimes guide them to use simpler language through instruction tuning. However, this can lead to another problem: the model's generated responses may be too broad and colloquial, sacrificing the accuracy and rigor of medical terminology and failing to provide users with valuable, actionable guidance. For example, all chest discomfort might be vaguely interpreted as "possibly a heart problem," ignoring the fact that different types of pain (such as burning, squeezing, or stabbing sensations) could point to completely different causes (such as gastroesophageal reflux, angina, or intercostal neuralgia).
[0007] At a deeper level, existing LLM-based systems lack the ability to dynamically model and adapt to users' cognitive abilities. In a conversation, a user's cognitive state changes dynamically. A user may not understand a term at the beginning of the conversation, but after the system's explanation, they may accept the term in subsequent conversations. Existing LLM systems cannot explicitly track and utilize this cognitive change process. They cannot make intelligent decisions such as: "Given that the user already understands 'gastroesophageal reflux,' I can use it directly in the next response, but for the newly introduced 'Barrett's esophagus,' I still need to explain it in layman's terms."
[0008] To address the factual accuracy issue for LLM (Legal Masters) researchers, they proposed Retrieval-Augmented Generation (RAG) technology. This involves retrieving relevant knowledge from reliable knowledge bases (such as medical guidelines and authoritative encyclopedias) as context before generating a response. This alleviates the "illusion" of content to some extent, but RAG technology itself does not solve the problem of controlling communication style and knowledge density. Because the retrieved original knowledge may be highly specialized, LLM users, even after being given this specialized knowledge, still lack a clear "instruction" to determine the appropriate level of specialization when relaying this knowledge to users.
[0009] In summary, from early rule-based systems to cutting-edge large-scale language models, existing technologies have made significant progress in building medical dialogue systems. However, a crucial dimension directly impacting user experience and communication efficiency—the adaptive control of response knowledge density—remains a significant technological gap. Existing technologies are either too rigid or too uncontrollable, generally lacking a complete technological loop that can first effectively quantify the professional level (i.e., knowledge density) of the response text, then intelligently predict the target knowledge density based on the dynamic context of the dialogue, and finally generate a natural language response in a controllable manner that is both medically accurate and aligned with the user's current cognitive level. Therefore, designing and implementing such an intelligent control mechanism to truly bridge the cognitive gap between doctors and patients, and maximize communication efficiency while ensuring professional accuracy, is a key technological challenge that urgently needs to be addressed in this field. Summary of the Invention
[0010] This invention aims to address at least the following technical problems existing in the prior art: Existing medical dialogue systems, whether traditional rule-based systems or cutting-edge systems based on large language models, generally lack mechanisms for fine-grained and adaptive adjustment of the professional level of the response content. This results in the knowledge density of the system's response content being fixed or completely uncontrollable, making it difficult to adapt to different users' cognitive levels and dynamically changing dialogue scenarios. Consequently, a communication barrier is formed between doctors and patients, reducing consultation efficiency and user experience.
[0011] To address the aforementioned technical problems, this invention provides an adaptive adjustment method for response knowledge density in medical dialogue, comprising the following steps:
[0012] S1: Based on a pre-defined medical domain corpus, construct a professional dictionary containing multiple medical entities, and calculate the knowledge strength score of each medical entity in the professional dictionary;
[0013] S2: Based on the knowledge intensity score, define a quantification rule for calculating the knowledge density value in the text;
[0014] S3: In multi-turn conversations with the user, obtain the conversation history and the user's current conversation input;
[0015] S4: Based on the dialogue history and the current dialogue input, predict the target knowledge density value that the next response should achieve;
[0016] S5: The target knowledge density value is used as a constraint and input into a large language model to generate a natural language response to the current dialogue input whose knowledge density conforms to the target knowledge density value.
[0017] As a preferred technical solution, the calculation of the knowledge intensity score for each medical entity in S1 specifically includes: calculating the first frequency of the medical entity in the doctor's discourse and the second frequency in the corpus; calculating the initial score of the medical entity based on the ratio of the first frequency to the second frequency; and using a preset gating function to weight the initial score according to the second frequency to generate the knowledge intensity score.
[0018] As another preferred technical solution, the prediction of the target knowledge density value in S4 specifically includes: encoding the text content of the dialogue history and the current dialogue input to obtain dialogue context features; calculating the knowledge density value of each round of response in the dialogue history according to the quantization rules to form a historical knowledge density sequence, and encoding the sequence to obtain historical density sequence features; extracting medical entities from the dialogue history and the current dialogue input, and encoding the medical entities to obtain medical entity features; finally, fusing the dialogue context features, historical density sequence features, and medical entity features, and inputting the fused comprehensive feature representation into a preset prediction model to output the target knowledge density value.
[0019] As another preferred technical solution, in step S5, the target knowledge density value is used as a constraint and input into a large language model. Specifically, this includes: retrieving one or more reference responses from a reference response library based on the target knowledge density value; integrating the current dialogue input, the target knowledge density value, and the one or more reference responses into a prompt; and inputting the prompt into the large language model.
[0020] Accordingly, the present invention also provides a medical dialogue system, the system comprising:
[0021] The quantization unit is used to construct a professional dictionary containing multiple medical entities based on a pre-set medical domain corpus, calculate the knowledge strength score of each medical entity, and define quantization rules for calculating the knowledge density value in the text.
[0022] The processing unit is used to acquire the dialogue history and the user's current dialogue input during multi-turn dialogues with the user;
[0023] The prediction unit is used to predict the target knowledge density value that the next response should achieve based on the dialogue history and the current dialogue input.
[0024] The generation unit is used to input the target knowledge density value as a constraint into a large language model to generate a natural language response to the current dialogue input whose knowledge density conforms to the target knowledge density value.
[0025] The present invention has the following beneficial effects:
[0026] 1. Achieved Quantification and Adaptive Control of Response Professionalism: This invention proposes for the first time a complete closed-loop control method, from knowledge density quantification to dynamic prediction and controllable generation. It transforms the vague concept of "language professionalism" into calculable, predictable, and controllable technical indicators, enabling the system to intelligently adjust its communication methods based on the dialogue process and user feedback, just like an experienced doctor, thereby effectively bridging the cognitive gap between doctors and patients.
[0027] 2. Significantly improves the communication efficiency of medical dialogues: By generating responses with knowledge density that match the user's cognitive level, this invention enables users to understand the system's intent and information in the first instance, avoiding repeated questioning, explanation and clarification caused by professional terminology, thereby greatly shortening the number of dialogue rounds required to complete effective information exchange and improving the overall efficiency of consultation or diagnosis.
[0028] 3. Optimizing user experience while ensuring professional accuracy: This invention does not simply pursue simplified language, but seeks the optimal balance in a dynamic equilibrium. It can use accurate professional terminology when necessary (e.g., when the user has demonstrated comprehension), while providing simple explanations when the user needs them. This provides a smoother, more natural, and more human-centered interactive experience while ensuring that medical information is not distorted, thereby enhancing user trust and satisfaction.
[0029] 4. Enhanced interpretability and controllability of the system: Compared to a completely "black box" end-to-end generative model, the technical solution of this invention decomposes the response generation process into multiple observable and interventionist stages. The predicted value of knowledge density can serve as an intuitive display of the system's internal state, providing a clear tool for system debugging, optimization, and behavioral analysis, making the operation of the entire dialogue system more transparent and reliable. Attached Figure Description
[0030] Figure 1 This is a schematic diagram of the structure of a target knowledge density prediction unit according to an embodiment of the present invention;
[0031] Figure 2 This is a schematic diagram of an application scenario according to the present invention, used to illustrate the impact of responses with different knowledge densities on the efficiency of doctor-patient communication;
[0032] Figure 3 This is a schematic diagram showing the results of comparing the effectiveness of an embodiment of the present invention with that of the prior art in manual evaluation. Detailed Implementation
[0033] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the technical solutions of this invention will be further described below in conjunction with the accompanying drawings and specific embodiments. However, it should be understood that the specific embodiments described below are only for illustrating this invention and do not constitute a limitation on the scope of protection of this invention.
[0034] The following will describe in detail, with reference to the accompanying drawings, "An Adaptive Control Method and System for Response Knowledge Density in Medical Dialogue" provided by the present invention. Figure 1 The figure illustrates a schematic diagram of a medical dialogue system according to an embodiment of the present invention. The system may include a quantization unit, a processing unit, a prediction unit, and a generation unit. These units can be implemented by software, hardware, or a combination thereof, and can run on one or more computer devices such as servers. The method flow of the present invention will be described in detail below with reference to this system structure.
[0035] I. Quantification of Knowledge Density (corresponding to steps S1 and S2)
[0036] This invention first requires establishing an objective and calculable method to quantify the level of professionalism in text, i.e., "knowledge density." This stage is performed by a quantification unit.
[0037] Step S1 (Constructing a specialized dictionary and calculating knowledge strength scores) specifically includes the following sub-steps:
[0038] First, prepare a large-scale, domain-relevant corpus of medical dialogues. This corpus should contain a large number of real or simulated dialogues between doctors and patients.
[0039] Secondly, a specialized dictionary containing multiple medical entities will be constructed from this corpus. These entities can include disease names, symptoms, drugs, examination items, anatomical terms, etc.
[0040] Then, for each medical entity *e* in the dictionary, its knowledge strength score *score*(e) is calculated. This score aims to measure the degree of specialization of a word. In this embodiment, the calculation process can draw on the idea of sentiment strength calculation, as follows:
[0041] 1. Calculate the initial score score(e): Calculate the first frequency (tf) of the medical entity e in the doctor's discourse. d (e) and its second frequency tf(e) in the entire corpus (including doctor and patient discourse). The initial score is defined as the ratio of the two: This ratio intuitively reflects that the term is more likely to be used by doctors (experts); the higher the ratio, the more professional it is.
[0042] 2. Optimization using a gating function: To address the unreliability of scores caused by low-frequency words, a gating function σ(e) is introduced to weight the initial scores. The gating function is designed to reduce the weight of entities that appear too infrequently. The final knowledge strength score is then calculated. * (e) can be calculated using the following formula (1):
[0043]
[0044] in,
[0045]
[0046] In this formula, σ(e) is a sigmoid function with a range between 0 and 1. When the second frequency tf(e) of an entity is high, σ(e) approaches 1, and score*(e) is mainly determined by its initial score(e); when the second frequency tf(e) is low, σ(e) approaches 0, and score*(e) tends towards a neutral value (e.g., 0.5). The hyperparameter a is the frequency threshold, which can be set to 20, indicating that when a word appears around 20 times, its score is considered to have approximately 50% reliability.
[0047] Through the above steps, the quantification unit assigns a reliable knowledge strength score to each medical entity.
[0048] Step S2: Define the quantization rules. The quantization unit calculates the knowledge density value ρ of any text fragment (such as a sentence or a complete response) based on the above scores. k In one embodiment, the rule can be defined by the following formula (2):
[0049]
[0050] Among them, e i It is the i-th unique medical entity appearing in the sentence, m is the number of medical entities, and f iThe value is the number of times the entity appears in the sentence, where n is the total number of words in the sentence and m is the number of medical entities. The denominator is normalized using the logarithm of the sentence length, log(n), to eliminate the influence of sentence length on the density value and ensure that the knowledge density of sentences of different lengths is comparable.
[0051] Thus, this invention establishes a complete knowledge density quantification system.
[0052] II. Prediction of target knowledge density (corresponding to steps S3 and S4)
[0053] During the dialogue, the system needs to predict the optimal knowledge density for the next response. This stage is jointly completed by the processing unit and the prediction unit.
[0054] Step S3 is executed by the processing unit to obtain the complete history of the current dialogue (e.g., the dialogue from the first round to the (i-1)th round). And the user's latest dialogue input in the current i-th round.
[0055] Step S4 is performed by the prediction unit, and its goal is to predict the doctor's response D in the i-th round based on the input information. i Target knowledge density value Reference Figure 1 The specific implementation method of the prediction unit is as follows:
[0056] 1. Multi-dimensional feature extraction:
[0057] Dialogue Context Features (H c ): The history of dialogue and the current query The concatenation into a long text sequence is then fed into a pre-trained text encoder (such as BERT, RoBERTa, etc.) to obtain a vector representation H representing the semantic context of the entire dialogue. c .
[0058] Historical density sequence features (H d Using the aforementioned quantification rules, i.e., formula (2), the dialogue history is calculated. The knowledge density value ρ of each sentence in the text k This forms a numerical sequence {ρ} k1 ,ρ k2 The sequence reflects the dynamic trend of conversational professionalism. This numerical sequence is then input into a sequence encoder (e.g., a multilayer perceptron MLP or RNN) to obtain the vector representation H of the historical density sequence. d .
[0059] Medical entity characteristics (H e From the history of dialogue and the current query In the text encoding, all occurrences of medical entities {e1, e2, ...} are extracted using entity linking techniques (e.g., linking to public medical knowledge graphs such as UMLS and KaMed). These entities are then input into a text encoder to obtain their vector representations H. e .
[0060] 2. Feature fusion and prediction:
[0061] To capture the complex dependencies between different features, this embodiment employs a hierarchical attention mechanism to fuse the three features mentioned above. For example, H can be calculated first. c With H e Attention weights are applied between entities to integrate entity information into the contextual representation; then the fused representation is compared with H. d The attention weights between them are used to obtain a comprehensive feature representation that includes contextual semantics, entity knowledge, and density change trends.
[0062] Finally, this comprehensive feature representation is input into a fully connected layer (i.e., the prediction layer), and an activation function (e.g., ReLU) is passed through it to output a scalar value, which is the predicted target knowledge density value.
[0063] The prediction architecture, which consists of multiple encoders, a hierarchical attention mechanism, and a prediction layer, can be obtained by training on a large amount of dialogue data labeled with knowledge density. The goal of the training is to minimize the mean squared error (MSE Loss) between the predicted density and the true density.
[0064] III. Response Generation with Controllable Knowledge Density (corresponding to step S5)
[0065] After obtaining the target knowledge density value, the system needs to generate a response that conforms to the density constraint. This stage is performed by the generation unit.
[0066] In this embodiment, step S5 is implemented using the Retrieval-Augmented Generation (RAG) framework, as detailed below:
[0067] 1. Reference Response Retrieval: This retrieves the output of the prediction unit. As a retrieval command, several knowledge density values are retrieved from a large-scale reference response database (which could be the aforementioned medical dialogue corpus). The closest response is used as the reference sample. For example, if With a knowledge density of 0.3, the system may retrieve sentences with a knowledge density between 0.25 and 0.35.
[0068] 2. Prompt Construction: Integrating multiple information elements into a structured prompt to guide a large language model (LLM). This prompt may include:
[0069] Role setting: For example, "You are a professional doctor who is communicating with a patient."
[0070] Dialogue context: i.e. and
[0071] Density control instructions: Explicitly tell the model the knowledge density level it should achieve in its generated responses. For example, "Please generate a knowledge density of approximately..." The reply.
[0072] Reference Samples: The reference responses retrieved in the previous step are used as examples (Few-shot Examples) to allow the model to learn their language style and level of expertise.
[0073] 3. Constraint Generation: The constructed prompts are input into a large language model (such as GPT-4, DeepSeek-V3, or any other finely tuned medical domain LLM). Driven by powerful contextual understanding and instruction compliance capabilities, the LLM generates a response that appropriately addresses user queries. Furthermore, it conforms to the standards in the use of professional terminology. A constrained, fluent, and natural final answer D i .
[0074] Application Example Description
[0075] like Figure 2 The figure visually illustrates the beneficial effects of the method of the present invention. In one scenario, the user (P) describes symptoms.
[0076] In the Subsequent Expertise-Heavy Interaction 1, a system not using the method of this invention might directly generate a response (D2) containing high knowledge-density terms such as "digestive motility disorders" and "reflux esophagitis." This results in the user (P3) being completely confused and needing to ask, "What's early satiety?", leading to a communication impasse.
[0077] In Interaction 2 (Subsequent Expertise-appropriate Interaction) of this embodiment, the system predicts that the current user requires a low target knowledge density. Therefore, the generation unit generates response D3: "Do you ever feel full after eating only a little, or experience a burning sensation in the chest?" This response explains the technical terminology in easy-to-understand everyday language, which the user (P4) can immediately understand and give an effective answer, thus enabling the dialogue to continue efficiently. This fully demonstrates the significant advantages of this invention in bridging the cognitive gap between doctors and patients and improving communication efficiency.
[0078] Technical effects:
[0079] To further verify the practical effectiveness of the technical solution provided by this invention, the inventors conducted a series of experiments. The experimental environment was based on publicly available medical dialogue datasets (MedDG and KaMed), and a large-scale language model (GPT-4, etc.) was used as the underlying generative model. The experiments evaluated the performance of the method of this invention from multiple dimensions by comparing it with various existing technical solutions.
[0080] 1. Overall performance evaluation
[0081] In an experiment aimed at evaluating the overall performance of a dialogue system, the method of this invention was compared with various baseline models, including multiple versions of the GPT model and specialized large-scale medical models such as HuatuoGPT2. Evaluation dimensions included Intent Coherence (IC-1) and Information Concentration (IC-2), two metrics directly related to the contextual relevance and appropriateness of the response.
[0082] Experimental results show that the proposed method (denoted as MedKDC in the table) significantly outperforms all baseline models in both the IC-1 and IC-2 key metrics. Specifically, on the MedDG dataset, the proposed method achieves an IC-1 score of 4.15 and an IC-2 score of 3.76; on the KaMed dataset, the IC-1 score reaches 4.10 and the IC-2 score reaches 3.78. These scores are all higher than those achieved by directly using the GPT-4 model (without the adjustments made by the proposed method).
[0083] This result strongly demonstrates that the technical solution of this invention, by introducing refined control of knowledge density, can generate responses that are more contextually coherent and more professionally aligned with patients' comprehension levels than existing technologies. This is not simply about improving the fluency of language, but fundamentally enhancing the medical competence and communication effectiveness of the dialogue content.
[0084] 2. Interaction efficiency evaluation
[0085] To measure the efficiency improvement of this invention in actual interaction, experiments simulated multi-turn doctor-patient dialogue scenarios and recorded two key indicators: average turns per symptom confirmation (T / S) and layperson comprehension (LC). A lower T / S indicates that the system can confirm a symptom with fewer dialogue turns, resulting in higher efficiency; a higher LC indicates that the patient can more easily understand the system's response.
[0086] Experimental results show that the method of this invention performs exceptionally well in terms of the T / S ratio. For example, on the MedDG dataset, the T / S value of this method can be as low as 1.23 rounds, significantly lower than other baseline models.
[0087] The results show that by generating responses with controlled knowledge density, the present invention can effectively avoid ineffective communication and repeated clarifications caused by technical jargon, thereby significantly improving consultation efficiency.
[0088] 3. Manual assessment
[0089] To assess the true quality of the responses generated by this invention, the experiment also recruited qualified physicians to conduct blinded human evaluation. Physicians were asked to compare the responses generated by the method of this invention with those generated by a baseline model (such as GPT-4) without knowing the source of the responses. The core criterion for evaluation was "which response, while maintaining medical accuracy, better facilitates patient understanding and acceptance."
[0090] Human evaluation results (e.g.) Figure 3 The results show that the responses generated by the method of this invention received overwhelming preference on both datasets. For example, on the MedDG dataset, doctors considered the response of this invention superior in 55.67% of cases, far exceeding the proportion who considered the baseline model superior (18.0%).
[0091] From the perspective of professional medical practitioners, this result further confirms that the adaptive knowledge density control method proposed in this invention has successfully found an effective balance between medical professionalism and patient accessibility, and the quality of the generated response has been highly recognized by professionals.
[0092] 4. Ablation experiment verification
[0093] To verify the necessity of each component in the technical solution of this invention, an ablation study was also conducted. For example, in one variant, although the system was provided with a target knowledge density value, it was not given any principled guidance on how to achieve that density (i.e., some density control instructions in the Prompt were removed); in another variant, the system did not use the online predicted target density value at all.
[0094] Experimental results show that removing any key component leads to a significant decrease in system performance, especially in the intent coherence (IC-1) and information concentration appropriateness (IC-2) metrics.
[0095] The results demonstrate that each link in the "quantification-prediction-generation" technology closed loop proposed in this invention, especially the online prediction of the target knowledge density and the constraint generation based on the predicted value, is indispensable and interdependent for achieving the final beneficial effect.
[0096] In summary, a wealth of experimental data and case studies have comprehensively demonstrated the advanced nature and practicality of the technical solution of this invention from various perspectives. This invention successfully solves the problem of uncontrollable professionalism in the response of existing technologies in medical dialogues, providing a new and effective technical path for building a more efficient, intelligent, and humane medical dialogue system.
[0097] The above description is not intended to limit the present invention in any way. Although the present invention has been disclosed through the above embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some changes or modifications to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the present invention shall still fall within the scope of the present invention.
Claims
1. An adaptive control method for response knowledge density in medical dialogue, characterized in that, Includes the following steps: S1: Based on a pre-defined medical domain corpus, construct a professional dictionary containing multiple medical entities, and calculate the knowledge strength score of each medical entity in the professional dictionary; S2: Based on the knowledge intensity score, define a quantification rule for calculating the knowledge density value in the text; S3: In multi-turn conversations with the user, obtain the conversation history and the user's current conversation input; S4: Based on the dialogue history and the current dialogue input, predict the target knowledge density value that the next response should achieve; S5: The target knowledge density value is used as a constraint and input into a large language model to generate a natural language response to the current dialogue input whose knowledge density conforms to the target knowledge density value.
2. The adaptive control method for response knowledge density in medical dialogue according to claim 1, characterized in that, The calculation of the knowledge strength score for each medical entity in S1 specifically includes: The first frequency of the medical entity in doctors' discourse and the second frequency in the corpus were statistically analyzed. The initial score of the medical entity is calculated based on the ratio of the first frequency to the second frequency. Using a preset gating function, the initial score is weighted according to the second frequency to generate the knowledge strength score, wherein the gating function is used to reduce the influence of low-frequency entities on the initial score.
3. The adaptive control method for response knowledge density in medical dialogue according to claim 1, characterized in that, The calculation process for the knowledge strength score is as follows: Calculate the initial score score(e): Calculate the first frequency (tf) of the medical entity e in the doctor's discourse. d (e) and its second frequency tf(e) in the entire corpus, the initial score is defined as the ratio of the two: Optimization using a gating function: To address the issue of unreliable scores due to low-frequency words, a gating function σ(e) is introduced to weight the initial scores. The gating function is designed to reduce the weight of entities that appear too infrequently, thus improving the final knowledge strength score. * (e) can be calculated using the following formula (1): in, In this formula, σ(e) is a sigmoid function with a range between 0 and 1. When the second frequency tf(e) of a medical entity is high, σ(e) approaches 1, and score*(e) is mainly determined by its initial score(e). When tf(e) is low, σ(e) approaches 0, and score*(e) tends to a neutral value. The hyperparameter a is the frequency threshold.
4. The adaptive control method for response knowledge density in medical dialogue according to claim 3, characterized in that, The quantification rules for the knowledge density value in step S2 are as follows: The quantization unit calculates the knowledge density value ρ of any text fragment based on the above scores. k The quantification rule can be defined by the following formula (2): Among them, e i f is the i-th unique medical entity appearing in the sentence. i The number of times the medical entity appears in the sentence is denoted as n, and the total number of words in the sentence is n. The denominator is normalized using the logarithm of the sentence length, log(n), in order to eliminate the influence of sentence length on the density value and ensure that the knowledge density of sentences of different lengths is comparable.
5. The adaptive control method for response knowledge density in medical dialogue according to claim 1, characterized in that, The predicted target knowledge density value in S4 specifically includes: The text content of the dialogue history and the current dialogue input is encoded to obtain dialogue context features; According to the quantization rules, the knowledge density value of each round of response in the dialogue history is calculated to form a historical knowledge density sequence, and the sequence is encoded to obtain the historical density sequence feature. Medical entities are extracted from the dialogue history and current dialogue input, and the medical entities are encoded to obtain medical entity features; The dialogue context features, historical density sequence features, and medical entity features are integrated to obtain a comprehensive feature representation, which is then input into a preset prediction model to output the target knowledge density value.
6. The adaptive control method for response knowledge density in medical dialogue according to claim 5, characterized in that, The fusion of the dialogue context features, historical density sequence features, and medical entity features is achieved through a hierarchical attention mechanism.
7. The adaptive control method for response knowledge density in medical dialogue according to claim 1, characterized in that, In step S5, the target knowledge density value is used as a constraint and input into a large-scale language model, specifically including: Based on the target knowledge density value, one or more reference responses are retrieved from a reference response library; The current dialogue input, the target knowledge density value, and the one or more reference responses are combined into a single prompt. The prompt is input into the large language model.
8. An adaptive control system for responding to knowledge density in medical dialogue, characterized in that, include: The quantization unit is used to construct a professional dictionary containing multiple medical entities based on a pre-set medical domain corpus, calculate the knowledge strength score of each medical entity, and define quantization rules for calculating the knowledge density value in the text. The processing unit is used to acquire the dialogue history and the user's current dialogue input during multi-turn dialogues with the user; The prediction unit is used to predict the target knowledge density value that the next response should achieve based on the dialogue history and the current dialogue input. The generation unit is used to input the target knowledge density value as a constraint into a large language model to generate a natural language response to the current dialogue input whose knowledge density conforms to the target knowledge density value.
9. The adaptive control system for response knowledge density in medical dialogue according to claim 8, characterized in that, The prediction unit is specifically used for: The text content of the dialogue history and the current dialogue input is encoded to generate dialogue context features; According to the quantization rules defined by the quantization unit, the knowledge density value of each round of response in the dialogue history is calculated to form a historical knowledge density sequence, and the historical knowledge density sequence is encoded to generate historical density sequence features. Medical entities are extracted from the dialogue history and current dialogue input, and the medical entities are encoded to generate medical entity features; The dialogue context features, historical density sequence features, and medical entity features are fused to generate a comprehensive feature representation; The comprehensive feature representation is input into a preset prediction model to output the target knowledge density value.