A Medical Consultation Dialogue System and Method Based on Medical Entity Knowledge Prediction and Reasoning

By developing a medical consultation dialogue system based on medical entity knowledge prediction and reasoning, the system addresses the issues of insufficient interactivity and neglect of entity relationships in existing systems. It enables efficient and detailed descriptions of patient conditions and diagnostic responses, thereby improving the real-time interactivity and diagnostic accuracy of the medical dialogue system.

CN116895386BActive Publication Date: 2026-06-30TIANJIN UNIV OF SCI & TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TIANJIN UNIV OF SCI & TECH
Filing Date
2023-06-20
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing medical consultation dialogue systems lack real-time interactivity, cannot effectively guide patients to describe their condition in detail, and ignore the strong coupling relationship between medical entities, resulting in inconsistencies between diagnostic results and reasoning logic in dialogue records.

Method used

A medical consultation dialogue system based on medical entity knowledge prediction and reasoning is adopted, including a dialogue history encoding module, a medical entity prediction module, a medical entity reasoning module, and a knowledge-guided dialogue generation module. The system encodes the dialogue history through a neural network model, predicts and explores the relationships between medical entities, and generates responses that conform to the consistency of the dialogue history and the logical reasoning of the entities.

Benefits of technology

It improves the scalability and interpretability of the medical dialogue system, enabling it to proactively guide patients to describe their symptoms, generate more detailed and accurate diagnostic responses, simulate the inquiry logic in real-world consultations, and improve diagnostic efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116895386B_ABST
    Figure CN116895386B_ABST
Patent Text Reader

Abstract

This invention relates to a medical consultation dialogue system and method based on medical entity knowledge prediction and reasoning. Its technical features include: the system comprising a dialogue history encoding module, a medical entity prediction module, a medical entity reasoning module, and a knowledge-guided dialogue generation module; the method comprising: encoding the doctor-patient dialogue history using a neural network model; introducing an entity prediction module to obtain potential medical entities for the next round of dialogue; constructing an entity reasoning module to detect strong coupling relationships between medical entities; and using the knowledge-guided dialogue generation module to generate diagnostic responses. This invention is rationally designed and overcomes the problems of entity guidance deficiencies and insufficient entity relationship modeling, thereby enabling the medical dialogue system to generate responses that conform to dialogue history consistency and entity logical reasoning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of medical information technology, and relates to medical consultation dialogue systems, particularly a medical consultation dialogue system and method based on medical entity knowledge prediction and reasoning. Background Technology

[0002] With the increasing aging population and shortage of medical personnel, more and more patients are unable to receive timely diagnosis and take effective measures to address their underlying conditions. While the development of information technology allows for initial online diagnoses using search engines, this method suffers from two main problems: First, even if search engines find similar case analyses, patients often lack professional medical knowledge, preventing them from taking effective treatment measures. Even minor deviations can lead to erroneous understanding and disastrous consequences. Second, online medical consultations suffer from low communication efficiency, high costs, and inconsistent doctor qualifications, often making it difficult for patients to obtain satisfactory decision-making outcomes.

[0003] In recent years, with the development of natural language processing, human-computer dialogue systems have achieved remarkable results. A number of commercial deployments have emerged, such as Apple's Siri and Microsoft's Xiaoice. Dialogue systems are a reusable application in the field of natural language processing, and they can be divided into task-oriented dialogue systems and open-domain dialogue systems. Open-domain dialogue systems are dedicated to casual conversation with users, pursuing the rationality and diversity of dialogue; unlike open-domain dialogue systems, task-oriented dialogue systems are dedicated to fulfilling specific user needs, such as hotel bookings and weather inquiries. Medical consultation dialogue systems are essentially a type of task-oriented dialogue system.

