A consultation triage dialogue system based on a small expert model
By using a consultation triage dialogue system based on a small expert model, and leveraging probabilistic coding technology guided by structural entropy and retrieval-enhanced generation technology, the system solves the problems of poor information transmission, long response times, and unclear answers in traditional medical consultations. It achieves personalized medical information and emotional support, improves consultation efficiency and accuracy, and enhances patient satisfaction and treatment adherence.
Patent Information
- Application Number
- CN202510464280.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-04-14
AI Technical Summary
Existing medical consultation systems struggle to accurately identify patients' diverse needs, failing to ensure both professional and personalized consultation services while providing precise identification and dynamic responses to these needs. This is especially true when dealing with complex health issues, where patients often face long waiting times and receive uncertain responses.
A consultation triage dialogue system based on a small expert model is adopted. The system analyzes the patient's consultation content through probabilistic coding technology guided by structural entropy to determine the type of need. Relevant information is obtained from the hierarchical diagnostic knowledge graph using retrieval enhancement generation technology to generate medical information responses and provide personalized emotional support.
It improves the efficiency and accuracy of medical consultations, provides personalized emotional support, enhances patient satisfaction and treatment adherence, shortens waiting times, and ensures that patients receive the information support or emotional comfort they need in the shortest possible time.
Smart Images

