Method, device and equipment for replying consultation and storage medium
By introducing intent recognition and prompt word expansion mechanisms in the intelligent dialogue system, the problems of inaccurate and unprofessional responses in the prior art are solved, and higher quality of consultation responses and user experience are achieved.
Patent Information
- Application Number
- CN202411497230.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-07
AI Technical Summary
In the prior art, it is difficult for intelligent dialogue systems to provide highly accurate and professional consultation responses in professional fields such as medical care. Especially when dealing with complex scenarios and new knowledge, questions often occur with irresponsible questions, wrong content or incomplete responses.
By introducing an intention recognition mechanism, the key information in user input is automatically extracted, and the multi-dimensional prompt word expansion module is used to dynamically generate enhanced prompt words in combination with specifications and instructions in specific fields. The method includes in response to user input, determining a prompt word template corresponding to the target consultation task, extracting the task-related information, extending the additional information, and generating a reply through the trained machine learning model.
It improves the professionalism and reliability of consultation responses, enhances the compatibility between responses and user consultation demands, ensures that responses comply with professional specifications and field requirements, and improves user experience and system efficiency.
Smart Images

Figure CN119396952A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the fields of artificial intelligence and online medical technology, and in particular, to methods, devices, equipment, and computer-readable storage media for responding to consultations. Background Art
[0002] With the widespread application of machine learning technology and intelligent dialogue systems in various fields, users' demands for accuracy, professionalism and contextual relevance of consultation responses are increasing. Especially in professional fields such as medicine and finance, users often expect to be able to provide more targeted and professional consultation responses to improve work efficiency and user experience.
[0003] In related technologies, responses to user inquiries are usually generated by large models. However, due to the limitations of current large models in understanding new knowledge, expertise in specific fields, and internal private data, the preset conventional prompt words cannot effectively cover all scenarios. Therefore, the generated answers are prone to irrelevant questions, incorrect content, or incomplete responses, making it difficult to meet professional needs in complex scenarios.
[0004] Therefore, a method for responding to inquiries with higher accuracy and applicability is needed. Summary of the invention
[0005] In the first aspect of the present disclosure, a method for replying to consultations is provided. The method includes: in response to a user input received from a target application indicating a target consultation task, determining a prompt word template corresponding to the target consultation task; using the prompt word template, based on the user input, determining a first prompt word, the first prompt word indicating information associated with the target consultation task extracted from the user input; determining a second prompt word based at least on the first prompt word, the second prompt word indicating additional information extended from the extracted information associated with the target consultation task; and providing a reply to the user input by inputting a target prompt word obtained by combining the first prompt word and the second prompt word into a trained machine learning model.
[0006] In the second aspect of the present disclosure, a device for replying to consultations is provided. The device includes: a template determination module, configured to determine a prompt word template corresponding to a target consultation task in response to a user input received from a target application indicating a target consultation task; a prompt word determination module, configured to use the prompt word template to determine a first prompt word based on the user input, the first prompt word indicating information associated with the target consultation task extracted from the user input; the prompt word determination module, further configured to determine a second prompt word based at least on the first prompt word, the second prompt word indicating additional information extended from the extracted information associated with the target consultation task; and a reply module, configured to provide a reply to the user input by inputting a target prompt word obtained by combining the first prompt word and the second prompt word into a trained machine learning model.
[0007] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the device executes the method of the first aspect.
[0008] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.
[0009] In a fifth aspect of the present disclosure, a computer program product is provided, which is tangibly stored in a computer storage medium and includes computer executable instructions, which when executed by a device cause the device to perform the method according to the first aspect of the present disclosure.
[0010] It should be understood that the content described in this content section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0012] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;
[0013] Figure 2 A flowchart showing a process of replying to consultation according to some embodiments of the present disclosure is shown;
[0014] Figure 3A A schematic diagram showing a process of determining a prompt word template in some embodiments of the present disclosure;
[0015] Figure 3B A schematic diagram showing a prompt word template of some embodiments of the present disclosure;
[0016] Figure 3C A schematic diagram showing a process of determining a second prompt word in some embodiments of the present disclosure;
[0017] Figure 3D A schematic diagram showing a process of searching a knowledge base in some embodiments of the present disclosure;
[0018] Figure 3E A schematic diagram showing a process of processing a computing task according to some embodiments of the present disclosure;
[0019] Figure 4 A block diagram showing an apparatus for replying to a consultation according to some embodiments of the present disclosure; and
[0020] Figure 5 A block diagram of an electronic device capable of implementing one or more embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0021] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0022] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0023] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0024] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0025] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0027] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0028] As briefly mentioned above, with the widespread application of machine learning technology and intelligent dialogue systems in various fields, for example, in online consultation scenarios, intelligent doctor assistants help doctors efficiently handle patients' health consultations, improve overall consultation efficiency, and provide support in information collection, organization, and intelligent reply recommendations. Users' demand for accuracy, professionalism, and contextual relevance of consultation responses is increasing. Especially in highly professional fields such as medicine and finance, users often expect to be able to provide more targeted and professional consultation responses to improve work efficiency and user experience.
[0029] In related technologies, most consultation response systems are built through "prompt word engineering". This means that the model's roles, responsibilities, constraints, etc. need to be preset. However, since the preset conventional prompt words cannot effectively cover the high degree of professionalism in all scenarios and fields, the model's understanding of new knowledge, professional field knowledge, and internal privatized knowledge is insufficient. This will cause the answers generated by the model to not match the current conversation content and fail to meet complex constraints, resulting in irrelevant or incorrect answers.
[0030] Taking the auxiliary consultation system in the medical field as an example, in the actual medical consultation process, a large amount of professional medical knowledge and reasoning are involved. Although the reliability of the reply content based on the Large Language Model (LLM) has reached a high level, the adoption rate of the recommended content by doctors is still very low due to the low fit between the reply content and the actual scenario.
[0031] Through induction and summary, it is found that the main reason why doctors do not adopt the suggestions of the big model is that the response content is not consistent with the actual scenario. The following are the main reasons for this problem:
[0032] Diversity of patient demands: Patients have different consultation needs. For example, some patients are concerned about medication consultation, while others are concerned about disease diagnosis. A set of universal prompt templates cannot effectively cover these diverse needs, resulting in the large model's response content not meeting actual needs.
[0033] Lack of diagnostic and treatment pathway standards: Each department usually has standardized diagnostic and treatment pathways for different diseases, which are closely related to quality control scores. Due to the lack of understanding of these internal diagnostic and treatment standards, the large model cannot meet the standard requirements when generating questions and answers, which in turn affects the reliability and adoption rate of the response content.
[0034] Errors in professional problems: For some highly professional problems, such as children's medication dosage, children's growth curve calculation, Body Mass Index (BMI) and other calculation problems, large models often make mistakes, which further reduces the credibility of the system.
[0035] Therefore, in order to solve the above problems, the quality of consultation responses can be improved from the following aspects: improving the consistency of responses with user consultation requests, improving the consistency of responses with established norms and conditions (such as internal diagnosis and treatment norms, diagnosis and treatment standards, etc.), and improving the consistency of responses with professional knowledge and field norms (for example, different departments have different professional requirements and restrictions, etc.).
[0036] In an embodiment of the present disclosure, a scheme for replying to consultations is provided. According to an embodiment of the present disclosure, in response to a user input received from a target application indicating a target consultation task, a prompt word template corresponding to the target consultation task is determined; using the prompt word template, based on the user input, a first prompt word is determined, the first prompt word indicating information associated with the target consultation task extracted from the user input; a second prompt word is determined based at least on the first prompt word, the second prompt word indicating additional information extended from the extracted information associated with the target consultation task; and a reply to the user input is provided by inputting a target prompt word obtained by combining the first prompt word and the second prompt word into a trained machine learning model.
[0037] Therefore, by introducing the intent recognition mechanism, it is possible to automatically extract key information from user input, and through a multi-dimensional prompt word expansion module, combined with the norms and instructions of specific fields, dynamically generate enhanced prompt words, thereby further improving the professionalism and reliability of the response.
[0038] Figure 1A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. In the environment 100, in response to receiving a user input (collectively or individually referred to as user input 120) indicating a target consultation task, the electronic device determines a prompt word 140 based on the user input 120 using a prompt word template 130. Based on the prompt word 140, the electronic device 110 can provide a reply 150 to the user input 120.
[0039] In some embodiments, the electronic device 110 may have at least one round of dialogue with the user and receive at least one user input 120 (e.g., a first input 120-1, a second input 120-2, and a third input 120-3). It should be understood that the first input 120-1, the second input 120-2, and the third input 120-3 are merely exemplary illustrations of the user input 120 that the electronic device 110 may receive in multiple rounds of dialogue, and are not intended to limit the number and order of the user input 120 in the present disclosure in any form.
[0040] In the environment 100, the electronic device 110 can be any type of device with computing capabilities, including a terminal device or a server device. The terminal device can be any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an e-book device, a gaming device, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. The server device can include, for example, a computing system / server, such as a mainframe, an edge computing node, a computing device in a cloud environment, and the like.
[0041] It should be understood that the structure and functionality of environment 100 are described for exemplary purposes only and does not imply any limitation on the scope of the present disclosure.
[0042] Figure 2 1 shows a flowchart of a process 200 for replying to a consultation according to some embodiments of the present disclosure. The process 200 may be implemented in the environment 100, for example, the process 200 may be implemented at the electronic device 110. In the following, for ease of discussion, reference will be made to Figure 1 The process 200 is described below.
[0043] In block 210 , the electronic device 110 determines a prompt word template corresponding to the target consultation task in response to a user input 120 received from a target application indicating a target consultation task.
[0044] In some embodiments, user input 120 refers to information provided by a user to a target application (eg, a dialogue system, etc.) indicating the user's target consulting task, such as asking a question, requesting a service, or requiring specific information.
[0045] In some embodiments, the user input 120 is input in the form of natural language. For example, the user input 120 may be a consultation content related to a specific field, scenario or theme sent by the user in the form of text. Alternatively, the user input 120 may also include various forms of queries, instructions or commands such as voice and pictures, and is converted into structured natural language input through corresponding technical means (such as voice-to-text, picture recognition, etc.).
[0046] As an example, the user input 120 may include an initialization input provided by the user when starting a conversation, which generally includes the user's initial purpose or demand and is the starting point of the user's consultation.
[0047] As another example, user input 120 may also be further input provided by the user based on the response or request provided by the target application during the conversation. User input 120 as a subsequent input to the conversation may be an answer to a system question, a supplement or clarification of the aforementioned information, or a new query or request. This input based on interaction may appear at different stages of the conversation, helping to gradually clarify the user's intentions and improve the conversation content to provide a response to the user's target consulting task.
[0048] In some embodiments, the electronic device 110 identifies the type of the target consultation task and determines a prompt word template based on the type in response to the user input 120 indicating the target consultation task.
[0049] In some embodiments, after receiving the user input 120, the electronic device 110 can extract key information from the user input 120 through natural language processing technology, so as to determine which type of consulting task the user's needs belong to. Then the electronic device 110 can select a preset prompt word template that matches the type of task according to the type of the target consulting task. The prompt word template is equivalent to a basic framework that predefines some basic rules and the structure of the prompt information in order to generate more appropriate prompt words that meet specific scenarios.
[0050] As an example, Figure 3A FIG. 3 is a schematic diagram of a process 300A of determining a prompt word template 130 according to some embodiments of the present disclosure. The process 300A may be implemented at the electronic device 110 .
[0051] At block 311 , the electronic device 110 receives user input 120 .
[0052] In some embodiments, the electronic device 110 can process a large amount of user historical input as samples, analyze user consultation information, and extract relevant subject content based on different consultation information. Based on these historical data, the electronic device 110 can train a machine learning model, such as an agent, for identifying user consultation needs and summarizing the type of target consultation task corresponding to the user input.
[0053] As an example, Table 1 shows the types and proportions of target consulting tasks in the medical field that have been summarized.
[0054] Table 1
[0055]
[0056] In block 312 , the electronic device 110 identifies the type of the target consulting task.
[0057] As an example, the electronic device 110 may identify the type of target consulting task corresponding to the user input 120 based on the agent. For example, the following prompt words may be used to perform the corresponding recognition task for the agent:
[0058] Role prompts: Set a role for the agent. By clarifying the agent's role, it can better understand the professional background and responsibilities involved in the scenario, for example, "You are a general practitioner who focuses on analyzing the user's main complaint intent. You can classify intent based on the user's main complaint and give the next consultation direction based on different intents."
[0059] Skill prompt words: define the specific capabilities of the Agent for intent classification, such as "Intent classification: A Symptom consultation: consultation where the user's main complaint only contains symptom information, such as numbness in the right hand / red spots on the skin, some small red spots on the arm / ; B Disease consultation: consultation where the user has clear disease information, such as varicose veins on the leg / tennis elbow pain in the right arm / how to treat hypertension; C Medication consultation: consultation where the user's main complaint includes drug information, such as what oral medicine is recommended for long-term cervical spondylosis / need to buy metformin / ordered Xiangsha Liujun Pills and Jianpi Pills to regulate dampness, can they be taken together?; D Rehabilitation guidance: the user's main complaint wants to consult about the rehabilitation method of a certain disease, such as consulting about nursing conditions, recovery exercises, recovery cycles, etc.; E Other categories: other information that does not include the above ABCD categories, such as: just consulting / anorectal anorectal / andrology issues";
[0060] Output content requirement prompt words: guide the Agent to ensure a uniform output format when outputting the recognized type, which is convenient for system processing and subsequent analysis. For example, "only output the name, such as "intention":"symptom consultation", that is, {"intention":xxxxx} format, do not output in markdown (a lightweight markup language) format."
[0061] In the disclosed embodiment, by training and utilizing a machine learning model for identifying the type of target consulting tasks, the process of classifying user consulting needs is automated, thereby improving the efficiency, accuracy and user experience of the dialogue system, and making the consultation response process intelligent and efficient.
[0062] Continue to refer Figure 3A ,In the medical field, the type 313 of the target consultation task may include at least one of the following: medication consultation, disease consultation, symptom consultation, rehabilitation guidance consultation, and other types of consultation.
[0063] Based on the type of target consultation task, the electronic device 110 can determine the corresponding type of prompt word template 130. For example, the medication prompt word template needs to be able to guide the system or target application to provide medication recommendations, warnings of drug interactions and other information based on the user input 120. The disease prompt word template may include a basic description of the disease, diagnostic suggestions, and steps for further treatment or examination. The symptom prompt word template needs to be able to guide the system or target application to ask for more details based on the patient's symptom description, assist in preliminary analysis, and provide possible diagnostic directions. The rehabilitation prompt word template needs to be able to help provide rehabilitation guidance information, including a reasonable exercise plan, precautions during the recovery period, how to manage pain or handle postoperative care, etc. The general prompt word template guides the system or target application to provide general suggestions for target consultation tasks that do not belong to the above categories.
[0064] In the disclosed embodiment, by identifying the user's consultation type, the corresponding prompt word template can be quickly selected, thereby reducing the time for manual screening and question construction, and improving the overall efficiency of consultation responses. In addition, the prompt word templates pre-formulated according to different types of consultation needs can ensure that the output content meets the user's needs, thereby improving the professional level and credibility of the response.
[0065] As an example, Figure 3B FIG. 3 is a schematic diagram showing a prompt word template 320 of some embodiments of the present disclosure. Figure 3BAs shown, the structure of the prompt word template 320 can be divided into two parts: the prompt word basic structure 321 and the extended parameters 322. These two parts have different functions, ensuring adaptability and flexibility in specific scenarios. For example, the basic structure 321 specifies how to guide the system or application to reply or respond under a specific consultation category. The extended parameters 322 are used to further refine the structure of the prompt word, helping the system to better understand and adapt to complex consultation scenarios.
[0066] Specifically, the prompt word template 320 may include: role prompt words, skill prompt words, basic information prompt words, constraint condition prompt words, and compliance standard prompt words.
[0067] The role prompt specifies the role that the system plays in the current conversation scenario. By determining the role prompt, the system can respond to inquiries in a way that meets the user's expectations. For example, in the disease prompt template, the role prompt can be "You are a doctor in {department name (departName)}, focusing on providing online diagnosis and treatment services to patients. You can provide reasonable treatment plans and improvement suggestions based on the user's complaints and the above records after collecting necessary medical conditions."
[0068] Skill prompt words are the capabilities or professional fields that the system possesses. For different types of consultations, it is necessary to guide the system to use different skills. For example, in the disease prompt word template, the skill prompt word can be "1. Condition collection: There should be more than 5 rounds of condition collection at the beginning of the consultation. The condition should be collected according to the user's input, including the onset of symptoms or the time of illness, the main symptom characteristics, the cause and inducement, the development and evolution of the disease, accompanying symptoms, and the diagnosis and treatment process. Each question should be controlled to 1-2 questions, and the number of questions should not exceed 2. 2. Diagnosis and explanation: After the condition is collected, the only possible diagnosis should be given. The diagnosis should be combined with an explanation of why the diagnosis is given and an explanation of the disease. If laboratory tests are needed to further diagnose the disease and clarify the cause, laboratory test recommendations should be given. If thyroid function abnormalities are suspected, thyroid function tests can be done; for respiratory infections, blood routine tests can be done to determine whether it is a bacterial or viral infection so that symptomatic medication can be given. 3. Treatment plan: After diagnosis, the user will be given a treatment plan, including available medicines, as well as tests and examinations that need to be completed for further differential diagnosis or assessment of the condition. 4. Pre-drug consultation: If you recommend drugs to users, you need to ask before the recommendation, "In order to provide you with better and safer medication guidance, do you have a history of drug allergies? Do you have a history of chronic diseases such as liver and kidney dysfunction? Do you have any history of drinking in the past week? "If the patient is a female, you also need to add whether she is pregnant or breastfeeding. Only after the user replies that there is no answer can the medicine be recommended. If you need to clarify the liver and kidney function, it is recommended to do liver and kidney function tests. 5. Life precautions: Follow-up life precautions can be given based on the user's disease and symptoms. 6. Medication answers: If the user input is about consulting about medicines, you can directly answer the question and actively provide information such as usage and dosage, precautions for medication, and contraindications for medication. 7. Answer user questions: Give targeted answers to questions raised by users. 8. Avoid repeated answers: After the doctor gives a diagnosis or medication suggestion for the user's question, do not repeat the diagnosis and medication suggestion, but directly answer the user's question."
[0069] Basic information prompt words refer to basic information that can be referenced during the consultation dialogue, such as basic information related to the user's target consultation task. The use of this information ensures the personalization and accuracy of the interaction.
[0070] The compliance prompt refers to the rules or restrictions that the system needs to follow when responding to inquiries. For example, the system needs to comply with regulations on medical ethics, data privacy, etc.
[0071] Constraint prompts refer to specific restrictions on system behavior. For example, in the disease prompt template, the constraint prompts can be "1. Each reply should not exceed 60 words. 2. Do not use "doctor:" or punctuation marks at the beginning, just output the text content directly. 3. You are a doctor, speak in accordance with your identity, do not reverse your identity. Do not ask users to follow the doctor's advice or contact me (you), or consult a doctor, because you are a doctor and need to express it as consulting me. 4. At the end of the answer, do not have extra content such as "If you feel uncomfortable / symptoms persist or worsen, please contact me / seek medical treatment in time". 5. Do not use special symbols in the output content. 6. Each collection of medical conditions should be controlled to 1-2 questions, and the number of questions should not exceed 2".
[0072] In some embodiments, the structure and information of the prompt word template used to guide the machine model to make consultation replies also include replaceable parameters (also called variables). The variables can be content that is dynamically adjusted according to user input or environmental context. For example, variables can include specific descriptions of symptoms, drug names, or the patient's age, gender, etc. And the classification structure included in the prompt word template is a replaceable module that can be adjusted according to actual needs. For example, pre-drug consultation may not be required in some scenarios, so this part can be replaced or deleted as a whole.
[0073] Return to reference Figure 2 In block 220 , the electronic device 110 uses the prompt word template to determine a first prompt word based on the user input.
[0074] In some embodiments, the electronic device 110 extracts prompt information associated with the target consulting task from the user input based on the structured conditions of the prompt word template to determine the first prompt word.
[0075] In some embodiments, the prompt word template 130 includes structured conditions such as roles, skills, compliance specifications, constraints, and basic information. Through these structured contents, the generation process of prompt words can be standardized. Based on the prompt word template 130, the electronic device 110 can have at least one round of dialogue with the user, so as to extract information related to the target consultation task (such as the patient's age, gender, symptom characteristics, etc.) from the user input 120. This information corresponds to replaceable variables in the template, such as {gender (Sex)}, {age (Age)}, etc. In this way, the electronic device 110 determines a first prompt word to indicate the information associated with the target consultation task extracted from the user input 120.
[0076] In the disclosed embodiment, through the structured prompt word template structure, key information in the user input can be automatically extracted, and by utilizing the replaceable parameters in the template, it is possible to flexibly adapt to the specific circumstances of different users and generate personalized consulting prompts.
[0077] Continue to refer Figure 2 At block 230, the electronic device 110 determines a second prompt word based at least on the first prompt word. The second prompt word indicates additional information extended from the extracted information associated with the target consulting task.
[0078] In some embodiments, after the electronic device 110 determines the first prompt word based on the user input 120, it can continue to obtain additional information related to the prompt word based on the prompt word (such as age, gender, symptoms, department, etc.) or based on the user input 120 received by continuing the conversation. In this way, the understanding of the target consultation task can be further expanded based on the existing information.
[0079] In some embodiments, the electronic device 110 uses a search enhancement generation technique to retrieve additional information from a knowledge base based on the first prompt word and / or at least another received user input to determine the second prompt word.
[0080] Figure 3C FIG. 3 is a schematic diagram of a process 300C for determining a second prompt word according to some embodiments of the present disclosure. The process 300C may be implemented at the electronic device 110 .
[0081] In some embodiments, the electronic device 110 uses a search enhancement generation technique to retrieve additional information from the knowledge base 330 based on the first prompt word and / or at least another user input 120 received to determine the second prompt word.
[0082] Retrieval-Augmented Generation (RAG) is a machine learning technology that combines retrieval and generation. It can retrieve knowledge related to user questions from the knowledge base, and then use the generative model to generate prompt words based on this knowledge and context information to generate corresponding reply information. This method can significantly improve the accuracy and reliability of the generative model, especially in scenarios that require professional knowledge.
[0083] In some embodiments, the knowledge base 330 may include information resources (also referred to as knowledge) that help the model further understand the target consulting task. Knowledge refers to information or data that has been organized, integrated, refined, and verified, generally has a clear structure and meaning, and can be used to support the implementation of functions or the provision of information. In the knowledge base, knowledge can often be organized and refined through specific methods and tools (such as offline processing, online acquisition), and has a structured or semi-structured form, etc., which together constitute the basis for the system to understand user input, determine the prompt words corresponding to the target consulting task, and generate consulting replies.
[0084] In some embodiments, knowledge may refer to expertise, rules, terminology, and concepts in a specific field. In the consultation response scenario, knowledge includes but is not limited to professional terminology, industry standards, rules in specific scenarios, experience, and solutions to common problems. Different fields have different knowledge systems and rules, so corresponding knowledge is required to effectively interact with users. For example, in the medical field, domain knowledge may include disease diagnosis methods, drug instructions, surgical procedures, etc. In the e-commerce field, domain knowledge may include product classification, pricing strategies, promotion rules, etc.
[0085] As an example, the knowledge base 330 includes the constraint conditions 330-1 corresponding to the consulting content providers (such as a professional field or consulting service providers). For example, for consulting problems in the medical field, general consulting content providers (such as different departments) will have their own differentiated disease collection characteristics and constraints. Each consulting content provider (department) has its specific disease collection tasks and diagnosis and treatment rules.
[0086] In block 331 , the electronic device 110 determines a content provider prompt word based on consulting the constraint condition 330 - 1 corresponding to the content provider.
[0087] In some embodiments, the electronic device 110 can determine the consulting content provider corresponding to the target consulting task based on the first prompt word and / or at least one other user input received. Then, the electronic device 110 can determine from the knowledge base 330 at least one subtask that the consulting content provider will handle for the target consulting task, and determine the second prompt word based on the at least one subtask and the corresponding constraints.
[0088] As an example, during the conversation, the electronic device 110 can generate a first prompt word through user input 120. These prompt words may include the consulting content provider (i.e., department information) of the user consultation. Then the electronic device 110 retrieves and determines the subtasks related to the target consultation task from the knowledge base 330. For example, in user consultations for ophthalmology, subtasks may include asking about the specific symptoms of the left and right eyes, the time of onset, etc.; in user consultations for pediatrics, subtasks may include pre-drug consultations, such as asking about the child's weight to determine a reasonable dosage, etc. The electronic device 110 will determine the subtasks that need to be completed based on the characteristics of the department indicated by the constraint condition 330-1, and ensure that each subtask meets the corresponding department requirements.
[0089] After determining the subtasks that the consulting content provider will handle for the target consulting task, the electronic device 110 generates several sub-items included in the second prompt word based on these subtasks and the corresponding constraints in the knowledge base 330. For example, in a user consultation for ophthalmology, the second prompt word may include "Please describe the symptoms of the left eye and the right eye respectively", or in a user consultation for pediatrics, the second prompt word may include "Please provide the child's weight so that we can give an appropriate medication dose".
[0090] In the disclosed embodiment, different departments have significant differences in disease types, symptom manifestations, treatment methods, etc. By dynamically generating prompt words that meet the requirements of the department, it can ensure that the consultation content is closely centered on the professional field of the department, thereby improving the accuracy and professionalism of the consultation response.
[0091] Continue to refer Figure 3C The knowledge base 330 also includes the standardized and normalized processing procedures corresponding to different types of consulting tasks provided by the consulting content provider, such as the diagnosis and treatment pathway information 330-2.
[0092] In box 332, the electronic device 110 can determine the disease attribute prompt word based on the diagnosis and treatment pathway information 330-2.
[0093] In some embodiments, the electronic device 110 determines the disease information corresponding to the target consultation task based on the first prompt word and / or at least one other user input received. Then, the electronic device 110 determines the second prompt word by determining the diagnosis and treatment pathway information 330-2 corresponding to the target consultation task from the knowledge base based on the disease information.
[0094] As an example, the electronic device 110 first generates a first prompt word through a prompt word template, and this prompt word includes disease information related to the target consultation task extracted according to the symptoms input by the user. After determining the user's disease information, the electronic device 110 can retrieve the diagnosis and treatment path information 330-2 corresponding to the disease in the knowledge base 330. This process generates a second prompt word based on the specific diagnosis and treatment specifications of a specific disease (such as symptom inquiries and examination suggestions for men's prostate problems). The prompt word not only includes standardized diagnosis and treatment steps (such as asking about the duration of symptoms, assessing the cause of the disease, etc.), but also involves personalized diagnosis and treatment pathways (such as prompts and suggestions for routine urine tests, prostate fluid tests, etc.).
[0095] In the disclosed embodiment, the disease information corresponding to the user consultation is extracted based on the first prompt word and the user input, and the second prompt word is dynamically generated based on the RAG, thereby providing a personalized and standardized diagnosis and treatment path. This process not only ensures the resolution of the diagnosis and treatment standardization problem, but also improves the efficiency and accuracy of the consultation.
[0096] As an example, the electronic device 110 may use a four-dimensional search table to help implement the above-mentioned related search operations in the knowledge base 330 . Figure 3D A schematic diagram of a process 300D of searching a knowledge base according to some embodiments of the present disclosure is shown.
[0097] like Figure 3D As shown, a four-dimensional search table for performing search operations can be maintained in the form of a consultation category label 341, a consultation content provider label 342, a structure label 343, and a structure sub-item label 344. Among them, the consultation category label 341 is used to indicate the user's consultation task and the corresponding prompt word template type. The consultation content provider label 342 is used to indicate that the user consults the corresponding provider (such as department information) for corresponding retrieval. The structure label 343 indicates the overall framework for determining the corresponding prompt word. The structure sub-item label 344 is further subdivided on the basis of the structure label 343 to handle specific problems and detailed content in the consultation.
[0098] In some embodiments, the electronic device 110 may further refine and personalize the retrieval results according to the dynamic information of the conversation context (such as disease information 345 ) to generate a dynamically enhanced second prompt word 346 .
[0099] In the disclosed embodiment, by searching for multi-dimensional tags in the table, the electronic device 110 can accurately identify user needs and perform highly personalized and accurate searches in the knowledge base 330, thereby improving the efficiency and accuracy of prompt word generation.
[0100] Return to reference Figure 3C , the knowledge base 330 also includes a computing task identification regular 330-3, which is used to identify target consulting tasks related to computing. The computing task identification regular 330-3 is a set of rules for identifying computing tasks involved in user consultation. It guides the identification of computing tasks in user input through regular expressions or rule models, such as drug dosage calculation, comparison of disease indicators, analysis of examination results, etc., and automatically classifies them into computing-related consulting types.
[0101] In block 333, the electronic device 110 determines the computing parameter prompt words. After the electronic device 110 identifies the computing requirement through the computing task identification rule 330-3, it introduces the computing parameter enhancement process to generate computing parameter prompt words, thereby giving a more professional and accurate response.
[0102] In the disclosed embodiment, by introducing computing task recognition regularization and computing parameter enhancement into the prompt generation process, the computing problems in the consultation replies are effectively solved, which not only improves the accuracy and professionalism of the responses, but also improves the user experience.
[0103] Return to reference Figure 2 In box 240, the electronic device 110 provides a response to the user input by inputting a target prompt word obtained by combining the first prompt word and the second prompt word into a trained machine learning model.
[0104] In some embodiments, after the first prompt word and the second prompt word are determined, the electronic device 110 can perform information replacement or fusion processing on these local prompt words. Through this step, the local prompt words will be integrated together, duplicate information will be removed, missing prompts will be completed, and supplementary information will be expanded, thereby ensuring the overall coherence and accuracy of the prompt words.
[0105] In the disclosed embodiment, after information replacement and fusion processing, the electronic device 110 can obtain a complete and structured target prompt word. The target prompt word combines a refined understanding of the current scene and contains all necessary extended information, so that it can more accurately reflect the user's needs and scenes. By inputting the target prompt word into a trained machine learning model (such as a large language model), a reply to the user input is obtained, which can more accurately analyze the user's consulting questions and give professional and accurate replies and responses.
[0106] In some embodiments, although large language models can understand and generate natural language text, they often have poor performance or inefficiency when dealing with problems that require precise mathematical calculations or logical reasoning. Therefore, the professional accuracy of consultation responses can be improved by combining parameter extraction and localization engineering.
[0107] Figure 3E FIG. 3 is a schematic diagram of a process 300E for processing a computing task according to some embodiments of the present disclosure. The process 300E may be implemented at the electronic device 110 .
[0108] In box 351, the electronic device 110 inputs the target prompt word 140 into the trained machine learning model.
[0109] Since the RAG technology is used to retrieve the computing task identification regularization in the knowledge base during the process of determining the target prompt word 140, the target prompt word 140 includes prompt information for guiding the large model to identify computing tasks. The electronic device 110 can identify the computing tasks included in the user's consultation.
[0110] In some embodiments, in response to determining that the target consulting task includes at least one computing task, the electronic device 110 generates a reply based on a computing model associated with the target application. Because large language models often have difficulty accurately drawing conclusions when dealing with complex computing or professional problems, they are prone to errors, especially when calculating drug dosages or medical indicators. Therefore, when it is identified that the target consulting task includes at least one computing task, the electronic device 110 may not directly use the large model to draw conclusions, but instead use the model of localized engineering to complete professional computing or information retrieval tasks.
[0111] At block 352 , the electronic device 110 determines a computing model for processing a computing task.
[0112] In some embodiments, the electronic device 110 determines corresponding calculation models, such as localized Agent modules, according to different types of tasks corresponding to user input, to assist the large language model in processing specific tasks. The localized Agent modules may include, for example, formula calculation Agents, compliance sensitive word Agents, and drug instructions Agents.
[0113] In some embodiments, the electronic device 110 determines parameter information associated with the computing task based on at least one received user input.
[0114] In box 353, the electronic device 110 provides a response corresponding to the user input by inputting the parameter information into the corresponding calculation model.
[0115] As an example, the electronic device 110 determines that the user consultation includes a task related to BMI calculation based on the information input by the user, such as height and weight. At this time, the task of the large language model is to extract the relevant parameters of height and weight, rather than directly calculate them. After the parameter extraction is completed, the localized formula calculation Agent performs a specific calculation task based on the extracted parameters, thereby outputting an accurate BMI value.
[0116] As another example, when a user inquires about information related to drug use, the electronic device 110 can extract the drug name through the large language model. Then, based on the drug instructions, the Agent retrieves appropriate usage and dosage information and provides it to the large language model for sorting to ensure the accuracy of the response.
[0117] In the disclosed embodiment, by combining the large language model with the localized computing model, the large language model can focus on understanding the context and extracting parameters, while specific computing and information retrieval tasks are completed by the localized computing model. This approach solves the shortcomings of the large model in dealing with professional and complex computing problems, and effectively improves the accuracy and reliability of the consultation response.
[0118] Figure 4 A block diagram of an apparatus 400 for replying to a consultation according to some embodiments of the present disclosure is shown. The apparatus 400 may be implemented as or include the electronic device 110.
[0119] The device 400 includes a template determination module 410, which is configured to determine a prompt word template corresponding to a target consultation task in response to user input received from a target application indicating a target consultation task; a prompt word determination module 420, which is configured to use the prompt word template to determine a first prompt word based on user input, the first prompt word indicating information associated with the target consultation task extracted from the user input; the prompt word determination module 420, which is also configured to determine a second prompt word based on at least the first prompt word, the second prompt word indicating additional information extended from the extracted information associated with the target consultation task; and a reply module 430, which is configured to provide a reply to the user input by inputting a target prompt word obtained by combining the first prompt word and the second prompt word into a trained machine learning model.
[0120] In some embodiments, the trained machine learning model comprises a large language model.
[0121] In some embodiments, the knowledge base determination module 410 is further configured to query historical conversations between the user and the dialogue system; if it is determined based on user needs that the first input indicates a response to historical interaction content in the historical conversation, then the first input is determined to be in a clarification state.
[0122] In some embodiments, the user input is in natural language, and the template determination module 410 is further configured to identify the type of the target consultation task in response to the user input indicating the target consultation task; and determine the prompt word template based on the type.
[0123] In some embodiments, the type of target consultation task includes at least one of the following: medication consultation, disease consultation, symptom consultation, and rehabilitation guidance consultation.
[0124] In some embodiments, the prompt word determination module 420 is further configured to extract prompt information associated with the target consulting task from the user input based on the structured conditions of the prompt word template to determine the first prompt word.
[0125] In some embodiments, the prompt word determination module 420 is further configured to utilize a search enhancement generation technique to retrieve additional information from a knowledge base based on the first prompt word and / or at least another received user input to determine a second prompt word.
[0126] In some embodiments, the prompt word determination module 420 is further configured to determine the consulting content provider corresponding to the target consulting task based on the first prompt word and / or at least one other user input received; and determine at least one subtask to be processed by the consulting content provider for the target consulting task from the knowledge base; and determine the second prompt word based on at least one subtask and corresponding constraints.
[0127] In some embodiments, the prompt word determination module 420 is further configured to determine the disease information corresponding to the target consultation task based on the first prompt word and / or at least one other user input received; and determine the second prompt word by determining the diagnosis and treatment pathway information corresponding to the target consultation task from the knowledge base based on the disease information.
[0128] In some embodiments, the apparatus 400 further includes a computing module 440 further configured to generate a reply based on a computing model associated with the target application in response to determining that the target consulting task includes at least one computing task.
[0129] In some embodiments, the computing module 440 is further configured to determine a computing model for processing a computing task; determine parameter information associated with the computing task based on at least one user input received; and generate a response corresponding to the user input by inputting the parameter information into the computing model.
[0130] The modules included in the device 400 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units in the device 400 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0131] Figure 5 1 shows a block diagram of an electronic device 500 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 5 The electronic device 500 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein.
[0132] like Figure 5As shown, the electronic device 500 is in the form of a general electronic device. The components of the electronic device 500 may include, but are not limited to, one or more processors or processing units 510, a memory 520, a storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. The processing unit 510 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 520. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 500.
[0133] The electronic device 500 typically includes a plurality of computer storage media. Such media may be any available media accessible to the electronic device 500, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 520 may be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 530 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data and may be accessed within the electronic device 500.
[0134] The electronic device 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 5 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 520 may include a computer program product 525 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.
[0135] The communication unit 540 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 500 can be implemented in a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 500 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.
[0136] The input device 550 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 560 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 500 may also communicate with one or more external devices (not shown) through the communication unit 540 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 500, or communicate with any device that allows the electronic device 500 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).
[0137] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which one or more computer instructions are stored, wherein the one or more computer instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.
[0138] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0139] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0140] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0141] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.
[0142] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the marketplace, or to enable other persons of ordinary skill in the art to understand the implementations disclosed herein.
Claims
1. A method for responding to an inquiry, comprising: In response to a user input received from a target application indicating a target consulting task, determining a prompt word template corresponding to the target consulting task; Determining a first prompt word based on the user input using the prompt word template, wherein the first prompt word indicates information associated with the target consulting task extracted from the user input; determining a second prompt word based at least on the first prompt word, the second prompt word indicating additional information extended from the extracted information associated with the target consulting task; as well as A response to the user input is provided by inputting a target prompt word obtained by combining the first prompt word and the second prompt word into a trained machine learning model.
2. The method of claim 1, wherein the trained machine learning model comprises a large language model.
3. The method according to claim 1, wherein the user input is input in a natural language form, and determining the prompt word template comprises: In response to the user input indicating the target consulting task, identifying a type of the target consulting task; as well as The prompt word template is determined based on the type.
4. The method according to claim 3, wherein the type of the target consultation task includes at least one of the following: medication consultation, disease consultation, symptom consultation, and rehabilitation guidance consultation.
5. The method according to claim 1, wherein determining the first prompt word comprises: Based on the structured conditions of the prompt word template, prompt information associated with the target consulting task is extracted from the user input to determine the first prompt word.
6. The method according to claim 1, wherein determining the second prompt word comprises: The second prompt word is determined by retrieving the additional information from a knowledge base based on the first prompt word and / or at least another received user input using a search enhancement generation technique.
7. The method according to claim 6, wherein determining the second prompt word comprises: Determining a consulting content provider corresponding to the target consulting task based on the first prompt word and / or at least one other user input received; as well as Determining from the knowledge base at least one subtask to be processed by the consulting content provider for the target consulting task; as well as The second prompt word is determined based on the at least one subtask and corresponding constraints.
8. The method according to claim 6, wherein determining the second prompt word further comprises: Determining the disease information corresponding to the target consultation task based on the first prompt word and / or at least one other user input received; as well as The second prompt word is determined by determining the diagnosis and treatment pathway information corresponding to the target consultation task from the knowledge base based on the disease information.
9. The method according to claim 1, further comprising: In response to determining that the target consulting task includes at least one computing task, the reply is generated based on a computing model associated with the target application.
10. The method of claim 9, wherein generating the reply comprises: determining the computing model for processing the computing task; Determining parameter information associated with the computing task based on at least one received user input; as well as The parameter information is input into the calculation model to generate a reply corresponding to the user input.
11. A device for replying to an inquiry, comprising: a template determination module configured to determine a prompt word template corresponding to the target consultation task in response to a user input received from a target application indicating the target consultation task; a prompt word determination module, configured to determine a first prompt word based on the user input using the prompt word template, wherein the first prompt word indicates information associated with the target consulting task extracted from the user input; A prompt word determination module is further configured to determine a second prompt word based at least on the first prompt word, wherein the second prompt word indicates additional information extended from the extracted information associated with the target consulting task; as well as The reply module is configured to provide a reply to the user input by inputting a target prompt word obtained by combining the first prompt word and the second prompt word into a trained machine learning model.
12. An electronic device comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 10 when executed by the at least one processing unit.
13. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 10.
14. A computer program product tangibly stored in a computer storage medium and comprising computer executable instructions which, when executed by a device, cause the device to perform the method according to any one of claims 1 to 10.
Citation Information
Cited By
Traffic service recommendation method, electronic equipment and medium
CN120744243A
A traffic travel service recommendation method, electronic device and medium
CN120744243B
Prompt word risk assessment method and device for large model application, equipment and storage medium
CN120806144A