[0004] Existing medical consultation dialogue systems can interact deeply with patients to obtain their real-time medical records and automatically infer the causes of their illnesses and provide guiding suggestions. Their key tasks are: first, to collect information about the user's symptoms through multiple rounds of dialogue; and then, to provide guiding suggestions based on the user's comprehensive symptoms, including information such as disease symptoms or recommended medications. These systems can effectively simplify the consultation process, reduce communication between doctors and patients, thereby significantly improving consultation efficiency and reducing time costs. However, current research in the field of medical dialogue systems, especially systems that can automatically generate doctor-like responses, is relatively limited in both academia and industry. Existing online consultation systems lack real-time interactivity and cannot guide users to provide more detailed descriptions of their conditions. Firstly, in actual consultations, patients often only describe part of their condition. Doctors with professional medical backgrounds obtain more information about the patient's condition through guided dialogue; sometimes, they may even infer a possible disease and repeatedly and indirectly inquire about specific symptoms to verify their hypothesis. Secondly, there are strong coupling relationships between different medical entities. For example, when a patient has a cough, the doctor may symbolically ask if the patient has phlegm, demonstrating this strong coupling relationship between "cough" and "phlegm." It is noteworthy that existing research has a homogenized understanding of doctor-patient dialogue records, neglecting the importance of medical clues in decision-making and diagnosis, leading to inconsistencies between diagnostic results and the reasoning logic involved in the dialogue records. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a medical consultation dialogue system and method based on medical entity knowledge prediction and reasoning, so as to realize online medical consultation function with high scalability, interpretability, accompanying active guidance characteristics, and medical entity prediction and coupled entity reasoning.

[0006] The present invention solves the existing technical problems by adopting the following technical solution:

[0007] A medical consultation dialogue system based on medical entity knowledge prediction and reasoning includes a dialogue history encoding module, a medical entity prediction module, a medical entity reasoning module, and a knowledge-guided dialogue generation module.

[0008] The dialogue history encoding module encodes the dialogue history using a neural network model to obtain the dialogue feature vector of the entire dialogue history.

[0009] The medical entity prediction module: constructs a candidate set of medical entities to be predicted based on the medical dialogue dataset, and predicts the medical entities contained in the next round of doctor's response based on the dialogue feature vector obtained from the doctor-patient dialogue history encoding module.

[0010] The medical entity reasoning module extracts medical entities contained in the dialogue feature vector based on the medical knowledge graph, and detects the transfer relationship between the medical entities contained in the dialogue feature vector and the medical entities predicted in the next round.

[0011] The knowledge-guided dialogue generation module aggregates dialogue feature vectors, prediction results from the medical entity prediction module, and inference results from the medical entity reasoning module to generate responses that conform to dialogue history consistency and entity logical reasoning.

[0012] Furthermore, the dialogue history encoding module consists of multiple layers of Transformer blocks based on the attention mechanism. Each layer is composed of different groups of neurons and is responsible for extracting the text representation of the dialogue history from the input of the downstream layer, thereby obtaining the corresponding dialogue feature vector in the upstream layer.

[0013] Furthermore, the medical entity prediction module consists of an additional fully connected layer, which is responsible for converting the dialogue feature vector into a multi-label classification task and predicting the medical entities contained in the next round of doctor responses.

[0014] Furthermore, the medical entity reasoning module consists of a local attention mechanism layer, which is responsible for detecting the attention relationship between medical entities involved in the dialogue history and the next round of doctor response entities. The strong coupling model between medical entities is completed by updating the neurons involved in this layer.

[0015] A method for a medical consultation dialogue system based on medical entity knowledge prediction and reasoning includes the following steps:

[0016] Step 1: The dialogue history encoding module encodes the dialogue history between doctors and patients to obtain the dialogue feature vector C;

[0017] Step 2: The medical entity prediction module obtains potential medical entities for the next round of dialogue.

[0018] Step 3: The medical entity reasoning module detects the strong coupling relationships between medical entities.

[0019] Step 4: The knowledge-guided dialogue generation module aggregates the results obtained from steps 1 to 3 and automatically generates diagnostic responses;

[0020] Step 5: Optimize the negative log-likelihood loss function of the real and generated responses and the multi-label classification loss function of subsequent medical entities involved in the next round of responses through joint learning to optimize the medical consultation dialogue system.

[0021] Furthermore, the medical entity includes the following five types of information: symptoms, disease, attributes, examinations, and medications.

[0022] Furthermore, the specific implementation method of step 2 is as follows: the medical entity prediction module obtains the medical entity through the predicted probability distribution s. The probability distribution s is calculated as follows:

[0023] s = Wh [cls] +b

[0024] Where [cls] is the start marker for the dialogue history sequence, h [cls] [cls] represents the hidden state after encoding, describing the encoded representation of the entire dialogue sequence. s describes the probability distribution of candidate medical entities, and W,b are trainable parameters. The additional fully connected layer acts on h. [cls] To predict potential medical entities in the next round of dialogue.

