Method, apparatus and computer program product for generating response data
By determining the uncertainty prediction level of the data to be responded to and using multi-agent technology to generate medical response data, the problem of insufficient relevance and accuracy of medical and health information is solved, and the efficiency and convenience of information acquisition are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2024-11-11
- Publication Date
- 2026-05-01
AI Technical Summary
The existing online information lacks relevance and accuracy in the field of healthcare, causing users to need to search multiple times to obtain satisfactory answers, resulting in low efficiency.
By determining the uncertainty prediction level of the data to be responded to, relevant knowledge data is obtained from the target medical knowledge base, and multiple agents are used to generate medical response data. The agents have different response modes to improve accuracy and adaptability.
It improves the accuracy of medical response data and the efficiency and convenience for users to obtain information, while ensuring the security of response data and the reliability of multi-round dialogues.
Smart Images

Figure CN119557399B_ABST
Abstract
Description
Methods, apparatus and computer programs for generating response data Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, specifically to the fields of natural language understanding and smart healthcare technology, and particularly to a method, apparatus, electronic device, storage medium, and computer program product for generating response data, which can be applied to intelligent dialogue scenarios. Background Technology
[0002] With the development of mobile internet, users are increasingly relying on online resources to obtain medical and health information. However, existing online information is not only of varying quality, but also often fails to fully meet users' needs in terms of relevance and accuracy. Users often need to conduct multiple searches to find satisfactory medical answers, a process that is both time-consuming and inefficient. Summary of the Invention
[0003] This disclosure provides a method, apparatus, electronic device, storage medium, and computer program product for generating response data.
[0004] According to the first aspect, a method for generating response data is provided, comprising: determining the prediction level of the uncertainty result that may be brought about by responding to the data to be responded to; determining the target knowledge data related to the data to be responded to from the target medical knowledge base corresponding to the prediction level; and generating medical response data for the data to be responded to by a target intelligent agent selected from multiple intelligent agents based on the target knowledge data, wherein different intelligent agents have different response modes.
[0005] According to a second aspect, a response data generation apparatus is provided, comprising: a level determination unit configured to determine a predicted level of the uncertainty that may result from responding to the data to be responded to; a knowledge data determination unit configured to determine target knowledge data related to the data to be responded to from a target medical knowledge base corresponding to the predicted level; and a response data generation unit configured to generate medical response data for the data to be responded to by a target intelligent agent selected from multiple intelligent agents, based on the target knowledge data, wherein different intelligent agents have different response modes.
[0006] According to a third aspect, an intelligent agent is provided, comprising: an input module for receiving data to be responded to; a processing module for determining a medical response model for performing a response task on the data to be responded to, and obtaining medical response data for the data to be responded to by calling the medical response model to execute a method as described in any implementation of the first aspect; and an output module for outputting the medical response data.
[0007] According to a fourth aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method as described in any implementation of the first aspect.
[0008] According to a fifth aspect, a non-transitory computer-readable storage medium is provided that stores computer instructions for causing a computer to perform the method described in any implementation of the first aspect.
[0009] According to a sixth aspect, a computer program product is provided, comprising: a computer program that, when executed by a processor, implements the method as described in any implementation of the first aspect.
[0010] According to the technology disclosed herein, a method and apparatus for generating response data are provided. The method determines the prediction level of the uncertainty that may result from responding to the data to be responded to, and identifies target knowledge data related to the data to be responded to from a target medical knowledge base corresponding to the prediction level, thereby improving the reliability and accuracy of the target knowledge data. Through a target intelligent agent selected from multiple intelligent agents, medical response data for the data to be responded to is generated based on the target knowledge data. Different intelligent agents have different response modes. This improves the efficiency and convenience for users to obtain medical-related information while ensuring the accuracy of the generated medical response data and the adaptability of the response mode to the user.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0013] Figure 1 is an exemplary system architecture diagram that can be applied to an embodiment of the present disclosure;
[0014] Figure 2 is a flowchart of an embodiment of the response data generation method according to the present disclosure;
[0015] Figure 3 is an overall framework diagram of the method for generating response data according to this disclosure;
[0016] Figure 4 is a schematic diagram of an application scenario of the response data generation method according to this embodiment;
[0017] Figure 5 is a flowchart of yet another embodiment of the response data generation method according to the present disclosure;
[0018] Figure 6 is a structural diagram of an embodiment of the response data generation apparatus according to the present disclosure;
[0019] Figure 7 is a schematic diagram of the structure of a computer system suitable for implementing embodiments of the present disclosure. Detailed Implementation
[0020] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0021] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0022] Figure 1 illustrates an exemplary architecture 100 of the method and apparatus for generating response data to which this disclosure can be applied.
[0023] As shown in Figure 1, the system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. The communication connections between terminal devices 101, 102, and 103 form a network topology. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0024] Terminal devices 101, 102, and 103 can be hardware or software that supports network connectivity for data interaction and processing. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices that support network connectivity, information acquisition, interaction, display, and processing functions, including but not limited to smartphones, tablets, e-book readers, laptops, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the aforementioned electronic devices. They can be implemented as, for example, multiple software programs or software modules to provide distributed services, or as a single software program or software module. No specific limitations are imposed here.
[0025] Server 105 can be a server providing various services. For example, for data to be responded to sent by users through terminal devices 101, 102, and 103, it determines the prediction level of the uncertainty that responding to the data may bring. Then, it identifies target knowledge data related to the data to be responded to from the target medical knowledge base corresponding to the prediction level. Finally, through a target intelligent agent, it generates medical response data for the data to be responded to. As an example, server 105 can be a cloud server.
[0026] It should be noted that a server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules (such as software programs or software modules used to provide distributed services), or as a single software program or software module. No specific limitations are made here.
[0027] It should also be noted that the response data generation method provided in the embodiments of this disclosure is generally executed by a server, but the possibility of it being executed by a terminal device, or by the server and the terminal device cooperating with each other, is not excluded. Accordingly, the various parts (e.g., various units) included in the response data generation apparatus can be all located in the server, all located in the terminal device, or separately located in the server and the terminal device.
[0028] It should be understood that the number of terminal devices, networks, and servers in Figure 1 is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included. When the electronic device on which the response data generation method runs does not need to transmit data with other electronic devices, the system architecture may only include the electronic device (e.g., a terminal device or server) on which the response data generation method runs.
[0029] Please refer to Figures 2 and 3. Figure 2 is a flowchart of a method for generating response data according to an embodiment of this disclosure, and Figure 3 is an overall framework diagram of a method for generating response data according to an embodiment of this disclosure. In process 200, the following steps are included:
[0030] Step 201: Determine the prediction level of the uncertainty that may result from responding to the data to be responded to.
[0031] In this embodiment, the entity executing the response data generation method (e.g., the server in Figure 1) can obtain the response data from a remote location or from a local location via a wired network connection or a wireless network connection, and determine the prediction level of the uncertainty results that may result from responding to the response data.
[0032] The data to be answered is generally a medical (or healthcare) related question that a user has, such as a patient or a doctor.
[0033] Responding to the uncertainties that may arise from the data to be responded to mainly refers to the potential harm or adverse consequences that may result when providing medical advice or information.
[0034] Taking users' medication issues as an example, these risks can include the following aspects:
[0035] 1. Medication error:
[0036] Dosage error: The dosage provided is incorrect, which may result in an overdose or underdose of the medication.
[0037] Frequency error: The prescribed medication frequency is incorrect, which may result in poor drug efficacy or increased side effects.
[0038] Incorrect usage: The provided method of medication is incorrect, such as oral administration, topical application, or injection, which may prevent the medication from achieving its intended effect.
[0039] 2. Drug interactions:
[0040] Drug interactions with other medications: This section does not take into account other medications the user is currently using, which may lead to drug interactions and adverse reactions.
[0041] Interactions with food: This study did not take into account that certain foods may affect drug absorption and metabolism, leading to changes in drug efficacy.
[0042] 3. Allergic reactions:
[0043] Known allergy history: Failure to inquire about or consider the user's allergy history may result in a severe allergic reaction in the user.
[0044] Unknown allergic reaction: The user may be allergic to a certain drug ingredient, but this has not been previously known, and the agent has failed to adequately indicate this possibility.
[0045] 4. Contraindications:
[0046] Disease contraindications: Some medications are contraindicated for patients with specific diseases, and the agent failed to recognize and remind the user.
[0047] Special population contraindications: Pregnant women, breastfeeding women, children, the elderly and other special populations may not be suitable for the use of certain medications, and the intelligent agent failed to provide sufficient indication of this.
[0048] 5. Misleading information:
[0049] Inaccurate information: The drug information provided is inaccurate or outdated, which may lead to misunderstanding or misuse by users.
[0050] Incomplete information: The provided drug information is incomplete, omitting important precautions or warnings.
[0051] In this embodiment, the criteria and number of prediction levels can be flexibly determined according to the actual situation, for example, including low prediction level, medium prediction level and high prediction level.
[0052] As an example, the aforementioned implementing entity can determine the correspondence between each piece of data to be responded to and the prediction level based on big data analysis of the user's pending response data, and establish a correspondence table; then, based on the correspondence table, the prediction level of the uncertainty results that may be brought about by responding to the pending response data can be determined.
[0053] As another example, the aforementioned execution entity can first use a large language model to perform natural language understanding on the data to be responded to or the dialogue data up to the point of the data to be responded to, and obtain semantic understanding results; then, based on the semantic understanding results, determine the prediction level of the uncertainty results that may be brought about by responding to the data to be responded to.
[0054] Step 202: Identify the target knowledge data related to the data to be responded to from the target medical knowledge base corresponding to the prediction level.
[0055] In this embodiment, the executing entity can determine the target knowledge data related to the data to be responded to from the target medical knowledge base corresponding to the prediction level. Different medical knowledge bases are pre-set for different prediction levels.
[0056] As an example, the aforementioned executing entity determines the relevance or similarity between the data to be responded to and each part of the knowledge data in the target medical knowledge base, and then recalls a preset number of target knowledge data from the target medical knowledge base that have a high degree of relevance or similarity to the data to be responded to. The preset number can be set according to actual circumstances and is not limited here.
[0057] As another example, the aforementioned executing entity determines the keywords in the data to be responded to, then determines the partial knowledge data containing at least one keyword from the target knowledge data, and then integrates the partial knowledge data corresponding to each keyword to obtain the target knowledge data.
[0058] In some optional implementations of this embodiment, the execution entity can perform step 202 as follows:
[0059] The first step is to adjust the data to be responded to based on the previous dialogue data, resulting in the adjusted data to be responded to.
[0060] During multi-turn dialogues, users may briefly express the data to be responded to based on the context. If responses are based solely on the current data to be responded to, the generated medical response data may be inaccurate.
[0061] In this implementation, the agent, through multi-turn dialogue with the user, has already understood the dialogue data preceding the data to be responded to based on natural language understanding technology. Based on the understanding of the dialogue data preceding the data to be responded to, the description of the data to be responded to is adjusted, or a simplified version of the data is added, resulting in the adjusted data to be responded to.
[0062] The second step is to identify target knowledge data related to the adjusted response data from the target medical knowledge base.
[0063] In this implementation, a similar method can be used to determine the target knowledge data related to the data to be responded to from the target medical knowledge base, as described above. The target knowledge data related to the adjusted data to be responded to can be determined from the target medical knowledge base, which will not be elaborated here.
[0064] In this implementation, the data to be responded to is adjusted based on the contextual understanding of multi-turn dialogues to obtain complete and accurate adjusted data to be responded to, which helps to improve the accuracy of the target knowledge data obtained based on the adjusted data to be responded to.
[0065] In some optional implementations of this embodiment, before performing the second step described above, the execution entity may also perform the following operation: determine the target medical knowledge base corresponding to the prediction level from multiple medical knowledge bases corresponding to the target intelligent agent.
[0066] In this implementation, each of the multiple intelligent agents has multiple medical knowledge bases, and these medical knowledge bases correspond one-to-one with multiple prediction levels.
[0067] In this implementation, firstly, the data to be responded to is adjusted based on the dialogue data preceding the data to be responded to, resulting in adjusted data to be responded to; then, the target medical knowledge base corresponding to the prediction level is determined from multiple medical knowledge bases corresponding to the target agent; finally, the target knowledge data related to the adjusted data to be responded to is determined from the target medical knowledge base.
[0068] In this implementation, each agent is equipped with multiple medical knowledge bases corresponding to multiple prediction levels. By using different medical knowledge bases, different dialogue scenarios with different prediction levels can be addressed in a targeted manner, which helps to reduce the risks that may be brought about by responding to pending data and improve the security of multi-turn dialogues.
[0069] In some optional implementations of this embodiment, the execution entity can perform the second step as follows:
[0070] First, initial target knowledge data related to the adjusted response data is identified from the target medical knowledge base.
[0071] As an example, for each type of data source corresponding to the target medical knowledge base, a preset number of knowledge data related to the adjusted response data are determined from the medical knowledge data under that type of data source in the target medical knowledge base. The determined knowledge data under different types of data sources are combined to obtain the initial knowledge data.
[0072] Then, based on the correlation between the initial target knowledge data and the data to be answered, as well as the accuracy of the initial target knowledge data, the initial target data is sorted to obtain the target knowledge data.
[0073] In this implementation, the accuracy of the knowledge data can be determined by the type of data source to which it belongs. For example, the accuracy of knowledge data in a medical encyclopedia is generally higher than the accuracy of a doctor's abridged medical text.
[0074] It is understandable that although the amount of knowledge data recalled is large, the knowledge data on which the intelligent agent generates medical response data may only be a few of the most important ones. Therefore, the order of knowledge data in the initial target knowledge data is quite important.
[0075] As an example, for the few knowledge data items ranked first in a sorting method based solely on relevance from largest to smallest, the following table can be used to adjust their ranking by referring to the relevance between the knowledge data and the data to be answered, as well as the accuracy of the knowledge data.
[0076]
[0077] Taking "Medical Encyclopedia >= 0.5 top2 sort 1" as an example, the following explanation is provided:
[0078] When a piece of knowledge data retrieved from the medical encyclopedia has a relevance score of 0.5 or higher with the data to be responded to, and is ranked second (top 2) in the relevance score ranking, it is moved to the first position (rank 1).
[0079] In this implementation, the correlation between the initial target knowledge data and the data to be responded to is taken into account, as well as the accuracy of the initial target knowledge data. The initial target data is sorted, especially the few knowledge data that are ranked first. This improves the rationality and accuracy of the sorting of target knowledge data, and helps to improve the information acquisition efficiency and generation efficiency of the agent in the process of generating medical response data based on target knowledge data.
[0080] Step 203: The target intelligent agent selected from multiple intelligent agents generates medical response data for the data to be responded to based on the target knowledge data.
[0081] In this embodiment, the aforementioned executing entity can generate medical response data for the data to be responded to based on target knowledge data, using a target intelligent agent selected from multiple intelligent agents. Different intelligent agents have different response patterns. The multiple intelligent agents can be network models employing the same or different network model structures, such as ERNIE-speed (Lightweight Large Model).
[0082] As an example, multiple agents with different response patterns include:
[0083] 1. Digital Doctor Intelligent Agent: As a virtual digital doctor, it is adept at answering questions from specialized departments.
[0084] Specifically, the response pattern of the digital doctor's intelligent agent is as follows:
[0085] Professional and rigorous: Using medical terminology and providing detailed scientific explanations to ensure the accuracy and authority of the information.
[0086] In-depth analysis: This section delves into medical concepts and treatment methods, suitable for users who need a deeper understanding.
[0087] 2. Health Assistant Intelligent Body: Authoritative and serious science popularization, and aims to enhance the reading experience through practical cases and graphic presentations.
[0088] Specifically, the response mode of the health assistant AI is as follows:
[0089] Authoritative Science Popularization: Providing verified health information to ensure the accuracy and reliability of the content.
[0090] Vivid and easy to understand: Complex medical concepts are explained in simple and easy-to-understand language, and users' understanding and interest are enhanced through real-life examples and rich illustrations.
[0091] 3. Health Assistant (Elderly Version) Intelligent Agent: It can generate content in a conversational and human-like manner through a voice interaction mode similar to making a phone call, highlighting the emotional interaction with the user.
[0092] Specifically, the response mode of the health assistant (elderly version) intelligent agent is as follows:
[0093] Friendly spoken language: Use everyday spoken language and avoid complex vocabulary and sentence structures to make it easy for older people to understand.
[0094] Warm interaction: Answering questions in the tone of an authoritative and professional doctor, concise, warm and positive, increasing interactivity in the conversation and bringing the user closer.
[0095] As an example, the aforementioned execution entity can display multiple intelligent agents to the user, and under the user's selection instruction (e.g., clicking on a virtual button corresponding to a certain intelligent agent), the intelligent agent selected by the user is taken as the target intelligent agent; then, the target knowledge data is taken as the intelligent agent's prompt, and medical response data is generated for the data to be responded to.
[0096] As another example, the aforementioned agent can receive a text or voice prompt from the user, such as "Please act as an agent with a XX response style (e.g., a health assistant agent)," through a large language model. The large language model then recalls the corresponding target agent based on the prompt.
[0097] The intelligent agent can be trained in the following way:
[0098] First, obtain training samples corresponding to the appropriate mode of the agent.
[0099] For example, by collecting online dialogue data from real users and processing it through manual verification, response pattern adjustment, and annotation, training samples corresponding to the intelligent agent can be obtained.
[0100] Then, a machine learning algorithm is used, with the training data in the training samples as input and the labels in the training samples as the expected output, to train the agent.
[0101] During training, the iterative directions of the agent include:
[0102] a) Enhanced comprehension: Incorporating multi-turn historical dialogue information improves contextual understanding;
[0103] b) Optimize the answer structure: Highlight the core answers and improve the rationality of segmenting and dividing medical response data;
[0104] c) Improved response strategy: Instead of the agent completely refusing to answer, the approach utilizes enhanced model capabilities to provide indirect responses, thus expanding the sources of knowledge evidence.
[0105] In addition to the training methods mentioned above, sample-side optimization and model-side optimization can also be performed.
[0106] For sample-side optimization, the main purpose is to achieve a balance between sample content and style, as well as diverse stylistic dialogue. For agents with different response patterns, training samples with corresponding content and style are set based on manual adjustments to the collected historical dialogue data, ensuring that the samples include diverse stylistic dialogue to improve the diversity and flexibility of the model's responses.
[0107] For model-side optimization, it can be achieved through vertical data augmentation, DPO (Direct Preference Optimization) preference training, data flywheel, and other methods.
[0108] Data augmentation is an effective method to address overfitting. It enhances the information extracted from the original dataset, making the augmented dataset more comprehensively representative of the data set, thereby narrowing the gap between the training and validation sets. Vertical data augmentation refers to augmenting data for specific domains (such as medical dialogues) or tasks to better suit the needs of model training. For example, in natural language processing tasks, text can be augmented through synonym replacement, sentence structure transformation, and other techniques.
[0109] Direct Preference Optimization (DPO) is a method primarily used in the post-training stage. It achieves precise control over the output of a large model by directly optimizing the language model. DPO can accurately determine and learn user preferences without reinforcement learning, and its performance is more outstanding. Its working principle is to increase the log probability of preferred samples and decrease the log probability of non-preferred sample responses, thereby optimizing the model output. DPO relies on a theoretical preference model (such as the Bradley-Terry model) to measure the alignment between the reward function and empirical preference data, and directly defines the preference loss according to the policy, without explicitly learning the reward function or sampling from the policy during training. This approach makes DPO more direct and efficient in optimizing the model.
[0110] In the context of model-side optimization, the data flywheel can be viewed as a continuous iterative and optimization process. By constantly collecting, analyzing, feeding back, and optimizing data, a self-reinforcing positive feedback loop is formed, thereby continuously improving model performance, user experience, and business value.
[0111] In some optional implementations of this embodiment, the execution entity can perform step 203 as follows:
[0112] Through the target intelligent agent, medical response data is generated based on the target knowledge data and according to the preset response data organization method.
[0113] The response data organization methods include at least one of the following:
[0114] 1. The classification response method for the various types of answers included in medical response data can also be described as a "classification aggregation method".
[0115] 2. An example response to one type of answer among multiple types can also be described as an "illustrative approach".
[0116] 3. A complete response method that includes one type of answer in medical response data can also be described as a "complete aggregation method".
[0117] The following example illustrates the above method of organizing response data:
[0118] When a user asks: How do I take ibuprofen?
[0119] It's understandable that there are many particle sizes related to ibuprofen, such as ibuprofen tablets and ibuprofen sustained-release capsules, and the tablet specifications for ibuprofen tablets also vary, so we can't simply answer "one tablet at a time." Therefore, we use different wording to meet safety requirements while also considering the user's practicality.
[0120] Category aggregation method:
[0121] Q: How to use and dosage ibuprofen?
[0122] A: The dosage and administration of ibuprofen vary depending on the dosage form and strength. Common dosage forms are as follows:
[0123] tablet:……
[0124] Injectables: ...
[0125] You can also select a specific dosage form or specification so I can give you a more accurate answer. Please note that the dosage and administration of medication should be followed according to the advice of a professional.
[0126] Example explanation:
[0127] Q: How to use and dosage ibuprofen?
[0128] A: The dosage and administration of ibuprofen vary depending on the dosage form and strength. For example, take 0.5g of Motrin ibuprofen tablets:
[0129] ...
[0130] You can also select a specific dosage form or specification so I can give you a more accurate answer. Please note that the dosage and administration of medication should be followed according to the advice of a professional.
[0131] Full aggregation method: The content of the barcodes of the entities listed by the user are all the same: Generally speaking, drugs such as targeted drugs correspond to unique barcodes, or traditional Chinese medicines have simple and consistent usage.
[0132] Q: Dosage and administration of gefitinib
[0133] A: The usual dosage and administration of gefitinib are as follows:
[0134] One tablet once a day.
[0135] Please note that your question concerns the usage and dosage of medication. We recommend that you visit a doctor in person or seek help through online consultation as soon as possible.
[0136] In this implementation, the target agent, under its specific response mode, can select the corresponding response data organization method based on the recalled target knowledge data, and generate medical response data for the data to be responded to according to the response mode and response data organization method. Based on the flexibility of the response style, the security and accuracy of the response data are further improved.
[0137] Referring again to Figure 4, which is a schematic diagram 400 of an application scenario of the response data generation method according to this embodiment, the server 401 displays a selection interface among multiple intelligent agents to the user through the terminal device 402. These intelligent agents have different response modes, specifically including a professional and rigorous digital doctor intelligent agent with in-depth analysis, an authoritative and easy-to-understand health assistant intelligent agent, and a health assistant (elderly version) intelligent agent using friendly spoken language and warm voice interaction. The user 403 operates the terminal device 402 to select the target intelligent agent from among the multiple intelligent agents.
[0138] In each round of dialogue between the target agent and the user, the target agent first obtains the user's data to be responded to and determines the prediction level of the uncertainty that responding to the data may bring. Then, it identifies the target knowledge data related to the data to be responded to from the target medical knowledge base corresponding to the prediction level. Finally, the target agent generates medical response data for the data to be responded to based on the target knowledge data.
[0139] This embodiment provides a method for generating response data. It determines the prediction level of the uncertainty that responding to the data to be responded to may bring, and then identifies target knowledge data related to the data to be responded to from the target medical knowledge base corresponding to the prediction level, thereby improving the reliability and accuracy of the target knowledge data. Through a target agent selected from multiple agents, medical response data is generated for the data to be responded to based on the target knowledge data. Different agents have different response modes, which improves the efficiency and convenience for users to obtain medical-related information while ensuring the accuracy of the generated medical response data.
[0140] In some optional implementations of this embodiment, the aforementioned execution entity can generate the target medical knowledge base in the following manner:
[0141] First, medical knowledge data corresponding to the prediction level is obtained from multiple types of data sources corresponding to the target intelligent agent.
[0142] Continuing with the example of intelligent agents, including digital doctor intelligent agents, health assistant intelligent agents, and health assistant (elderly version) intelligent agents, the digital doctor intelligent agent corresponds to multiple types of data sources, such as authoritative content written by doctors, books, academic papers, etc.; the health assistant intelligent agents and health assistant (elderly version) intelligent agents correspond to multiple types of data sources, such as medical encyclopedias, medical-related concise content, medical books, medical guidelines, etc.
[0143] When the prediction level is high, it is necessary to focus on the accuracy of medical knowledge data in the data source.
[0144] Then, the data from each part of the medical knowledge data are combined according to their themes to obtain multiple groups of grouped data.
[0145] As an example, topics can be represented by first-level headings. The aforementioned implementing entity can determine the intent of each first-level heading in the medical knowledge data; then, based on the intent, it can cluster the partial data under each first-level heading to obtain multiple groups of grouped data corresponding to various intents.
[0146] Then, based on the content expressed by the grouped data at different levels, the grouped data is divided level by level to obtain a tree structure.
[0147] In this implementation, for each group of grouped data, the intent of the first-level title corresponding to the grouped data is taken as the root node. The data at different levels under the root node are divided to obtain intermediate nodes, until the leaf nodes are obtained.
[0148] When the length of the knowledge data under a leaf node is moderate, the title of the leaf node is supplemented according to the subject or intent of the data under the leaf node, and it is independently cut into a data block; when the length of the knowledge data under a leaf node is too long, it needs to be further split, and the number of characters in the data block should not exceed the preset threshold max_token; when the length of the knowledge data under a leaf node is too short, the knowledge data under it needs to be supplemented, and it needs to be supplemented by the knowledge data under other nodes. The priority of supplementation is self > ancestor > peer > parent_peer.
[0149] Finally, a target medical knowledge base is created based on the node name data corresponding to the leaf nodes in the tree structure, some medical knowledge data, and sample response data.
[0150] The node name data corresponding to the leaf node can be obtained by connecting the node path from the root node to the leaf node with "_". Some medical knowledge data is the medical knowledge under the leaf node, which can be used as the data basis for the response sample data to be responded to.
[0151] In this embodiment, a 256-dimensional feature vector data embedding can be calculated based on the query (sample data to be answered), title (node name data), and content (partial medical knowledge data) corresponding to the leaf node.
[0152] This implementation provides a method for creating a target medical knowledge base, which includes node name data corresponding to leaf nodes, partial medical knowledge data, and sample response data, which helps to improve the efficiency of determining target knowledge data from the target medical knowledge base.
[0153] In some optional implementations of this embodiment, the execution entity may perform the second step as follows: determine the target knowledge data from the target medical knowledge base based on the correlation between the adjusted data to be answered and the sample data to be answered in the target medical knowledge base.
[0154] As an example, the aforementioned execution entity can extract features from the data to be responded to, determine its feature data embedding, and then determine the distance between the embedding of the data to be responded to and the embedding in the target medical knowledge base (more specifically, it can be the partial embedding corresponding to the sample data to be responded to), so as to determine the correlation between the two, thereby determining the target knowledge data related to the data to be responded to from the target medical knowledge base.
[0155] In this implementation, the data structure based on node name data, partial medical knowledge data, and sample response data in the target medical knowledge base reduces the difficulty of relevance calculation and helps to further improve the efficiency of determining target knowledge data.
[0156] In some optional implementations of this embodiment, the execution entity may also perform the following operations: in response to the fact that the target medical knowledge base does not contain target knowledge data, generate fallback response data for the data to be responded to through a fallback model.
[0157] If the target medical knowledge base does not contain the target knowledge data, or if the target knowledge data cannot be retrieved from the target medical knowledge base, the aforementioned implementing entity can use a fallback model with stronger computational and natural language understanding capabilities to provide fallback response data based on specific dialogue for the data to be responded to, for example:
[0158] A: I'm sorry, I couldn't find any information related to this question. The usage of medication varies from person to person; please follow the advice of a professional doctor.
[0159] You can continue to ask me other questions about medications, and I'll be happy to answer them for you.
[0160] In this implementation, the fallback operation based on the fallback model can improve the response capability for the data to be responded to.
[0161] Referring again to FIG5, an illustrative flow 500 of yet another embodiment of the response data generation method according to the present disclosure is shown. Flow 500 includes the following steps:
[0162] Step 501: Determine the prediction level of the uncertainty that may result from responding to the data to be responded to.
[0163] Step 502: Adjust the data to be responded to based on the dialogue data prior to the data to be responded to, and obtain the adjusted data to be responded to.
[0164] Step 503: Determine the target medical knowledge base corresponding to the prediction level from multiple medical knowledge bases corresponding to the target intelligent agent.
[0165] Step 504: Identify the initial target knowledge data related to the adjusted response data from the target medical knowledge base.
[0166] Step 505: Sort the initial target data according to the correlation between the initial target knowledge data and the data to be answered, as well as the accuracy of the initial target knowledge data, to obtain the target knowledge data.
[0167] Step 506: Using the target intelligent agent selected from multiple intelligent agents, medical response data is generated for the data to be responded to based on the target knowledge data.
[0168] Different agents have different response patterns.
[0169] As can be seen from this embodiment, compared with the embodiment corresponding to Figure 2, the flow 500 of the response data generation method in this embodiment specifically illustrates the recall process of target knowledge data, which further improves the accuracy and security of target knowledge data and helps to improve the security and accuracy of multi-turn dialogue processes.
[0170] Referring again to Figure 6, as an implementation of the methods shown in the above figures, this disclosure provides an embodiment of a response data generation apparatus. This system embodiment corresponds to the method embodiment shown in Figure 2, and the system can be specifically applied to various electronic devices.
[0171] As shown in Figure 6, the response data generation device 600 includes: a level determination unit 601, configured to determine the predicted level of the uncertainty result that may be brought about by responding to the data to be responded to; a knowledge data determination unit 602, configured to determine the target knowledge data related to the data to be responded to from the target medical knowledge base corresponding to the predicted level; and a response data generation unit 603, configured to generate medical response data for the data to be responded to by a target intelligent agent selected from multiple intelligent agents, based on the target knowledge data, wherein different intelligent agents have different response modes.
[0172] In some optional implementations of this embodiment, the knowledge data determination unit 602 is further configured to: adjust the data to be responded to based on the dialogue data prior to the data to be responded to, to obtain the adjusted data to be responded to; and determine the target knowledge data related to the adjusted data to be responded to from the target medical knowledge base.
[0173] In some optional implementations of this embodiment, the above-mentioned apparatus further includes: a knowledge base determination unit (not shown in the figure), configured to: determine the target medical knowledge base corresponding to the prediction level from multiple medical knowledge bases corresponding to the target intelligent agent.
[0174] In some optional implementations of this embodiment, the knowledge data determination unit 602 is further configured to: determine initial target knowledge data related to the adjusted response data from the target medical knowledge base; sort the initial target data according to the correlation between the initial target knowledge data and the response data, and the accuracy of the initial target knowledge data, to obtain the target knowledge data.
[0175] In some optional implementations of this embodiment, the above-mentioned apparatus further includes: a knowledge base creation unit (not shown in the figure), configured to: obtain medical knowledge data corresponding to the prediction level from multiple types of data sources corresponding to the target agent; combine the data according to the themes of each part of the medical knowledge data to obtain multiple groups of grouped data; divide the grouped data level by level according to the content expressed by the grouped data at different levels to obtain a tree structure; and create a target medical knowledge base according to the node name data corresponding to the leaf nodes in the tree structure, some medical knowledge data, and sample response data.
[0176] In some optional implementations of this embodiment, the knowledge data determination unit 602 is further configured to: determine target knowledge data from the target medical knowledge base based on the correlation between the adjusted response data and the sample response data in the target medical knowledge base.
[0177] In some optional implementations of this embodiment, the response data generation unit 603 is further configured to: generate medical response data for the data to be responded to by the target intelligent agent according to the target knowledge data and a preset response data organization method, wherein the response data organization method includes at least one of the following: a classification response method for multiple types of answers included in the medical response data; an example response method for one type of answer among multiple types; and a complete response method for one type of answer included in the medical response data.
[0178] In some optional implementations of this embodiment, the above-mentioned device further includes: a fallback unit (not shown in the figure), configured to: generate fallback response data for the data to be responded to through a fallback model in response to the fact that the target medical knowledge base does not contain target knowledge data.
[0179] In this embodiment, a response data generation device is provided. It determines the prediction level of the uncertainty that may result from responding to the data to be responded to, and identifies target knowledge data related to the data to be responded to from a target medical knowledge base corresponding to the prediction level, thereby improving the reliability and accuracy of the target knowledge data. Through a target intelligent agent selected from multiple intelligent agents, medical response data for the data to be responded to is generated based on the target knowledge data. Different intelligent agents have different response modes, which improves the efficiency and convenience for users to obtain medical-related information while ensuring the accuracy of the generated medical response data.
[0180] According to embodiments of this disclosure, this disclosure also provides an intelligent agent, including: an input module for receiving data to be responded to; a processing module for determining a medical response model for performing a response task on the data to be responded to, and obtaining medical response data for the data to be responded to by calling the medical response model to execute the response data generation method described in any of the above embodiments; and an output module for outputting the medical response data.
[0181] According to embodiments of this disclosure, this disclosure also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to implement the response data generation method described in any of the above embodiments.
[0182] According to embodiments of this disclosure, this disclosure also provides a readable storage medium storing computer instructions that, when executed by a computer, enable the generation method of response data described in any of the above embodiments.
[0183] This disclosure provides a computer program product that, when executed by a processor, can implement the response data generation method described in any of the above embodiments.
[0184] Figure 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0185] As shown in Figure 7, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded from storage unit 708 into random access memory (RAM) 703. RAM 703 can also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.
[0186] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0187] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the response data generation method. For example, in some embodiments, the response data generation method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the response data generation method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the response data generation method by any other suitable means (e.g., by means of firmware).
[0188] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0189] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to the processor or controller of a general-purpose computer, special-purpose computer, or other programmable response data generation device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0190] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0191] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0192] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0193] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, also known as cloud computing servers or cloud hosts, which are hosting products within the cloud computing service system to address the management difficulties and weak business scalability inherent in traditional physical hosts and Virtual Private Servers (VPS) services; they can also be servers for distributed systems or servers integrated with blockchain technology.
[0194] According to the technical solution of the embodiments of this disclosure, a method and apparatus for generating response data are provided. The method determines the prediction level of the uncertainty that may result from responding to the data to be responded to, and then determines the target knowledge data related to the data to be responded to from the target medical knowledge base corresponding to the prediction level, thereby improving the reliability and accuracy of the target knowledge data. Through a target intelligent agent selected from multiple intelligent agents, medical response data for the data to be responded to is generated based on the target knowledge data. Different intelligent agents have different response modes, which improves the efficiency and convenience for users to obtain medical-related information while ensuring the accuracy of the generated medical response data.
[0195] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution provided in this disclosure can be achieved, and this is not limited herein.
[0196] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for generating response data, comprising: By using a large language model, the prediction level of the uncertainty that may result from responding to the data to be answered is determined; From the multiple medical knowledge bases corresponding to the target intelligent agent selected from multiple intelligent agents, the target medical knowledge base corresponding to the prediction level is determined, and the multiple medical knowledge bases correspond one-to-one with the multiple prediction levels; from the target medical knowledge base, target knowledge data related to the data to be responded to is determined; Through the target intelligent agent, medical response data is generated for the data to be responded to based on the target knowledge data, wherein different intelligent agents have different response patterns; the target medical knowledge base is generated in the following manner: medical knowledge data corresponding to the prediction level is obtained from multiple types of data sources corresponding to the target intelligent agent; the data is combined according to the themes of each part of the medical knowledge data to obtain multiple groups of grouped data; in the process of dividing the grouped data level by level based on the intent of the grouped data as the root node and the content expressed by the grouped data at different levels, the response is based on the knowledge data corresponding to the current intermediate node. If the length of the knowledge data corresponding to the current intermediate node is greater than a preset threshold, the current intermediate node is further divided. If the length of the knowledge data corresponding to the current intermediate node is less than or equal to the preset threshold, it is used as the final leaf node. If the knowledge data corresponding to the current intermediate node needs to be supplemented, the knowledge data corresponding to the current intermediate node is supplemented according to the priority of the associated nodes and the knowledge data of the associated nodes. The priority of the associated nodes from high to low is themselves, ancestor nodes, peer nodes, and parent nodes to obtain a tree structure. The target medical knowledge base is created based on the node name data, partial medical knowledge data, and sample response data corresponding to the leaf nodes in the tree structure.
2. The method according to claim 1, wherein, The step of determining the target knowledge data related to the data to be responded to from the target medical knowledge base corresponding to the prediction level includes: adjusting the data to be responded to based on the dialogue data before the data to be responded to, to obtain the adjusted data to be responded to; and determining the target knowledge data related to the adjusted data to be responded to from the target medical knowledge base.
3. The method according to claim 2, wherein, The step of determining the target knowledge data related to the adjusted data to be responded to from the target medical knowledge base includes: determining the initial target knowledge data related to the adjusted data to be responded to from the target medical knowledge base; and sorting the initial target data according to the correlation between the initial target knowledge data and the data to be responded to, as well as the accuracy of the initial target knowledge data, to obtain the target knowledge data.
4. The method according to claim 1, wherein, Determining target knowledge data related to the adjusted response data from the target medical knowledge base includes: determining the target knowledge data from the target medical knowledge base based on the correlation between the adjusted response data and the sample response data in the target medical knowledge base.
5. The method according to claim 1, wherein, The step of generating medical response data for the data to be responded to by a target agent selected from multiple agents, based on the target knowledge data, includes: generating medical response data for the data to be responded to by the target agent according to the target knowledge data and a preset response data organization method, wherein the response data organization method includes at least one of the following: a classification response method for multiple types of answers included in the medical response data; an example response method for one type of answer among the multiple types; and a complete response method for one type of answer included in the medical response data.
6. The method according to claim 1, wherein, It also includes: in response to the fact that the target medical knowledge base does not contain the target knowledge data, generating fallback response data for the data to be responded to through a fallback model.
7. An apparatus for generating response data, comprising: The rating determination unit is configured to determine the predicted rating of the uncertainty that may result from responding to the data to be responded to, using a large language model. The knowledge base determination unit is configured to determine the target medical knowledge base corresponding to the prediction level from multiple medical knowledge bases corresponding to the target intelligent agent selected from multiple intelligent agents, wherein the multiple medical knowledge bases correspond one-to-one with multiple prediction levels; the knowledge data determination unit is configured to determine target knowledge data related to the data to be responded to from the target medical knowledge base. The response data generation unit is configured to generate medical response data for the data to be responded to, based on the target knowledge data and the target intelligent agent, wherein different intelligent agents have different response patterns. The knowledge base creation unit is configured to: obtain medical knowledge data corresponding to the prediction level from multiple types of data sources corresponding to the target intelligent agent; combine the data according to the themes of each part of the medical knowledge data to obtain multiple groups of grouped data; and, in the process of progressively dividing the grouped data according to the content expressed by the grouped data at different levels, using the intent of the grouped data as the root node, respond to the current intermediate node. If the length of the knowledge data exceeds a preset threshold, the current intermediate node is further divided. If the length of the knowledge data corresponding to the current intermediate node is less than or equal to the preset threshold, it is designated as the final leaf node. If the knowledge data corresponding to the current intermediate node needs to be supplemented, the knowledge data corresponding to the current intermediate node is supplemented according to the priority of the associated nodes and the knowledge data of the associated nodes. The priority of the associated nodes, from high to low, is themselves, ancestor nodes, peer nodes, and parent nodes, to obtain a tree structure. The target medical knowledge base is created based on the node name data, partial medical knowledge data, and sample response data corresponding to the leaf nodes in the tree structure.
8. The apparatus according to claim 7, wherein, The knowledge data determination unit is further configured to: adjust the data to be responded to based on the dialogue data prior to the data to be responded to, to obtain adjusted data to be responded to; and determine target knowledge data related to the adjusted data to be responded to from the target medical knowledge base.
9. The apparatus according to claim 8, wherein, The knowledge data determination unit is further configured to: determine initial target knowledge data related to the adjusted data to be responded to from the target medical knowledge base; and sort the initial target data according to the correlation between the initial target knowledge data and the data to be responded to, as well as the accuracy of the initial target knowledge data, to obtain the target knowledge data.
10. The apparatus according to claim 7, wherein, The knowledge data determination unit is further configured to: determine the target knowledge data from the target medical knowledge base based on the correlation between the adjusted response data and the sample response data in the target medical knowledge base.
11. The apparatus according to claim 7, wherein, The response data generation unit is further configured to: generate medical response data for the data to be responded to based on the target knowledge data and according to a preset response data organization method, through the target intelligent agent, wherein the response data organization method includes at least one of the following: a classification response method for multiple types of answers included in the medical response data; an example response method for one type of answer among the multiple types; and a complete response method for one type of answer included in the medical response data.
12. The apparatus according to claim 7, wherein, Also includes: The fallback unit is configured to: in response to the fact that the target medical knowledge base does not contain the target knowledge data, generate fallback response data for the data to be responded to through the fallback model.
13. An intelligent agent, comprising: The input module is used to receive data to be responded to. The processing module is configured to determine a medical response model for performing the response task of the data to be responded to, and to obtain medical response data for the data to be responded to by calling the medical response model to perform the method of any one of claims 1-6; The output module is used to output the medical response data.
14. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
15. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.
16. A computer program product comprising: A computer program that, when executed by a processor, implements the method according to any one of claims 1-6.
Citation Information
Patent Citations
Medical question and answer method, system, device and equipment and storage medium
CN117370521A
Dialogue sample generation method, chat conversation large model training method and related devices
CN117573946A