Figure CN120296135B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of natural language processing and knowledge graph, and particularly relates to a consultation shunt dialogue system based on a small expert model. BACKGROUND
[0002] In modern large model dialogue systems, consultation efficiency and quality directly affect user experience, especially when facing complex health problems, patients often need timely and accurate information support and emotional care. Traditional medical consultation methods often have problems such as poor information transmission, long response time, and lack of attention to patients' emotional needs. With the rapid development of artificial intelligence (AI) technology, dialogue systems based on large language models (LLMs) have gradually become an effective tool to solve medical consultation problems. These systems can understand the consultation content of patients through natural language processing technology and generate corresponding responses. Especially the application of mixed expert (MoE) architecture makes the dialogue system can dynamically call different expert models according to different consultation types to provide more accurate services. However, the existing MoE architecture often faces the black box characteristics, and the process of expert selection is difficult to accurately control, resulting in the lack of information accuracy and emotional support.
[0003] The intelligent medical consultation system faces a complex technical challenge when dealing with patient needs: how to accurately distinguish and efficiently meet the diverse needs of patients. Patient consultation content often contains information acquisition and emotional support needs, and the processing methods and response strategies of these two types of needs are significantly different. However, traditional medical consultation systems often use a unified processing flow, making it difficult to accurately identify the real intentions of patients, resulting in poor consultation results. In addition, the individual differences and context dependence of patient expression further increase the difficulty of demand recognition. Even if the system can initially distinguish the type of demand, how to provide personalized information or emotional support according to the specific situation of the patient is still a big challenge. In the dynamic consultation process, patient needs may change, and the system needs to have the ability to adjust the response strategy in real time. At the same time, the professional and sensitive nature of medical consultation requires the system to consider the psychological state and acceptance ability of patients while providing accurate information. This forms a technical problem: how to ensure the professional and personalized nature of consultation services while accurately identifying and dynamically responding to the diverse needs of patients, and continuously optimizing system performance in the process to improve the overall intelligent level of medical consultation. SUMMARY
[0004] The present application provides a consultation shunt dialogue system based on a small expert model, mainly comprising:
[0005] a demand judgment module, a medical information consultation expert model, and an emotional support expert model;
[0006] The user's inquiry content is obtained through the demand judgment module. The inquiry content is analyzed by the probabilistic coding technology guided by structural entropy to determine the type of the inquiry content. Based on the type of the inquiry content, the inquiry content is diverted to the corresponding mini-expert model. The response content generated by the mini-expert model for the inquiry content is returned to the user.
[0007] If the type of consultation content is medical information, the consultation content will be diverted to the medical information expert model, and relevant information will be obtained from the hierarchical diagnostic knowledge graph through retrieval enhancement generation technology to generate a medical information response;
[0008] If the consultation content is of the emotional support type, then the consultation content will be diverted to the emotional support expert model, which will generate an emotional support response based on the user's historical data context.
[0009] Furthermore, the analysis of the consultation content using the probabilistic coding technique guided by structural entropy includes:
[0010] The consultation content is converted into a vector representation. Encoder For the vector representation Encode to obtain latent variables The latent variables are calculated by constructing a graph structure. The structural entropy is used to determine the type of the consultation content;
[0011] The latent variables are calculated by constructing a graph structure. The structural entropy includes:
[0012] According to the latent variables Embedded Build picture ,
[0013] Using information and emotion categories as demand type labels for the graph conduct Obtain a three-layer coding tree 1;
[0014] Calculate the structural entropy of the intermediate layer nodes of the three-layer coding tree, and adjust the latent variables according to maximizing the structural entropy. The probability distribution;
[0015] The step of determining the type of consultation content based on the structural entropy includes:
[0016] For the latent variables The corresponding score vector is obtained by performing a linear transformation on the probability distribution. The score vector is based on the Softmax classification function. Perform the transformation and calculate the probability of information-related demand. And the probability of emotional needs ;
[0017] If the probability of the aforementioned information type demand Greater than the probability of the emotional category demand The type of consultation content is determined to be medical information. If the probability of the emotional type demand Greater than the probability of demand for the aforementioned information class The type of consultation content was determined to be emotional support. .
[0018] Furthermore, the hierarchical diagnostic knowledge graph includes four layers, and the multi-hop path from the top layer to the bottom layer is represented as follows: , From the Electronic Health Record (EHR) database The collection of all disease names extracted from it. represent The set of subcategories, This is the category set after aggregating the subcategory set. A collection of disease manifestations, including and Two subtypes, Represents a large language model Enhanced disease-specific characteristics, Represents the Electronic Health Record (EHR) database The features derived from the decomposition of symptom manifestations extracted from them; Indicates a hierarchical or subordinate relationship. It refers to the characteristic relationship between diseases and their manifestations;
[0019] The step of obtaining relevant information from a hierarchical diagnostic knowledge graph through retrieval enhancement generation technology and generating a medical information response includes:
[0020] Regarding the patient's symptoms in the consultation content Semantic segmentation of the description, and the manifestation of patient symptoms Decomposed into patient characteristics ;
[0021] The patient characteristics In the hierarchical diagnostic knowledge graph Layer nodes Matching is performed to obtain a set of clinical characteristic nodes, wherein the set of clinical characteristic nodes is The set of feature nodes in a layer whose matching degree is greater than a threshold;
[0022] For each node in the set of clinical characteristic nodes , determine the disease subclass node in the layer closest to it as the target subclass node by traversing upwards;
[0023] Take the target subclass node as the parent node, and traverse downwards to the layer to retrieve all nodes adjacent to the target subclass node in the layer to form a node set ; Further, form a node set from the nodes in the layer connected to the nodes in the node set ; and finally, combine the node set , the node set , and the feature relationship to form a set of diagnostic difference knowledge graphs ;
[0024] Using a large language model , generate the medical response information A according to the patient's symptoms, the most relevant documents in the electronic health record (EHR) database corresponding to the patient's symptoms , the diagnostic difference knowledge graph , and its prompts .
[0025] Further, the emotional support expert model includes a soft prompt group , a dense retriever, and a parameter-frozen large language model;
[0026] The soft prompt group is composed of randomly initialized soft prompts. Each soft prompt has virtual tokens, hidden dimensions of the LLM, and a prompt length;
[0027] The dense retriever is used to calculate the similarity score set between the context embedding corresponding to the historical data context and each soft prompt , selecting a suitable target soft prompt from a soft prompt group
[0028] The parameter-frozen large language model is used to guide the input historical data context and the target soft prompt to generate the emotional support response. The technical scheme provided by the embodiment of the present application can include the following beneficial effects:
[0029] First, the consultation triage dialogue system receives the patient's consultation content, analyzes it through natural language processing technology (structure entropy guided probability coding), intelligently judges the type of consultation, including medical information consultation or emotional support. According to the judgment result, the system will divert the consultation content to the corresponding expert model. For medical information consultation, the system calls the expert model specializing in medical information, uses the retrieval enhancement generation (RAG) technology to obtain the latest and reliable information from the authoritative medical knowledge base, and generates personalized medical advice. For emotional support consultation, the system calls the expert model specializing in emotional support, understands the emotional needs of the patient based on the patient's historical communication data, and provides warm and thoughtful responses. Finally, the system returns the generated response to the patient, ensuring that the patient obtains timely and accurate information or emotional support during the consultation process, thereby improving the patient's satisfaction and treatment compliance. This workflow not only improves the efficiency and quality of medical consultation, but also provides personalized experience for patients and promotes the intelligent development of medical services. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 A flowchart of a consultation triage dialogue system based on a small expert model in the present application;
[0031] Figure 2 A structural schematic diagram of a four-layer hierarchical diagnosis knowledge graph in the present application;
[0032] Figure 3 A structural schematic diagram of a consultation triage dialogue system based on a small expert model in the present application. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present application will be described in detail below with reference to the accompanying drawings. The described embodiments are only a part of the embodiments of the present application.
[0034] In order to facilitate understanding of the technical solutions in the present application, the related technical terms in the present application are described as follows:
[0035] 1. Retrieval-Augmented Generation (RAG) is a natural language processing technique that combines retrieval and generation. The core idea is to improve the quality and accuracy of text generation by first retrieving relevant information and then using a generation model to generate an answer. Specifically, RAG first retrieves relevant information from a large knowledge base or document collection given a query , and obtains relevant documents from the knowledge base by a retrieval model , , where is the set of retrieved documents, and is the retrieval algorithm.
[0036] Through the search algorithm, the most relevant document fragments to the user's question are found. Next, the retrieved information will be combined with the user's input for the generation model (such as GPT, etc.) to generate more rich and contextually relevant answers. The advantage of RAG is that it can dynamically retrieve the latest information, not just rely on the knowledge learned by the model during training. This method helps to improve the accuracy and relevance of generated content, as it can use external information sources to supplement the model's knowledge. In addition, RAG can generate diverse answers to adapt to different contextual needs, so it performs well in question-answering systems, dialogue generation, and information summarization. This method effectively solves the limitations of traditional generation models in dealing with specific knowledge.
[0037] 2. Structural entropy and encoding tree: Structural entropy is a concept used to measure the complexity and information content of a system or structure, commonly applied in network science, information theory, etc. The structural entropy of a graph is defined as the minimum total number of bits required to encode the nodes in the graph . Structural entropy has been successfully applied in information retrieval, traffic prediction, and reinforcement learning. By minimizing the structural entropy of a given graph , the hierarchical clustering results of the vertices in the graph are preserved by the relevant encoding tree.
[0038] Encoding tree: Let be an undirected weighted graph, where is the set of vertices, is the set of edges, and is the edge weight matrix. The encoding tree of the graph is defined as a hierarchical root tree as follows:
[0039] 1) For each tree node A subset of vertices is associated with it. .
[0040] 2) The root node of the tree With vertex set Association, that is .
[0041] 3) For each Its direct successor Mark, from left to right Add, direct front-wheel drive is marked as .
[0042] 4) For each A direct successor Vertex subset They are disjoint and .
[0043] 5) For each leaf node , Only contains One of the vertices.
[0044] Structural entropy: Given a graph Arbitrary root coding tree , exist The structural entropy measure on the After reduction The remaining complexity. For each non-root node The structural entropy of its distribution is defined as:
[0045] ,in It is the tangent point, that is, at Neutrality is not The weights of edges between nodes in the array and It is volume, that is and The sum of the degrees of the nodes.
[0046] Given of The structural entropy is defined as: .
[0047] Structural entropy is introduced to quantify the internal information and organization of complex structures. It can be viewed as a measure of the relationships between the various components of a system.
[0048] The present application aims to improve the efficiency and quality of medical consultations, particularly in the fields of medical information consultation and emotional support, by constructing a consultation triage dialogue system based on a small expert model. This system utilizes advanced natural language processing techniques to intelligently determine the type of patient consultation and triage it to the appropriate medical information consultation large model or emotional support large model, thereby providing personalized and precise services. Specifically, the objectives of the present application include the following aspects:
[0049] 1. Improve the efficiency of medical consultations: In traditional medical consultation scenarios, patients often face long waiting times, and the responses they receive are often uncertain. This situation not only greatly reduces the patient's experience of seeking medical treatment, but also may cause the disease to worsen due to time delay. The system of the present application utilizes structural entropy to capture the structural information of data, and with the help of intelligent consultation content analysis technology, it can quickly and accurately identify the type of patient's needs, and then accurately triage the consultation content to the corresponding expert model. This efficient triage mechanism can greatly shorten the waiting time of patients, ensuring that patients obtain the required information support or emotional comfort in the shortest possible time, thereby improving the efficiency of medical consultations. The system uses natural language processing technology to deeply analyze the patient's consultation content, constructs a graph structure through structural entropy to mine the potential information of the problem, and accurately infers the patient's intention by analyzing the semantic, context, and other key elements in the text, to determine whether the demand belongs to information-based support or emotional-based support. This intelligent triage mechanism not only significantly improves the response speed of consultation, but also optimizes the allocation of medical resources, allowing patients to more efficiently obtain help.
[0050] 2. Improve the accuracy and reliability of medical information: In the medical field, accurate information is crucial, especially when patient consultations involve disease management and treatment plans. The present application uses Retrieval-Augmented Generation (RAG) technology in combination with authoritative medical knowledge bases to ensure that the information provided is based on the latest medical guidelines and research findings. This method effectively improves the accuracy of medical information, helping patients obtain personalized medical advice and avoiding misleading information that may occur in traditional consultations. Specifically, for information-based consultations, the system automatically calls expert models specializing in medical information and combines them with authoritative knowledge bases to ensure that the information provided is not only accurate but also timely. This combination not only improves the reliability of medical information, but also generates personalized medical advice based on the patient's specific health status, medical history, and other information. This precise information support not only helps patients better understand their health status, but also provides a strong basis for their decision-making.
[0051] 3. Providing personalized emotional support: Emotional support is also an important aspect that cannot be ignored in the medical process, especially for patients who are facing long-term treatment. The emotional support model of the present application can understand the emotional needs of the patient based on the patient's historical communication data and provide warm and thoughtful responses. This personalized emotional support not only improves the patient's satisfaction, but also enhances the patient's treatment compliance, thereby improving the overall treatment effect. Specifically, when the patient expresses emotions such as anxiety and worry, the system can respond in a timely manner and provide effective emotional support to help the patient relieve psychological stress. In addition, the system will adjust its response strategy according to the emotional state of the patient in order to better meet the emotional needs of the patient. This personalized emotional support not only improves the patient's psychological comfort, but also enhances their confidence in the treatment plan.
[0052] In summary, the present application aims to solve various problems existing in traditional medical consultation, including poor information transmission, long response time, and unclear answer field, by constructing a consultation shunt dialogue system based on a small expert model. This system not only improves the efficiency and accuracy of medical consultation, but also provides personalized emotional support, reduces the consumption of medical resources, and promotes the accessibility of medical services, providing patients with a safer, more reliable, and more personalized medical consultation experience.
[0053] Specifically, the consultation shunt dialogue system based on a small expert model in the present application includes a demand judgment module, a medical information consultation expert model, and an emotional support expert model, as shown in Figure 1 .
[0054] S101, obtaining the consultation content of the user through the demand judgment module, analyzing the consultation content through the structural entropy guided probability coding technology, judging the type of the consultation content, and shunting the consultation content to the corresponding small expert model according to the type of the consultation content, and returning the response content generated by the small expert model to the user for the consultation content.
[0055] Specifically, the analysis of the consultation content through the structural entropy guided probability coding technology includes: converting the consultation content into a vector representation , using an encoder to encode the vector representation to obtain a latent variable , calculating the structural entropy of the latent variable by constructing a graph structure, and judging the type of the consultation content according to the structural entropy;
[0056] The structural entropy of the latent variable is calculated by constructing a graph structure, including: constructing an adjacency matrix according to the embedding of the latent variable , the adjacency matrix is hierarchically divided by using a three-layer coding tree , the structural entropy of the intermediate nodes in the three-layer coding tree is calculated, and the probability distribution of the latent variables is adjusted according to the maximization of the structural entropy;
[0057] According to the structural entropy, the type of the consultation content is judged, including: performing linear transformation on the partial probability distribution of the latent variables to obtain a corresponding score vector , converting the score vector based on a Softmax classification function, calculating an information class demand probability and an emotional class demand probability ; if the information class demand probability is greater than the emotional class demand probability , it is determined that the type of the consultation content is a medical information class , and if the emotional class demand probability is greater than the information class demand probability , it is determined that the type of the consultation content is an emotional support class .
[0058] S102, if the type of the consultation content is a medical information class, the consultation content is shunted to a medical information expert model, and relevant information is obtained from a hierarchical diagnosis knowledge graph by using a retrieval and enhancement generation technology to generate a medical information response.
[0059] Specifically, the hierarchical diagnosis knowledge graph includes four layers, and a multi-hop path from the top layer to the bottom layer is represented as: , is a set of all disease names extracted from an electronic health record (EHR) database , represents a subcategory set of , is a category set obtained by aggregating the subcategory set, is a set of disease performance characteristics, including and two subtypes, represents a large language model enhanced disease-specific feature, represents a feature extracted from the symptoms and performance in the electronic health record (EHR) database ; represents a hierarchical or subordinate relationship, is a feature relationship between a disease and a disease performance characteristic;
[0060] The retrieval and enhancement generation technology is used to obtain relevant information from the hierarchical diagnosis knowledge graph to generate a medical information response, including: performing linear transformation on the consultation content Semantic segmentation of the description, and the manifestation of patient symptoms Decomposed into patient characteristics Patient characteristics In the hierarchical diagnostic knowledge graph Layer nodes The matching process yields a set of clinical characteristic nodes, which is: The set of feature nodes in the layer with a matching degree greater than a threshold; for each node in the set of clinical characteristic nodes. Determined by traversing upwards. The disease subcategory node that is closest to it in the layer is used as the target subcategory node. ;Target subcategory node As the parent node, use a downward traversal method to reach... Layer, retrieval and target subcategory nodes All adjacent Layer nodes The resulting set of nodes This will then be related to the node set. Middle node Connected Nodes in the layer Form a set of nodes Finally, the node set Node set and characteristic relationship Combined to form a diagnostic differential knowledge graph A set; using a large language model Based on the patient's symptoms Electronic Health Record (EHR) database Symptoms of patients The most relevant documents Diagnostic Difference Knowledge Graph and its prompts Generate medical response information A, i.e. .
[0061] S103. If the type of consultation content is emotional support, the consultation content will be diverted to the emotional support expert model to generate an emotional support response based on the user's historical data context.
[0062] Specifically, the emotional support expert model includes soft cue groups. Large language models with dense retrieval and parameter freezing; soft prompting groups Depend on It consists of several randomly initialized soft prompts. Each soft prompt has... A virtual token, It is the hidden dimension of LLM. is the prompt length; the dense retriever is used to compute the context embedding corresponding to the history data context with each soft prompt a set of similarity scores , selects the appropriate target soft prompt from the set of soft prompts ; the parameter frozen large language model is used to guide the input history data context and the target soft prompt to generate an emotional support response.
[0063] a set of similarity scores is computed as follows:
[0064] For each soft prompt in the set of soft prompts , a context embedding is first obtained from the history data context through an embedding layer , and then passed through two linear layers and to obtain similarity scores and , respectively. The similarity scores and are then averaged along the dimensions to obtain the original similarity score : , which is then processed by a Softplus activation function to obtain the normalized similarity score : , , , i is an integer greater than or equal to 1 and less than or equal to K;
[0065] The set of similarity scores corresponding to each soft prompt in the set of soft prompts is formed into a set of similarity scores .
[0066] The data collection, demand judgment module, medical information consultation expert model, and emotional support expert model in the counseling diversion dialogue system will be further described as follows: Figure 3
[0067] Data collection and data sources are the basis for building the demand judgment module of the medical companion model. The quality and diversity of the data directly affect the performance and generalization ability of the model. The following will be described from two aspects of data sources and data types.
[0068] Data sources include hospital information systems (HIS), online medical platforms, social media and health communities, and medical companion agencies.
[0069] Hospital Information System (HIS): The hospital's information system stores a large amount of patient-related data, including medical records, diagnosis results, treatment plans, etc. These data can provide important information for understanding the basic health status and medical needs of patients. For example, through medical records, we can understand the patient's disease history, allergy history, etc., which helps to determine the background and possible needs of the patient's consultation content.
[0070] Online medical platform: With the development of Internet medicine, many online medical platforms have accumulated rich patient consultation data. These data include patient-doctor conversation records, health consultation posts, etc. The data of online medical platforms has the characteristics of diversity and real-time, which can reflect the needs of different patients in different scenarios.
[0071] Social media and health community: Social media and health communities are important platforms for patients to communicate health problems and share experiences. On these platforms, patients will post their symptoms, concerns and needs, which can provide valuable information for understanding the emotional state and potential needs of patients. For example, patients express fear and anxiety about diseases in health communities, which may indicate the need for emotional support.
[0072] Medical escort agency: Medical escort agencies record patient needs and feedback during the provision of escort services. These data can provide direct information for understanding the needs of patients in the actual escort process, which helps to optimize the performance of the demand judgment module.
[0073] Data types include text data, structured data and time series data; Text data mainly includes patient consultation content, case records, diagnosis reports, etc. Text data is the core data of demand judgment, and through the analysis of text, we can understand the type and specific content of patient demand. Structured data: such as patient's basic information (age, gender and medical history), vital signs data (body temperature, blood pressure, heart rate, etc.). Structured data can provide supplementary information for text data, which helps to understand the patient's demand more comprehensively. Time series data: If there is data of multiple consultations or long-term health monitoring of patients, time series data can reflect the trend and periodicity of patient demand. For example, the symptoms of some chronic disease patients may worsen in a certain period of time, and through the analysis of time series data, we can predict the patient's demand in advance.
[0074] Data preprocessing is a key step to ensure the performance of the model, covering multiple important aspects: text data cleaning, data standardization and normalization.
[0075] Text data cleaning: First, input the raw text dataset. Duplicate records in the dataset can lead to overfitting and bias in the model. By removing duplicates, each sample is ensured to be unique, thereby improving the model's training performance. Text data often contains spelling errors, inconsistent formatting, or other inaccurate entries. Missing values also significantly impact model training. Missing data can be handled by deleting records, imputing missing values with the mean or median, or using more complex methods (such as interpolation or prediction models) to ensure dataset integrity. Additionally, clean up special characters, numbers, and extra spaces in the text to reduce data noise and improve readability.
[0076] Data labeling and normalization: Standardization and normalization are essential steps when dealing with data of different dimensions and distributions. The system inputs a cleaned text dataset and performs standardization and normalization on it. Data standardization transforms numerical data into a distribution with a mean of 0 and a standard deviation of 1. This process helps eliminate scale differences between features, making the model more efficient and stable during training. Normalization scales feature values to a specific range (e.g., 0 to 1). When data has different dimensions, normalization ensures all features are on the same scale, preventing some features from having an excessive impact on the model. Through these steps, data preprocessing significantly improves the model's training efficiency and final performance, providing a solid foundation for subsequent analysis and output.
[0077] For the demand assessment module of the large-scale medical model, probabilistic coding technology guided by structural entropy can more effectively analyze patient consultation content and accurately determine their demand type. This module is mainly implemented through the following steps:
[0078] Data preprocessing and encoding: The patient's consultation content is vectorized and transformed into a format suitable for model input, denoted as . An encoder is used to encode the input, mapping it to a Gaussian distribution, where is the latent variable, and all distributions constitute the embedding space of the latent variable. This process follows the encoder operation of the classical probabilistic coding model, learning to obtain the probability representation of the input data in the latent space, as shown in the formula: .
[0079] Constructing Graphs and Computing Structural Entropy: Based on Encoded Latent Variables Embedded , construct graph Construct an adjacency matrix The formula representing the relationship between latent variables is: ,in It is the sigmoid activation function, used to ensure that the elements of the adjacency matrix are positive.
[0080] Using tags (demand type: informational or sentimental) as the optimal data partitioning, a three-layer coding tree is constructed. 1. The intermediate nodes of the coding tree represent the categories of the classification task (information or sentiment), and each leaf node (i.e., the input data) represents the category. Assign the node to the appropriate intermediate node based on its label. Define the assignment matrix. ( The number of leaf nodes. Here is the number of intermediate nodes. (corresponding to information category and emotion category respectively). Indicates the first The leaf node belongs to the first kind.
[0081] Calculate the structural entropy of the coding tree; structural entropy is in the graph. and coding tree The definition under 1 is:
[0082] , ;
[0083] in, It is a connection The sum of the edge weights between internal and external points; It is a picture The sum of the degrees of all data points in 1; yes Volume; yes The parent node. The structural entropy of the intermediate layer nodes in a three-layer coding tree. The formula is: Using adjacency matrix and allocation matrix Its regularization loss format is: ,in, It has shape The full matrix.
[0084] By maximizing structural entropy This can constrain the probability distribution of latent variables, allowing data belonging to different demand types (information and sentiment) to be better separated in the latent space, thereby enhancing the model's ability to distinguish between different demand types.
[0085] Training and optimization of the demand judgment module: Probabilistic encoding is performed using an encoder-only architecture, and its overall loss is: ,in, It is the basic loss function for probabilistic coding. The appropriate loss function can be selected according to the task type, such as the cross-entropy loss in classification tasks. is a hyper-parameter to control the weight of structural entropy regularization loss . During the training process, the overall loss is minimized by adjusting the model parameters , so that the model can learn the feature representation related to the demand type and improve the accuracy of demand judgment.
[0086] The demand type judgment of the demand judgment module is as follows:
[0087] 1. New input data encoding: when the demand judgment module is trained, when receiving new patient consultation content , first input it into the trained encoder . The encoder is a key component that has learned the data feature representation in the training stage, which will map the input consultation content to the latent space to get the latent variable . This process is feature extraction and conversion of input data, so that the data exists in a form more suitable for model processing and analysis, that is .
[0088] 2. Demand type judgment based on Softmax classifier: Softmax function (i.e. Softmax classifier) is a commonly used multi-classification activation function, which can convert the output of the classifier to a probability distribution, so that the sum of the probabilities of all categories is 1. In our demand judgment module, assume there are two categories: information class demand and emotion class demand, represented by information class and emotion class.
[0089] Let the score vector obtained by linear transformation of the latent variable by the classifier be , where is the score of the information class demand, is the score of the emotion class demand. The score vector is obtained through a linear layer ( ), where is the weight matrix, is the bias vector.
[0090] The Softmax function converts the score vector to calculate the probability of each category as follows:
[0091] , where is the probability of the consultation content belonging to the information class demand, is the probability of belonging to the emotion class demand.
[0092] According to the probability distribution output by the Softmax function, the class with the maximum probability is selected as the final demand judgment result, that is: Through the demand judgment module based on the structural entropy guided probability coding technology above, the patient's consultation content can be more accurately analyzed, providing a reliable basis for subsequent calling of the corresponding expert model (medical information consultation model or emotional support model), and realizing efficient diversion and precision of medical accompanying service.
[0093] For the medical information consultation model of the medical large model, given an electronic health record EHR database and a large language model , the goal is to build a four-layer hierarchical diagnosis knowledge graph , and the multi-hop path from the top layer to the bottom layer of the hierarchical diagnosis knowledge graph is represented as: , is the set of all disease names extracted from the electronic health record EHR database , represents the subcategory set of , is the category set after aggregating the subcategory set, is the set of disease performance characteristics, including and two subtypes, represents the disease-specific features enhanced by the large language model , represents the features extracted from the symptoms in the electronic health record EHR database ; represents the hierarchical or subordinate relationship, is the feature relationship between diseases and disease performance characteristics. The hierarchical diagnosis knowledge graph is shown in Figure 2 .
[0094] For a given hierarchical diagnosis knowledge graph and an input patient performance , let , represent a certain subcategory determined from , the goal is to extract the diagnosis difference knowledge graph related to from the hierarchical diagnosis knowledge graph .
[0095] 1. Disease knowledge graph construction:
[0096] Diseases in electronic health record databases take many forms and are represented in various ways. Firstly, disease clustering is used to group the original disease descriptions. Unified as , represented as: ,in Indicates application to Clustering model, It is an embedded model.
[0097] Then use the unified version A four-layer hierarchical disease knowledge graph is constructed through hierarchical aggregation. This graph integrates the relationships between diseases and their potential categories, with each disease aggregated into a subcategory and a category. The disease knowledge graph is defined as follows: ,Depend on and large language models It is formed by polymerization, and the formula is as follows: .
[0098] During the retrieval phase, a large language model is used. Topic aggregation The most relevant topics are extracted to aggregate subcategories. These subcategories are then further aggregated into higher-level categories, forming a hierarchical structure from subcategories to broader categories. Next, hierarchical clustering will be applied... Diseases are assigned to subcategories of topics within an aggregate, and then these subcategories are assigned back to the main topics. This method leverages the powerful semantic understanding and topic extraction capabilities of large language models, enabling more detailed classification of diseases within topic aggregation. By applying hierarchical clustering to topics based on large language models, The diseases in the data are aggregated into a hierarchical structure. Hierarchical aggregation is... Multiple levels of granularity were introduced to ensure that diseases with different symptom presentations could be appropriately classified. This was done to effectively utilize data from the Electronic Health Record (EHR) database. Historical diagnostic results serve as an accurate representation of disease symptoms, and are used to break down... The symptoms of diseases in traditional Chinese medicine are analyzed as discrete features. From each Each individual feature (such as symptoms, location, or activity limitation) is created as a node. This final decomposition yielded a comprehensive hierarchical disease knowledge graph. It captures both disease category information obtained from hierarchical aggregation and related features.
[0099] 2. Enhanced symptoms of knowledge graph:
[0100] For a given hierarchical diagnostic knowledge graph and input patient manifestations , set , represents a certain subcategory determined from , the goal is to extract the diagnosis difference knowledge graph related to from the hierarchical diagnosis knowledge graph . .
[0101] The knowledge in the hierarchical disease knowledge graph only contains information from the electronic health record (EHR) database , which is not enough to accurately diagnose all diseases, especially in distinguishing diseases with similar clinical manifestations. Therefore, integrating external knowledge is crucial. In order to supplement the diagnosis knowledge graph with key knowledge that does not exist in , external knowledge is added to , which helps to distinguish diseases with similar symptoms. All diseases are traversed and prompts designed specifically for searching and generating subtle differences in diseases on large language models are used . As shown in the following formula: , where and represent the large language model and its prompts for disease symptom manifestation enhancement, respectively.
[0102] Each generated diagnosis key difference node is then connected to its corresponding through the relationship . In this way, a chain is formed. For example, a symptom manifestation and relationship is generated for the disease node "lumbar osteoarthritis", and a chain is formed: :<l𝑢𝑚𝑏𝑎𝑟_𝑠𝑝𝑜𝑛d𝑦l𝑜𝑠𝑖𝑠, ℎ𝑎𝑠_𝑠𝑦𝑚𝑝𝑡𝑜𝑚, 𝑠𝑡𝑖𝑓𝑓𝑛𝑒𝑠𝑠_𝑜𝑟_𝑝𝑎𝑖𝑛_𝑖𝑛_𝑡ℎ𝑒_l−𝑜𝑤𝑒𝑟_𝑏𝑎𝑐𝑘>. The final hierarchical disease knowledge graph integrates and to form .
[0103] 3. Diagnosis difference knowledge graph search:
[0104] 3.1, patient symptom decomposition
[0105] For a given patient symptom manifestation , the sentence segmentation, breaking it down into more detailed patient features , denoted as . A mapping function is defined to describe this process as follows: .
[0106] Further, a semantic similarity score 𝑠𝑖𝑚 between patient features and is calculated as follows: where, is a similarity model, is an embedding model applied to and before computing similarity.
[0107] 3.2, Clinical Feature Matching
[0108] For each patient feature , the top 𝑚 most similar are retrieved, where 𝑚 represents the number of closest matches selected. Overall, the system retrieves 𝑛 × 𝑚 matching nodes in the knowledge graph .
[0109] To address the case where has no close matches in , we introduce an indicator function to filter out irrelevant matches:
[0110] ,
[0111] and, .
[0112] where, denotes the set of nodes that satisfy the condition . The indicator function ensures that only with a similarity score higher than a threshold will be selected into .
[0113] Through clinical feature matching, we successfully matched the query with the most relevant clinical feature nodes in the hierarchical diagnostic knowledge graph .
[0114] 3.3, Upward Traversal
[0115] To precisely match the most relevant for a patient, an upward traversal method is adopted, which traverses the graph based on and The votes are aggregated by the shortest path distance between them to determine the closest disease subcategory.
[0116] For each disease node , its shortest path to each disease subcategory is computed by traversing upwards in the graph. The shortest path distance from to is denoted as . If represents the closest disease subcategory node to the current , the vote for is incremented by one. Then, the votes for each are accumulated in the reverse process and the node with the highest number of votes is determined as . This voting process is formalized by the indicator function as follows:
[0117]
[0118]
[0119] With this as the parent node, we traverse downwards to to retrieve all adjacent to and their adjacent . Given , let denote the set of disease nodes belonging to . Similarly, define: , which represents the set of feature nodes connected to the disease nodes in .
[0120] We connect all triples where and to form the set of diagnostic discrepancy knowledge graphs:
[0121] where denotes the diagnostic discrepancy knowledge graph used for subsequent large language model inference.
[0122] 3.4 Active diagnosis questioning mechanism
[0123] Inaccurate diagnoses often result from insufficient or incomplete patient descriptions. To address this issue, an active diagnosis questioning mechanism is proposed here. When the initial input lacks some key information needed by doctors or large language models to make more accurate diagnosis decisions, this mechanism acts as a co-pilot and asks targeted follow-up questions.
[0124] In diagnostic knowledge graph In, a feature May be associated with multiple disease nodes Connected, and each The distinguishing power varies. For example, some features are more common, such as "lower back pain," while others represent more distinctive characteristics, such as "pain worsens when walking." Here, we will... The discrimination score is defined as its performance in the knowledge graph. The reciprocal of degree centrality in:
[0125] ,in, Representation of knowledge graph middle The total number. For each feature node. Calculate the discrimination score And select the nodes with the highest discrimination scores, as shown below: ,
[0126] in, This indicates the selected features with the highest discrimination scores, which are used to proactively guide follow-up questions to clarify the diagnosis.
[0127] The knowledge graph-driven reasoning-enhanced generative model is a core component of the medical retrieval-enhanced generative model, using a large language model (LLM) to generate diagnostic results, personalized treatment plans, and medication recommendations. Furthermore, the system proactively provides doctors with suggestions for follow-up questions to clarify missing or ambiguous information about the patient. As shown in the formula below, this utilizes a diagnostic differential knowledge graph enhanced by a large language model and specially designed prompts. To stimulate the reasoning ability of large language models.
[0128] Unlike most retrieval-enhanced generative model systems that focus on answering short factual questions, this system is tailored for complex tasks in clinical settings. The cues are specifically designed to optimize the reasoning capabilities of large language models, particularly in distinguishing diseases with similar symptom presentations. The system leverages retrieved documents and information from a knowledge graph. The diagnostic difference knowledge graph extracted is used for comprehensive reasoning.
[0129] Use the electronic health record database as a document repository to retrieve data related to patient symptom presentation. The most relevant documents Then, a similarity search is performed on the database to identify the K most relevant records. After obtaining all the inputs, we designed a specific hint. , for guiding large language models through diagnostic differential knowledge graphs Reasoning, generating answers to help doctors distinguish similar diseases, and automatically generating follow-up questions.
[0130] For the emotional support expert model of the medical large model, in the medical accompanying scene, the emotional needs of patients are complex and diverse, and how to provide accurate and personalized emotional support is crucial. To this end, this module builds a medical accompanying emotional support large model, aiming to provide better emotional care for patients.
[0131] In the emotional support scene of medical accompanying, the context composed of the patient's consultation content and dialogue history is . Among them, represents the patient's personal characteristic information, such as age, gender, and illness, which is used to describe the patient's basic situation; represents the patient's dialogue history between the medical accompanying system , reflecting the communication process. The goal is to generate a reply that meets the patient's emotional needs and gives the patient appropriate emotional support.
[0132] 1. Architecture design
[0133] The emotional support large model architecture mainly includes a soft prompt group, a dense retriever, and a frozen large language model (LLM).
[0134] Soft prompt group: Let represent the soft prompt group, which is composed of randomly initialized soft prompts. Each soft prompt has virtual tokens, is the hidden dimension of LLM, is the prompt length. In the training process, the soft prompt is fine-tuned, while the LLM remains frozen.
[0135] Dense retriever: responsible for selecting appropriate soft prompts from the soft prompt group. It calculates the similarity score between the context embedding and each soft prompt , sorts the soft prompts according to the score, and finds the soft prompt that best fits the current context.
[0136] LLM: Decoder-only causal language model, weight frozen, initialized by pre-trained model. The selected soft prompt is combined with the context and input into the LLM to guide it to generate an emotional support reply.
[0137] 2. Calculate the similarity of soft prompts and context
[0138] To reduce the computational overhead, the dense retriever utilizes two linear layers and to compute the similarity score. The detailed computation process is as follows:
[0139] First, the context embedding is obtained by the word embedding layer of the LLM and passed through linear layers and and respectively. Then, the average of and is taken along the dimension to obtain and . Finally, the raw similarity score
[0140]
[0141] is computed. After being processed by the Softplus activation function, the normalized similarity score is obtained, which ensures the score is in the interval and improves the numerical stability during training.
[0142] 3. Learning prompt selection
[0143] 3.1, Soft prompt loss
[0144] Given the context and its corresponding ideal reply , the negative log-likelihood loss of each soft prompt is computed. The prediction is first obtained by and then the loss is computed by , where denotes the concatenation operation, is the forward propagation operation of the LLM, is the negative log-likelihood loss function. This generates K loss values , which are used to measure the prediction ability of each soft prompt.
[0145] 3.2, Prompt selection loss
[0146] Due to the lack of explicit labeling of dialogue settings, it is challenging to update the retriever to select the best soft prompt. The loss of the soft prompt in the LLM is used to guide the selection. By the KL divergence between the negative language model loss and the similarity score, the performance evaluation of the LLM is aligned with the similarity score of the retriever. Specifically, let be the similarity score of each soft prompt in the soft prompt group, the prompt selection loss is defined as:
[0147] , where is a Softmax function, is a temperature hyperparameter, is the KL divergence. This loss ensures that the dense retriever's selection is consistent with the LLM's performance, effectively reflecting the ability of soft prompts to generate relevant responses.
[0148] 3.3, Context-prompt contrastive learning
[0149] To avoid the retriever always choosing a single soft prompt and promote prompt diversity, we introduce a context-prompt contrastive loss. This loss adjusts the similarity score based on the text similarity of different contexts, with the formula:
[0150] where is a distance function (such as BLEU), is a threshold, is the context and the cosine similarity score vector of soft prompts in the soft prompt group, is the cosine similarity. This contrast strategy enhances the cosine similarity for similar contexts and weakens it for dissimilar ones, ensuring consistency between the retriever and the LLM evaluation, while also improving the diversity and uniqueness of the dialogue context and enhancing the model's adaptability.
[0151] 3.4, Prompt fusion learning
[0152] To optimize the effectiveness of soft prompts, we use a prompt fusion learning loss. This loss averages the prediction probabilities of all soft prompts in the soft prompt group, with the formula:
[0153] , ;
[0154] In this way, the advantages of different soft prompts are combined, smoothing the variance and bias of individual prompts, improving the accuracy and reliability of overall prediction, and enhancing the model's ability to generate appropriate responses.
[0155] 3.5, Overall objective function
[0156] The training of the emotional support large model relies on the synergistic effect of the above loss functions. The soft prompt loss ensures the accuracy of the LLM, the prompt selection loss makes the retriever consistent with the LLM output, the context-prompt contrastive loss promotes the diversity of prompt selection, and the prompt fusion learning loss improves the overall performance of all soft prompts. The overall objective function is:
[0157]
[0158] where , , is a hyper-parameter that controls the relative contribution of each loss component. During training, we minimize , balancing the fidelity of the LLM, the accuracy of the retriever, and the diversity of the prompt selection, to build an adaptive emotional support dialogue generation system.
[0159] 3.6, Inference
[0160] In the inference phase, the dense retriever selects the most appropriate soft prompt from the soft prompt set according to the given context, and inputs it together with the context into the LLM for decoding to generate the final reply. The specific process is as follows:
[0161] , ,
[0162] where is the selected soft prompt, is the reply generated by the LLM.
[0163] Through the above method based on selective prompt adjustment, the medical companion emotional support large model can more effectively understand the emotional needs of patients, generate more targeted and personalized emotional support replies, and improve the quality of medical companion services, providing warm and thoughtful emotional care for patients during the medical process.
[0164] The operation process of the consultation diversion dialogue system is as follows:
[0165] 1. Consultation content reception
[0166] The system listens to the user's input consultation information in real time, which is input in natural language form. These contents cover disease symptom description, treatment-related questions, worries about the disease, and various consultation problems.
[0167] The input consultation content enters the demand judgment classification module. First, the content will be vectorized and converted into a format suitable for model analysis, and then mapped to the latent space of Gaussian distribution through the encoder to obtain the latent variable. Then, based on the latent variable, a graph structure is constructed, the structural entropy is calculated, and the probability distribution of the latent variable is constrained by maximizing the structural entropy, so that the data of information and emotional needs in the latent space can be better separated. After that, the Softmax classifier is used to process the new input data, and according to the probability distribution output by the classifier, it is judged whether the consultation content belongs to medical information consultation or emotional support consultation.
[0168] 2. Medical information consultation processing
[0169] If it is determined to be medical information consultation, the system calls the medical information consultation module. In this module, first, according to the patient's symptom description, the sentence segmentation is performed, the symptoms are decomposed into detailed features, and are matched with the clinical features in the diagnosis knowledge graph. Through the calculation of semantic similarity score, the nodes with similarity higher than the threshold are screened out.
[0170] Then, by using the upward traversal method, the closest disease subclass is determined based on the shortest path distance aggregation voting, and then the disease nodes and feature nodes related to the closest disease subclass are retrieved to form a diagnosis difference knowledge graph. At the same time, the system will use the large language model to reason based on the diagnosis difference knowledge graph and the information input by the patient to generate a diagnosis result, a personalized treatment plan and a medication suggestion. If the initial input information is incomplete, the system will also start the active diagnosis questioning mechanism to ask the patient targeted questions to obtain more information to improve the diagnosis.
[0171] 3. Emotional support consultation processing
[0172] If it is determined to be emotional support consultation, the system calls the emotional support module. The dense retriever in this module will select the most suitable soft prompt from the soft prompt group according to the context formed by the patient's consultation content and dialogue history. The specific process is to first calculate the similarity score between the context embedding and each soft prompt, and then select the soft prompt with the highest score after sorting. Then, the selected soft prompt is combined with the context and input into the frozen large language model for decoding to generate a reply that meets the patient's emotional needs, providing emotional support to the patient.
[0173] The consultation shunt dialogue system based on the small expert model constructed by the present application brings innovation and reform to the field of medical consultation. In data processing, through multi-source collection and fine preprocessing, the quality and diversity of the data are ensured, laying a solid foundation for subsequent analysis. The demand judgment classification module uses the structure entropy guided probability coding technology to accurately analyze the patient's consultation content and efficiently distinguish information and emotional needs, realizing intelligent shunt of consultation.
[0174] The medical information consultation module improves the reasoning ability of the retrieval augmented generation (RAG) model by constructing a diagnosis knowledge graph, and combines the active diagnosis questioning mechanism to provide accurate and personalized medical advice for patients, effectively assisting doctors in diagnosis and decision-making. The emotional support module uses unique architecture design and multi-loss function collaborative training to deeply understand the emotional needs of patients, generate warm and targeted responses, and significantly improve the patient's medical experience.
[0175] From the actual application effect, the system effectively solves many problems of traditional medical consultation. The waiting time of patients is greatly shortened, the consultation efficiency is improved, the accuracy and reliability of medical information are guaranteed by relying on authoritative knowledge base and advanced technology, and the treatment compliance of patients is enhanced by personalized emotional support based on historical data of patients.
[0176] In summary, the consultation shunt dialogue system of the application provides an effective solution for the optimization and upgrading of medical consultation service with its advantages in technical innovation, function implementation and application effect, and has important application value in the medical field.
[0177] The above disclosure is only the preferred embodiment of the application, of course, cannot limit the scope of the right of the application, those skilled in the art can understand that the whole or part of the above-mentioned embodiment is implemented, and the equivalent changes made according to the claims of the application still belong to the scope covered by the application.
Claims
1. A consultation triage dialogue system based on a small expert model, characterized in that, include: Demand assessment module, medical information consultation expert model, and emotional support expert model; The user's inquiry content is obtained through the demand judgment module. The inquiry content is analyzed by the probabilistic coding technology guided by structural entropy to determine the type of the inquiry content. Based on the type of the inquiry content, the inquiry content is diverted to the corresponding mini-expert model. The response content generated by the mini-expert model for the inquiry content is returned to the user. If the type of consultation content is medical information, the consultation content will be diverted to the medical information expert model, and relevant information will be obtained from the hierarchical diagnostic knowledge graph through retrieval enhancement generation technology to generate a medical information response; The hierarchical diagnostic knowledge graph It includes four layers, and the multi-hop path from the top layer to the bottom layer is represented as follows: , From the Electronic Health Record (EHR) database The collection of all disease names extracted from it. represent The set of subcategories, This is the category set after aggregating the subcategory set. A collection of disease manifestations, including and Two subtypes, Represents a large language model Enhanced disease-specific characteristics, Represents the Electronic Health Record (EHR) database The features derived from the decomposition of symptom manifestations extracted from them; Indicates a hierarchical or subordinate relationship. It refers to the characteristic relationship between diseases and their manifestations; The method utilizes retrieval enhancement generation techniques to analyze hierarchical diagnostic knowledge graphs. Retrieve relevant information and generate a medical information response, including: Regarding the patient's symptoms in the consultation content The description is semantically segmented to represent the patient's symptoms. Decomposed into patient characteristics ; The patient characteristics With the hierarchical diagnostic knowledge graph middle Layer nodes Matching is performed to obtain a set of clinical characteristic nodes. The set of clinical characteristic nodes is The set of feature nodes in a layer whose matching degree is greater than a threshold; For each node in the set of clinical characteristic nodes Determined by traversing upwards. The disease subcategory node that is closest to it in the layer is used as the target subcategory node. ; Target subcategory node As the parent node, use a downward traversal method to reach... Layer, retrieval and target subcategory nodes All adjacent Layer nodes The resulting set of nodes This will then be related to the node set. Middle node Connected Nodes in the layer Form a set of nodes Finally, the node set Node set and characteristic relationship Combined to form a diagnostic differential knowledge graph A set; Using large language models Based on the patient's symptoms Electronic Health Record (EHR) database Symptoms of patients The most relevant documents Diagnostic Difference Knowledge Graph and its prompts Generate medical response information A, i.e. ; If the consultation content is of the emotional support type, then the consultation content will be diverted to the emotional support expert model, which will generate an emotional support response based on the user's historical data context.
2. The consultation triage dialogue system according to claim 1, characterized in that, The analysis of the consultation content using probabilistic coding technology guided by structural entropy includes: The consultation content is converted into a vector representation. Encoder For the vector representation Encode to obtain latent variables The latent variables are calculated by constructing a graph structure. The structural entropy is used to determine the type of the consultation content; The latent variables are calculated by constructing a graph structure. The structural entropy includes: According to the latent variables Embedded The graph is constructed ; Using information and emotion categories as demand type labels for the graph The hierarchy is divided to obtain a three-layer coding tree. 1; Calculate the structural entropy of the intermediate layer nodes of the three-layer coding tree, and constrain the latent variables according to the maximization of the structural entropy. The probability distribution; The step of determining the type of consultation content based on the structural entropy includes: For the latent variables The corresponding score vector is obtained by performing a linear transformation on the probability distribution. The score vector is based on the Softmax classification function. Perform the transformation and calculate the probability of information-related demand. And the probability of emotional needs ; If the probability of the aforementioned information type demand Greater than the probability of the emotional category demand The type of consultation content is determined to be medical information. If the probability of the emotional type demand Greater than the probability of demand for the aforementioned information class The type of consultation content was determined to be emotional support. .
3. The consultation triage dialogue system according to claim 2, characterized in that, The demand assessment module uses an encoder architecture for probabilistic encoding, and its overall loss function is: ,in, It is the basic loss of probabilistic coding. For regularization loss, These are hyperparameters used to control the structure entropy regularization loss. The weights; Regularization loss Through the adjacency matrix and allocation matrix The calculated formula is as follows: ,in, For having shape The complete matrix, The number of leaf nodes. The number of intermediate nodes; the adjacency matrix Used to represent latent variables The relationship between them is represented as: , It is the sigmoid activation function, used to ensure that the elements of the adjacency matrix are positive.
4. The consultation triage dialogue system according to claim 1, characterized in that, The patient characteristics With the hierarchical diagnostic knowledge graph middle Layer nodes To perform matching, including: For each patient characteristic, calculate the patient characteristics. and the node semantic similarity score between The calculation formula is as follows: ,in, It's a similarity model. It is applied to patient features before calculating similarity. and nodes Embedded model; Use indicator functions semantic similarity score Greater than the threshold nodes The set of clinical characteristic nodes ; in, , 。 5. The consultation triage dialogue system according to claim 1, characterized in that, The method of determining by upward traversal is mentioned. The disease subcategory node that is closest to it in the layer is used as the target subcategory node. ,include: For nodes Through the hierarchical diagnostic knowledge graph Traverse the nodes from top to bottom To each disease subcategory shortest path And select the node with respect to the current node. closest disease subcategory node ; via indicator function Determine the node with the highest number of votes The node is identified as the target sub-category node. , where the indicator function Defined as: The target sub-category node Represented as: .
6. The consultation triage dialogue system according to claim 1 or 4, characterized in that, The consultation triage system incorporates a proactive diagnostic questioning mechanism and also includes: For the set of clinical characteristic nodes, compute nodes The hierarchical diagnostic knowledge graph The reciprocal of degree centrality in As a node The discrimination score; In the aforementioned proactive diagnostic questioning mechanism, nodes are used. The features corresponding to the nodes with the highest discrimination scores are used to proactively guide follow-up questions to clarify the diagnosis.
7. The consultation triage dialogue system according to claim 1, characterized in that, The emotional support expert model includes soft cue groups. Dense retrieval systems and large language models with parameter freezing; The soft notification group Depend on It consists of several randomly initialized soft prompts, each soft prompt having A virtual token, It is the hidden dimension of LLM. To indicate the length; The dense retrieval tool is used to calculate the context embedding corresponding to the historical data context. With each soft tip Similarity score set between , From the soft tip group Select the appropriate target soft prompt; The parameter-frozen large language model is used to guide the input historical data context and target soft cues to generate the sentiment support response.
8. The consultation triage dialogue system according to claim 7, characterized in that, The similarity score set The calculation process is as follows: For soft prompt group Each soft hint in the text is first processed through the embedding layer. Obtain context embedding from historical data context and passed through two linear layers respectively. and Obtain similarity score and And score the similarity. and Average by dimension and The original similarity score is calculated according to the following formula. : The similarity score was then normalized by applying the Softplus activation function. ,Right now , where i is an integer greater than or equal to 1 and less than or equal to K; Soft prompt group The similarity score for each soft cue in the data. The set forms the similarity score set. .
9. The consultation triage dialogue system according to claim 7, characterized in that, The overall objective function used during the training of the emotion support expert model for: ,in, , , It is a hyperparameter that controls the relative contribution of each loss component; For negative log-likelihood loss, For context-sensitive comparison loss, To prompt you to choose a loss, This is to indicate the loss in fusion learning.
Citation Information
Patent Citations
Online health consultation method and system based on intelligent AI and storage medium
CN119181517A
Large model-based medical health consultation pushing method and system, and storage medium
CN119647579A