[0025] Furthermore, the specific implementation method of step 3 is as follows: First, the entity reasoning module extracts medical entities contained in the dialogue history. As context entities, the context entities and response entity sets are then encoded separately to obtain the corresponding entity set representations. and The coupling relationship between the context entity set and the response entity set is modeled using a local attention mechanism, and this coupling relationship is defined as follows:

[0026]

[0027] Where α j The attention weight α represents the attention weight between medical entity i in the context and medical entity j in the response. j Expressed by the following formula:

[0028]

[0029] in The activation function is used, and then the final entity attention representation E is obtained through max pooling. local The entity's attention E local The calculation formula is as follows:

[0030] E local =Max-pool([hc1,...,,hc k ])

[0031] in and Let θ represent the encoded entity set representation of the medical entities contained in the dialogue history and the encoded entity set representation of the medical entities predicted in the response, respectively, where θ is the response entity set.

[0032] Furthermore, the specific implementation method of step 4 is as follows: the encoded information of the knowledge-guided dialogue generation module, which aggregates the dialogue history, the prediction results of the entity prediction module, and the inference results of the entity reasoning module, comes from the words in the regression generated next sentence response, defined as follows:

[0033] p t =softmax(W o h t +b o )

[0034] Where h t W represents the hidden layer state of the decoder at the current time step. o b o p are trainable parameters t This represents the probability distribution of words predicted at the current time step.

[0035] Furthermore, the specific implementation method of step 5 is as follows:

[0036] L = Koss R +Loss Entity

[0037] in:

[0038]

[0039]

[0040] Where N is the number of samples, T is the length of the response sequence, M is the number of label classification categories, and Loss is... R To predict the negative log loss function of the response, Loss Entity For entity prediction, the multi-label loss function is y. ij ∈{0,1} represents the label value of the j-th entity in the i-th sample. Let r be the predicted value of the j-th entity in the i-th sample. t Let be the probability distribution of the word at time step t.

[0041] The advantages and positive effects of this invention are:

[0042] 1. This invention uses a neural network model to encode the history of dialogue between doctors and patients, uses a medical entity prediction module to obtain potential medical entities in the next round of dialogue, uses an entity reasoning module to detect strong coupling relationships between medical entities, and uses a knowledge-guided dialogue generation module to generate diagnostic responses. This overcomes the problems of entity guidance defects and insufficient entity relationship modeling, thereby enabling the medical dialogue system to generate responses that conform to the consistency of dialogue history and entity logical reasoning.

[0043] 2. The dialogue history encoding module of the present invention uses a neural network method to guide the patient to generate a more detailed description of the condition, so that the system can more comprehensively grasp the patient's medical information and thus give a more reasonable and accurate diagnostic response.

[0044] 3. The medical entity prediction module of the present invention can predict the potential medical entities contained in the doctor's next round of responses based on the dialogue history, thereby simulating the inquiry guidance logic in the real consultation process; enabling the dialogue system to accurately complete the analysis of cases under the guidance of entity knowledge.

[0045] 4. The medical entity reasoning module of this invention explores the strong coupling relationship between medical entities by detecting the transition relationship between medical entities contained in the dialogue history and the medical entities predicted in the next round. This helps to generate medical entities in the response that are more consistent with the coupling relationship between entities, and the response contains more accurate professional terminology. Attached Figure Description

[0046] Figure 1 This is a system architecture diagram of the medical consultation dialogue system of the present invention;

[0047] Figure 2 This is a flowchart illustrating the medical consultation dialogue method of the present invention. Detailed Implementation

[0048] The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0049] like Figure 1 As shown, this invention proposes a medical consultation dialogue system based on medical entity knowledge prediction and reasoning, including a dialogue history encoding module, a medical entity prediction module, a medical entity reasoning module, and a knowledge-guided dialogue generation module. The structure and function of each module are described below:

[0050] Dialogue history encoding module: Encodes the dialogue history using a neural network model to obtain the dialogue feature vector of the entire dialogue history.

[0051] In this system, the dialogue history encoding module consists of multiple layers of Transformer blocks based on the attention mechanism. Each layer is composed of different groups of neurons and is responsible for extracting the text representation of the dialogue history from the input of the downstream layer, and then obtaining the corresponding dialogue feature vector in the upstream layer.

[0052] The medical entity prediction module first constructs a candidate set of medical entities to be predicted based on the medical dialogue dataset, and then predicts the medical entities contained in the next round of doctor's response based on the dialogue feature vector obtained from the doctor-patient dialogue history encoding module.

[0053] In this system, the medical entity prediction module consists of an additional fully connected layer, which is responsible for transforming the dialogue feature vector into a multi-label classification task, thereby predicting the medical entities contained in the next round of doctor responses.

[0054] Medical entity reasoning module: First, extract the medical entities contained in the dialogue feature vector based on the medical knowledge graph, and then detect the transfer relationship between the medical entities contained in the dialogue feature vector and the medical entities predicted in the next round.

[0055] In this system, the medical entity reasoning module consists of a local attention mechanism layer, which is responsible for detecting the attention relationship between medical entities involved in the dialogue history and the next round of doctor's response entities. The strong coupling model between medical entities is completed by updating the neurons involved in this layer.

[0056] The knowledge-guided dialogue generation module aggregates dialogue feature vectors, prediction results from the medical entity prediction module, and inference results from the medical entity reasoning module to generate responses that conform to dialogue history consistency and entity logical reasoning.

[0057] This medical consultation dialogue system learns jointly by optimizing the negative log-likelihood loss function of real and generated responses and the multi-label classification loss function of subsequent medical entities involved in the next round of responses, thereby making the medical dialogue system more in line with user expectations.

[0058] Based on the aforementioned medical consultation dialogue system based on medical entity knowledge prediction and reasoning, this invention also proposes a medical consultation dialogue method based on medical entity knowledge prediction and reasoning, such as... Figure 2 As shown, it includes the following steps:

[0059] Step 1: The dialogue history encoding module encodes the dialogue history between doctors and patients to obtain dialogue feature vectors.

[0060] This step is the dialogue history encoding stage. In this step, a dialogue history encoding module composed of multiple layers of attention-based Transformer blocks is used to extract the textual representation of the dialogue history from the input of the downstream layer; then, the corresponding dialogue feature vector C is obtained in the upstream layer. <h [cls] ,h1,...,h n >;where h i This describes the dialogue between doctors and patients.

[0061] Step 2: The medical entity prediction module obtains potential medical entities for the next round of dialogue.

[0062] In this step, the medical entity prediction module introduces an additional fully connected layer to act on h. [cls]The module predicts potential medical entities in the next round of dialogue, with medical entities belonging to five categories of information: symptoms, diseases, attributes, examinations, and medications. As shown in Figure 2, when a patient describes "Doctor, what should I do if my stomach hurts?", the module predicts "diarrhea" and "nausea" as possible candidate medical entities in the doctor's next response.

[0063] The medical entity prediction module obtains the response entity set through the predicted probability distribution. The calculation is as follows:

[0064] s = Wh [cls] +b

[0065] Where [cls] is the start marker for the dialogue history sequence, h [cls] [cls] represents the hidden state after encoding, describing the encoded representation of the entire dialogue sequence. s describes the probability distribution of candidate medical entities, and W,b are trainable parameters. The additional fully connected layer acts on h. [cls] To predict potential medical entities in the next round of dialogue.

[0066] Step 3: The medical entity reasoning module detects the strong coupling relationships between medical entities.

[0067] In this step, the entity reasoning module first extracts medical entities from the dialogue history. As context entities, the context entities and response entity sets are then encoded separately to obtain the corresponding entity set representations. and This process is in the workflow Figure 2 The study describes the detection of the transfer relationship between "stomach ache," "diarrhea," and "nausea," thereby uncovering the coupling relationships between medical entities. Specifically, a local attention mechanism is introduced to model the coupling relationship between the context entity set and the response entity set; the coupling relationship is defined as follows:

[0068]

[0069] Where α j The attention weight between medical entity i in the context and medical entity j in the response can be expressed by the following formula:

[0070]

[0071] in The activation function is used, and then the final entity attention representation E is obtained through max pooling. local The formula is as follows:

[0072] E local =Max-pool([hc1,...,,hc k ]).

[0073] in and Let θ represent the encoded entity set representation of the medical entities contained in the dialogue history and the encoded entity set representation of the medical entities predicted in the response, respectively, where θ is the response entity set.

[0074] Step 4: Based on the results obtained from Steps 1 to 3, the knowledge-guided dialogue generation module generates a diagnostic response.

[0075] In this step, within the knowledge-guided dialogue generation module, encoded information from the aggregation of dialogue history, entity prediction module prediction results, and entity reasoning module inference results is derived from words generated in the regression to produce the next response; defined as follows:

[0076] p t =softmax(W o h t +b o )

[0077] Where h t W represents the hidden layer state of the decoder at the current time step. o b o p are trainable parameters t This represents the probability distribution of words predicted at the current time step.

[0078] Step 5: Optimize the negative log-likelihood loss function of the real response and the generated response, and the multi-label classification loss function of the subsequent medical entities involved in the next round of response for joint learning.

[0079] This step is the optimization phase. The dialogue system jointly learns using the negative log-likelihood loss function of the real and generated responses, and the multi-label classification loss function of subsequent medical entities involved in the next response. The definitions are as follows:

[0080] L = Loss R +Loss Entity

[0081] in:

[0082]

[0083]

[0084] Where N is the number of samples, T is the length of the response sequence, M is the number of label classification categories, and Loss is... R To predict the negative log loss function of the response, Loss Entity For entity prediction, the multi-label loss function is y. ij ∈{0,1} represents the label value of the j-th entity in the i-th sample. Let r be the predicted value of the j-th entity in the i-th sample. t Let be the probability distribution of the word at time step t.

[0085] It should be emphasized that the embodiments described in this invention are illustrative rather than limiting. Therefore, this invention includes, but is not limited to, the embodiments described in the specific implementation. Any other implementations derived by those skilled in the art based on the technical solutions of this invention are also within the scope of protection of this invention.

Claims

1. A method for predicting and inferring medical consultation dialog based on medical entity knowledge, characterized in that: Includes the following steps: Step 1: The dialogue history encoding module encodes the dialogue history between doctors and patients to obtain the dialogue feature vector C; Step 2: The medical entity prediction module obtains potential medical entities for the next round of dialogue. ; Step 3: The medical entity reasoning module detects the strong coupling relationships between medical entities. ; Step 4: The knowledge-guided dialogue generation module aggregates the results obtained from steps 1 to 3 and automatically generates diagnostic responses; Step 5: Optimize the negative log-likelihood loss function of the real response and the generated response, and the multi-label classification loss function of the subsequent medical entities involved in the next round of response to jointly learn and optimize the medical consultation dialogue system; The specific implementation method of step 2 is as follows: the medical entity prediction module predicts the probability distribution. Obtain medical entity The probability distribution The calculation is as follows: in It is the marker for the start of the dialogue history sequence. yes The encoded hidden states describe the encoded representation of the entire dialogue sequence. It describes the probability distribution of candidate medical entities. It is a trainable parameter extra fully connected layer that acts on To predict potential medical entities in the next round of dialogue; The specific implementation method of step 3 is as follows: First, the entity reasoning module extracts medical entities contained in the dialogue history. As context entities, the context entities and response entity sets are then encoded separately to obtain the corresponding entity set representations. and The coupling relationship between the context entity set and the response entity set is modeled using a local attention mechanism, and this coupling relationship is defined as follows: in Represents medical entities in the context and medical entities in the response The attention weights between them, the attention weights Expressed by the following formula: in The activation function is then used, and the final entity attention representation is obtained through max pooling. The entity's attention The calculation formula is as follows: in { }and { } represent the encoded entity set representations of medical entities implied in the dialogue history and the encoded entity set representations of medical entities predicted in the response, respectively. To reply with a collection of entities; The specific implementation method of step 4 is as follows: the encoded information of the knowledge-guided dialogue generation module, which aggregates the dialogue history, the prediction results of the entity prediction module, and the inference results of the entity reasoning module, comes from the words in the regression to generate the next sentence of the reply, and is defined as follows: in This represents the hidden layer state of the decoder at the current time step. , For trainable parameters, The probability distribution of words predicted at the current time step; The specific implementation method of step 5 is as follows: in: in For the sample size, The length of the response sequence, Number of categories for label classification To predict the negative log loss function of the response, For entity prediction, a multi-label loss function is used. 0,1} For the first The first sample The tag value of each entity, For the first The first sample The predicted value of each entity, Let be the probability distribution of the word at time step t.

2. The method for medical consultation dialogue based on medical entity knowledge prediction and reasoning according to claim 1, characterized in that: The medical entity includes the following five types of information: symptoms, disease, attributes, examinations, and medications.