Consultation reply result generation method and apparatus, electronic device, and storage medium
By determining the consultation intention and response risk level of the medical consultation request, consultation response results that meet the response risk level requirements are generated, which solves the problem of the automatic question and answer system displaying high-risk medication and treatment methods, and ensures the health and safety of users.
Patent Information
- Application Number
- PCT/CN2023/141966
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-21
- Filing Date
- 2023-12-26
- Publication Date
- 2024-10-24
AI Technical Summary
When existing automated question and answer systems give medical advice, they may display high-risk medications and treatments to users, causing the user's health to be negatively affected.
By determining the consultation intention and response risk level of the medical consultation request, we can generate consultation response results that meet the requirements of the response risk level and avoid displaying high-risk medication and treatment methods.
It ensures that users are not misled into using high-risk medications and treatments, protects users' health, and achieves safe medical consultation response results.
Smart Images

Figure CN2023141966_24102024_PF_FP_ABST
Abstract
Description
Method, device, electronic device and storage medium for generating consultation response results Technical Field
[0001] The present application relates to the field of intelligent question-answering technology, and in particular to a method, device, electronic device and storage medium for generating inquiry response results.
[0002] Background of the Invention
[0003] Existing automated question-and-answer systems can automatically provide medical advice based on user questions, alleviating the shortage of medical resources. However, some medications and treatments carry high risks, and their use by users could negatively impact their health. If automated question-and-answer systems also display these high-risk medications and treatments as answers, this could negatively impact their health.
[0004] Summary of the Invention
[0005] In view of this, the present application proposes a method, device, electronic device and storage medium for generating consultation response results to solve the problem in the existing technology that the automatic question-answering system displays high-risk medications and treatment methods as answers to users, which may have a negative impact on the user's physical health.
[0006] The technical solutions proposed in this application are as follows:
[0007] In the first aspect, the present application provides a method for generating a consultation response result, including: determining the consultation intention to which the medical consultation request belongs based on a medical consultation request; and generating a consultation response result that meets the response risk level requirements corresponding to the consultation intention based at least on the medical consultation request and the consultation intention.
[0008] In some embodiments, the consultation reply result generating method also includes: based on the medical consultation request, determining a reply paradigm for answering the medical consultation request, the reply paradigm representing the sentence structure of the consultation reply result, wherein, at least based on the medical consultation request and the consultation intention, generating a consultation reply result that meets the reply risk level requirements corresponding to the consultation intention, including: based on the medical consultation request, the consultation intention and the reply paradigm, generating the consultation reply result that meets the reply risk level requirements and conforms to the reply paradigm.
[0009] In some embodiments, the determination of the response paradigm for answering the medical consultation request based on the medical consultation request includes: detecting whether the medical consultation request contains valid information; the valid information includes necessary information for generating the consultation response result corresponding to the medical consultation request; if the medical consultation request contains the valid information, then determining a first response paradigm as the response paradigm for replying to the medical consultation request, and the first response paradigm includes an answer paradigm for replying to the medical consultation request; if the medical consultation request does not contain the valid information, then determining a second response paradigm as the response paradigm for replying to the medical consultation request, and the second response paradigm includes a question paradigm for inquiring about the valid information.
[0010] In some embodiments, the first reply paradigm includes an analysis statement and a reply statement; the analysis statement includes a statement for analyzing the entity object corresponding to the medical consultation request, and the reply statement includes a statement for replying to the medical consultation request.
[0011] In some embodiments, the first reply paradigm further includes a medical advice statement, wherein the medical advice statement includes a statement advising the user to seek professional medical assistance.
[0012] In some embodiments, based on the medical consultation request, determining the consultation intention to which the medical consultation request belongs, and determining the response paradigm for answering the medical consultation request, includes: inputting the medical consultation request into a pre-trained intention classification model, so that the intention classification model determines the consultation intention to which the medical consultation request belongs based on the medical consultation request, and determines the response paradigm for answering the medical consultation request, wherein the intention classification model is trained with sample medical consultation requests as training samples, with the goal of predicting the consultation intention corresponding to the sample medical consultation request, and predicting the response paradigm for answering the sample medical consultation request.
[0013] In some embodiments, based on the medical consultation request, the consultation intention and the reply paradigm, the consultation reply result that meets the reply risk level requirements and the reply paradigm is generated, including: inputting the medical consultation request, the consultation intention and the reply paradigm into a pre-trained consultation reply result generation model, so that the consultation reply result generation model determines the reply risk level requirements corresponding to the consultation intention, and generates a consultation reply result that meets the reply risk level requirements and the reply paradigm based on the medical consultation request, the consultation intention, the reply paradigm and the reply risk level requirements, wherein the consultation reply result generation model is obtained by supervised training and reinforcement training with sample medical consultation requests, and sample consultation intentions and sample reply paradigms corresponding to the sample medical consultation requests as training samples; wherein the supervised training at least takes predicting the consultation reply results that meet the sample reply paradigm as a training goal; and the reinforcement training at least takes predicting the consultation reply results that meet the reply risk level requirements of the sample consultation intentions as a training goal.
[0014] In some embodiments, the supervised training process includes: inputting the training samples into a pre-trained dialogue generation model to obtain response data generated by the dialogue generation model; obtaining corrected data after adjusting the response data, and the adjustment processing includes adjusting the response data in the response data that does not conform to medical common sense and does not conform to the sample response paradigm; determining the corrected data as a training label, and using the training samples and the training labels to perform consultation response generation training on the consultation response result generation model.
[0015] In some embodiments, the training process of the reinforcement training includes: inputting the training sample into the consultation response result generation model to obtain multiple consultation response results output by the consultation response result generation model; obtaining the labeled data after labeling the multiple consultation response results corresponding to the training sample, and the labeling processing includes labeling the response risk level of the multiple consultation response results; using the labeled data to perform consultation response generation training on the consultation response result generation model.
[0016] In some embodiments, the consultation response result that meets the response risk level requirements corresponding to the consultation intention is generated at least based on the medical consultation request and the consultation intention, including: determining the response risk level requirements corresponding to the consultation intention according to preset rules; based on the medical consultation request, the consultation intention and the response risk level requirements, generating the consultation response result that meets the response risk level requirements.
[0017] In some embodiments, the consultation response result that meets the response risk level requirements is generated based on the medical consultation request, the consultation intention and the response risk level requirements, including: inputting the medical consultation request, the consultation intention and the response risk level requirements into a first question-and-answer model, so that the first question-and-answer model generates the consultation response result that meets the response risk level requirements, and the first question-and-answer model is trained using medical consultation request data, the consultation intention corresponding to the medical consultation request data and the response risk level requirements corresponding to the medical consultation request data as training samples, and using the standard response corresponding to the medical consultation request data as training labels.
[0018] In some embodiments, the consultation response result that meets the response risk level requirements is generated based on the medical consultation request, the consultation intention and the response risk level requirements, including: generating multiple candidate consultation response results according to the medical consultation request and the consultation intention; and selecting a candidate consultation response result that meets the response risk level requirements from the multiple candidate consultation response results as the consultation response result according to the response risk level requirements.
[0019] In some embodiments, generating multiple candidate consultation response results based on the medical consultation request and the consultation intention includes: inputting the medical consultation request and the consultation intention into a second question-answering model to obtain the multiple candidate consultation response results output by the second question-answering model, and the second question-answering model is trained using medical consultation request data and the consultation intention corresponding to the medical consultation request data as training samples, and using multiple responses corresponding to the medical consultation request data as training labels.
[0020] In some embodiments, according to the response risk level requirement, selecting a candidate consultation response result that meets the response risk level requirement from the multiple candidate consultation response results as the consultation response result includes: inputting the multiple candidate consultation response results into a risk classification model to obtain the risk level corresponding to each candidate consultation response result in the multiple candidate consultation response results, and selecting the consultation response result that meets the response risk level requirement from the multiple candidate consultation response results according to the risk level corresponding to each candidate consultation response result in the multiple candidate consultation response results.
[0021] In some embodiments, according to the response risk level requirement, selecting a candidate consultation response result that meets the response risk level requirement from the multiple candidate consultation response results as the consultation response result includes: inputting the response risk level requirement and the multiple candidate consultation response results into a risk classification model, and obtaining the consultation response result that meets the response risk level requirement output by the risk classification model.
[0022] In some embodiments, the consultation intention includes at least one of consulting on diseases, consulting on symptoms, consulting on medications, and consulting on surgery; the consultation on diseases includes at least one of disease concepts, disease causes, and disease treatment departments; the consultation on symptoms includes at least one of symptom causes, symptom severity, and symptom treatment measures; the consultation on medications includes at least one of medication types, medication methods, medication time, and medication precautions; the consultation on surgery includes at least one of whether surgery is needed, surgical methods, surgical precautions, and surgical complications.
[0023] In the second aspect, the present application provides a consultation response result generating device, including: a determination module, used to determine the consultation intention to which the medical consultation request belongs based on the medical consultation request; a generation module, used to generate a consultation response result that meets the response risk level requirements corresponding to the consultation intention based at least on the medical consultation request and the consultation intention.
[0024] In some embodiments, the determination module is also used to: determine a response paradigm for answering the medical consultation request based on the medical consultation request, and the response paradigm represents the sentence structure of the consultation response result; the generation module is used to: generate the consultation response result that meets the response risk level requirements and conforms to the response paradigm based on the medical consultation request, the consultation intention and the response paradigm.
[0025] In a third aspect, the present application provides an electronic device comprising: a memory and a processor; wherein the memory is used to store programs; and the processor is used to implement the method described in any one of the above embodiments by running the programs in the memory.
[0026] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described in any one of the above embodiments is implemented.
[0027] The consultation response result generation method proposed in this application can determine the consultation intention of the medical consultation request based on the user's medical consultation request, and then determine the consultation response result that meets the response risk level requirements corresponding to the consultation intention based on at least the medical consultation request and the consultation intention, thereby achieving the purpose of displaying the consultation response result that meets the response risk level requirements to the user, avoiding misleading the user into using high-risk medications and treatment methods, and ensuring that the user's physical health is not affected.
[0028] BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0030] FIG1 is a flow chart of a method for generating a consultation response result provided in an embodiment of the present application.
[0031] FIG2 is a flow chart of a method for generating consultation response results provided in another embodiment of the present application.
[0032] FIG3 is a flow chart of a method for determining a response pattern according to an embodiment of the present application.
[0033] FIG4 is a flowchart of the supervised training of the consultation response result generation model provided in an embodiment of the present application.
[0034] FIG5 is a flowchart of the intensive training of the consultation response result generation model provided in an embodiment of the present application.
[0035] FIG6 is a flow chart of model training according to an embodiment of the present application.
[0036] FIG7 is a schematic structural diagram of a consultation reply result generating device provided in an embodiment of the present application.
[0037] FIG8 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
[0038] Modes for Carrying Out the Invention
[0039] The technical solution of the embodiment of the present application is applicable to the application scenario of responding to medical consultation requests. The technical solution of the embodiment of the present application can avoid misleading users into using high-risk medications and treatment methods, and ensure that the user's physical health is not affected.
[0040] Existing technologies enable automated question-and-answer systems to automatically provide medical advice based on user questions, alleviating the shortage of medical resources. For example, if a user inquires about a specific disease, the automated question-and-answer system can automatically provide information on the corresponding symptoms and treatments. If a user inquires about a specific medication, the automated question-and-answer system can automatically provide information on the medication's effects, usage, dosage, and related dosage forms.
[0041] However, some medications and treatments carry higher risks and should be used with caution under the guidance of professional medical personnel. Self-use may negatively impact the user's health. For example, a medication may be effective for a specific condition, but it may also have significant side effects. Therefore, a professional medical professional should determine whether to use the medication based on the patient's symptoms. If the medication is used, the dosage should be determined based on the patient's symptoms to minimize any side effects. However, self-use may result in health damage due to an inability to effectively determine dosage.
[0042] If the automatic question-answering system displays these high-risk medications and treatments as answers to users, it may mislead users into using high-risk medications and treatments, which may have a negative impact on their physical health.
[0043] Based on this, the present application proposes a method, device, electronic device and storage medium for generating consultation response results. This technical solution can determine the corresponding response risk level requirements based on the user's medical consultation request, and generate consultation response results that meet the response risk level requirements, thereby solving the problem in the existing technology that the automatic question-and-answer system displays high-risk medications and treatment methods as answers to users, which may have a negative impact on the user's physical health.
[0044] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0045] The present application provides a method for generating a consultation response result. The method can be executed by an electronic device, which can be any device with data and instruction processing capabilities, such as a computer, smart terminal, server, etc. Referring to FIG1 , the method includes:
[0046] S101. Determine the consultation intention of the medical consultation request based on the medical consultation request.
[0047] The aforementioned medical consultation request refers to a medical question raised during a medical consultation and includes the question statement for the medical consultation. For example, a medical consultation request may include, "Can I take berberine for acute gastroenteritis?" or "Why do I experience palpitations and how can I treat them?" Medical consultation requests are generally input by the user and may be in text, image, or voice formats, etc., which are not limited in this embodiment. It should be noted that if the medical consultation request is in voice or image format, it is necessary to convert the voice or image format of the medical consultation request into text to determine the specific content of the medical consultation request.
[0048] Consultation intent refers to the purpose of a medical consultation request. Consultation intent can be categorized into various types based on the medical scenario. For example, consultation intent can be categorized into at least one of disease consultation, symptom consultation, medication consultation, surgery consultation, and diet consultation. Consultation intent can also be categorized into disease and symptom consultation, treatment consultation, and other types, although this embodiment does not limit this.
[0049] For example, the medical consultation request in the above embodiment, "Can I take berberine for acute gastroenteritis?", can determine that the purpose of the consultation is to inquire about the drug berberine, and the consultation intention of the medical consultation request can be determined as consulting about medication; the medical consultation request in the above embodiment, "Why do I feel palpitations, and how to treat it", can determine that the purpose of the consultation is to treat the symptom of palpitations, and the consultation intention of the medical consultation request can be determined as consulting about symptoms.
[0050] In this embodiment, after receiving a medical consultation request, the consultation intent of the medical consultation request is determined. For example, if consultation intent is categorized as disease consultation, symptom consultation, medication consultation, or surgical consultation, then in this embodiment of the application, it is determined whether the consultation intent of the medical consultation request belongs to disease consultation, symptom consultation, medication consultation, or surgical consultation.
[0051] In some optional embodiments, a request classification model may be pre-trained to determine the consultation intent of a medical consultation request. Specifically, a medical consultation request is input into the pre-trained request classification model, so that the request classification model can determine the consultation intent of the medical consultation request based on the medical consultation request.
[0052] A large amount of medical consultation request data can be collected as training samples, and professional medical staff can mark the consultation intent corresponding to the medical consultation request data as training labels to train the request classification model. When training the request classification model, the training samples are input into the request classification model to obtain the prediction results output by the request classification model. By comparing the prediction results with the training labels, the loss value of the request classification model is determined. With the goal of reducing the loss value of the request classification model, the parameters of the request classification model are adjusted. The above training process is then repeated until the loss value of the request classification model is less than the set value. The above set value can be set according to actual conditions and is not limited in this embodiment.
[0053] The request classification model can use a language model, such as the Transformer model and the Bert model.
[0054] In some optional embodiments, a large number of medical consultation requests with known consultation intents may be collected and then categorized according to their different consultation intents to form a database of medical consultation requests with different types of consultation intents. Subsequently, after obtaining a medical consultation request, the distance between the obtained medical consultation request and each medical consultation request database may be calculated, and the consultation intent corresponding to the medical consultation request database with the closest distance may be determined as the consultation intent of the obtained medical consultation request.
[0055] Specifically, when calculating the distance between the obtained medical consultation request and each medical consultation request database, the distance between the medical consultation request and the cluster center of each medical consultation request database can be calculated, and the consultation intention corresponding to the medical consultation request database with the closest distance can be determined as the consultation intention of the obtained medical consultation request.
[0056] S102. Generate a consultation response result that meets the response risk level requirements corresponding to the consultation intent based on at least the medical consultation request and the consultation intent.
[0057] The response risk level refers to the risk level of the response to the aforementioned medical consultation request. The response risk level indicates the degree of risk associated with the response. Generally, the higher the response risk level, the riskier the corresponding response, and the more likely it is that the response will include riskier medications or treatments. If a response with a high response risk level is output, and the user self-prescribes medication or treatment based on the response, their health is more likely to be negatively impacted.
[0058] In this embodiment, the risk level classification of the consultation response results is related to the consultation intent corresponding to the medical consultation request. That is, different types of consultation intents have different risk level classification methods for the corresponding consultation response results.
[0059] Generally speaking, for consultation intentions regarding treatment methods, including consultation intentions regarding medication, surgery, and treatment measures, once the user self-administers medication or treatment according to the consultation response results, it will directly affect the user's physical health. Therefore, the consultation response results corresponding to the above consultation intentions can be divided into several response risk levels, and then it is required to only generate consultation response results with lower response risk levels. Specifically, the consultation response results corresponding to the above consultation intentions can be divided into several response risk levels according to the degree of impact on the user's health. For example, the consultation response results corresponding to the above consultation intentions can be divided into high risk level, low risk level, and medium risk level.
[0060] For consultations seeking medical knowledge, including those on drug ingredients and disease pathogenesis, the corresponding responses will not provide users with medication or treatment guidance, but rather only relevant medical knowledge. Therefore, they will not impact their health. Therefore, it is possible to assign no risk level to responses seeking medical knowledge, or assign all responses seeking medical knowledge to a lower risk level.
[0061] For recipe-related consultations, the corresponding responses do not provide users with medication or treatment guidance, nor do they impact their health. Therefore, it's possible to assign no risk level to responses related to recipe-related consultations, or assign all responses related to recipe-related consultations to a lower risk level.
[0062] After this division, the same question, when assigned different consultation intentions, may generate consultation responses at different risk levels. For example, for the question "weight loss methods," if the medical consultation request is "What medicine can help with weight loss?", then the medical consultation request can be determined to be a consultation on medications. Drug A and Drug B can both be used for weight loss, and Drug A has no side effects. The consultation response containing Drug A can be classified as low-risk. Drug B has significant side effects, and the consultation response containing Drug B can be classified as high-risk. If the medical consultation request is "What foods can help with weight loss?", then the medical consultation request can be determined to be a consultation on recipes. Food D can help with weight loss and will not affect the user's health. The consultation response containing Food D can be classified as low-risk.
[0063] Response risk level requirements refer to the risk level requirements for response results based on each inquiry intent. In some embodiments, response risk level requirements corresponding to each inquiry intent can be determined to limit the risk level of the response results, avoiding the generation of responses with excessively high risk levels. This, in turn, prevents high-risk medications and treatments from being presented to users as answers, potentially negatively impacting their health.
[0064] For example, for the consultation intention of consulting on treatment methods, including consultation intention of consulting on medication, consultation on surgery, consultation on treatment measures, etc., the consultation response results are divided into high-risk level, low-risk level and medium-risk level, and the response risk level requirement may include that only consultation response results of low-risk level can be generated; for the consultation intention of medical knowledge, including consultation intention of consulting on drug ingredients, consultation on disease pathogenesis, etc., as well as consultation intention of recipes, the consultation response results are all low-risk level, and the response risk level requirement may not limit the response risk level of the consultation response result, or include that only consultation response results of low-risk level can be generated.
[0065] In some embodiments, the above steps: determining the response risk level requirements corresponding to the consultation intention, and generating a consultation response result that meets the response risk level requirements based at least on the medical consultation request and the consultation intention, may specifically include: after determining the consultation intention to which the medical consultation request belongs, first determining the response risk level requirements corresponding to the consultation intention, and then generating a consultation response result that meets the response risk level requirements based at least on the medical consultation request and the consultation intention.
[0066] In some embodiments, generating a consultation response that meets the response risk level requirements corresponding to the consultation intent based on at least the medical consultation request and the consultation intent includes: determining the response risk level requirements corresponding to the consultation intent based on preset rules; and generating a consultation response that meets the response risk level requirements based on the medical consultation request, the consultation intent, and the response risk level requirements. The preset rules can be set according to actual needs.
[0067] Specifically, response risk level requirements corresponding to each consultation intent can be pre-set. The pre-set rules may include a correspondence between consultation intent and response risk level requirements. After determining the consultation intent to which a medical consultation request belongs, the response risk level requirement corresponding to that consultation intent can be determined based on the pre-set settings. For example, the response risk level requirement corresponding to that consultation intent may only output consultation responses with a low risk level.
[0068] Then, based on the consultation intent, the response risk level requirement corresponding to the consultation intent, and the medical consultation request, a consultation response result that meets the response risk level requirement is generated. In some embodiments, generating a consultation response result that meets the response risk level requirement based on the medical consultation request, the consultation intent, and the response risk level requirement includes: inputting the medical consultation request, the consultation intent, and the response risk level requirement into a first question-and-answer model, so that the first question-and-answer model generates a consultation response result that meets the response risk level requirement. The first question-and-answer model is trained using the medical consultation request data, the consultation intent corresponding to the medical consultation request data, and the response risk level requirement corresponding to the medical consultation request data as training samples, and using the standard responses corresponding to the medical consultation request data as training labels. Exemplarily, the first question-and-answer model can be pre-trained, and the first question-and-answer model is used to generate a consultation response result that meets the response risk level requirement based on the medical consultation request, the consultation intent, and the response risk level requirement corresponding to the consultation intent. The consultation intent, the response risk level requirement corresponding to the consultation intent, and the medical consultation request are all input into the first question-and-answer model, so that the first question-and-answer model generates a consultation response result that meets the response risk level requirement.
[0069] A large amount of medical consultation request data can be collected, and professional medical staff can calibrate the consultation intentions and response risk level requirements corresponding to the medical consultation request data. The medical consultation request data, the calibrated consultation intentions and response risk level requirements are used as training samples, and the standard responses set by professional medical staff are used as training labels to train the first question-answering model. The training process is the same as the training process of the request classification model in the above embodiment. Regarding the specific training process of the first question-answering model, technical personnel in this field can refer to the above-mentioned records on the request classification model training process, which will not be repeated here. The first question-answering model can adopt a language model, such as a Transformer model, a Bert model, etc., and can also adopt an open source large-scale language model (LLM) dialogue system, such as Chat Generative Pre-trained Transformer (ChatGPT), which is not limited in this embodiment.
[0070] In some other embodiments, the above steps: generating a consultation response result that meets the response risk level requirements based on the medical consultation request, consultation intention and response risk level requirements may specifically include: generating multiple candidate consultation response results based on the medical consultation request and consultation intention; and selecting a candidate consultation response result that meets the response risk level requirements from multiple candidate consultation response results as the consultation response result based on the response risk level requirements.
[0071] In some embodiments, multiple candidate consultation response results are generated based on the medical consultation request and the consultation intention, including: inputting the medical consultation request and the consultation intention into a second question-answering model, and obtaining multiple candidate consultation response results output by the second question-answering model. The second question-answering model is trained using the medical consultation request data and the consultation intention corresponding to the medical consultation request data as training samples, and using multiple responses corresponding to the medical consultation request data as training labels.
[0072] Specifically, a second question-answering model can be pre-trained to generate multiple consultation response results based on the medical consultation request and consultation intent. The medical consultation request and consultation intent are input into the second question-answering model, and the second question-answering model outputs multiple consultation response results.
[0073] A large amount of medical consultation request data can be collected, and professional medical staff can calibrate the consultation intent corresponding to the medical consultation request data. The medical consultation request data and the calibrated consultation intent are used as training samples. Professional medical staff set a variety of replies as training labels to train the second question-answering model. The training process is the same as the training process of the request classification model in the above embodiment. Regarding the specific training process of the second question-answering model, technical personnel in this field can refer to the above-mentioned records on the training process of the request classification model, which will not be repeated here. The second question-answering model can adopt a language model, such as a Transformer model, a Bert model, etc., and can also adopt an open source LLM dialogue system, such as ChatGPT, which is not limited in this embodiment.
[0074] Furthermore, a risk classification model can be trained to classify the multiple consultation response results output by the second question-answering model and output the risk level corresponding to each candidate consultation response result. For example, based on the response risk level requirement, a candidate consultation response result that meets the response risk level requirement is selected from the multiple candidate consultation response results as the consultation response result, including: inputting the multiple candidate consultation response results into the risk classification model to obtain the risk level corresponding to each candidate consultation response result in the multiple candidate consultation response results; and based on the risk level corresponding to each candidate consultation response result in the multiple candidate consultation response results, selecting a consultation response result that meets the response risk level requirement from the multiple candidate consultation response results.
[0075] After obtaining the risk level corresponding to each candidate consultation response result, staff or other control logic can select a consultation response result that meets the response risk level requirements from multiple candidate consultation response results based on the response risk level requirements.
[0076] A large number of consultation response results can be collected as training samples, and professional medical staff can calibrate the response risk levels of the consultation response results as training labels to train the risk classification model. The training process is the same as the training process of the request classification model in the above embodiment. Regarding the specific training process of the risk classification model, technical personnel in this field can refer to the above records on the request classification model training process, which will not be repeated here. The risk classification model can use a language model, such as a Transformer model, a Bert model, etc., and can also use an open source LLM dialogue system, such as ChatGPT, which is not limited in this embodiment.
[0077] Optionally, in one embodiment, based on the response risk level requirement, a candidate consultation response result that meets the response risk level requirement is selected from a plurality of candidate consultation response results as the consultation response result, including: inputting the response risk level requirement and a plurality of candidate consultation response results into a risk classification model, and obtaining a consultation response result output by the risk classification model that meets the response risk level requirement. In this embodiment, the input of the risk classification model includes the response risk level requirement and a plurality of candidate consultation response results, and the output of the risk classification model includes a consultation response result whose risk level requirement meets the response risk level requirement. Specifically, the response risk level requirement and a large number of consultation response results can be used as training samples, and the consultation response results that meet the response risk level requirement calibrated by professional medical staff can be used as training labels to train the risk classification model.
[0078] In some embodiments, in addition to generating a consultation response result that meets the response risk level requirements based on the medical consultation request and consultation intention, user information such as the user's gender and age can also be collected to generate a consultation response result that meets the response risk level requirements based on the user information, medical consultation request, and consultation intention.
[0079] Specifically, we can first generate initial results that meet the response risk level requirements based on the medical consultation request and consultation intention, and then determine the user's reading habits based on user information such as gender and age. We can adjust the initial results based on the user's reading habits, and then generate consultation response results that are easy for users to read and understand.
[0080] In the above embodiments, based on the user's medical consultation request, it is possible to determine the consultation intent to which the medical consultation request belongs, determine the response risk level requirements corresponding to the consultation intent, and then determine the consultation response results that meet the response risk level requirements based on at least the medical consultation request and the consultation intent, thereby achieving the purpose of displaying the consultation response results that meet the response risk level requirements to the user, avoiding misleading the user into using high-risk medications and treatment methods, and ensuring that the user's physical health is not affected.
[0081] As an optional implementation, as shown in FIG2 , another embodiment of the present application discloses a method for generating a consultation reply result, which may include the following steps:
[0082] S201. Determine the consultation intention of the medical consultation request based on the medical consultation request.
[0083] The specific implementation method of step S201 is the same as the specific implementation method of step S101 in the above embodiment. Therefore, regarding the specific implementation method of step S201, technical personnel in this field can refer to the record of the specific implementation method of step S101 in the above embodiment, which will not be repeated here.
[0084] S202: Based on the medical consultation request, determine a response paradigm for responding to the medical consultation request.
[0085] The above-mentioned reply paradigm refers to the sentence structure of the consultation reply result, which can guide the generation of the consultation reply result. That is, in the embodiments of the present application, the consultation reply result is organized and generated according to the reply paradigm. The reply paradigm of the consultation reply result can be set according to the actual situation. An example reply paradigm may include an analysis statement and a reply statement, wherein the analysis statement is used to analyze the entity object in the medical consultation request, and the reply statement is used to provide a targeted reply to the medical consultation request.
[0086] For example, if the medical consultation request is "What medicine should I take for gastroenteritis?", according to the above response paradigm, the following consultation response results can be generated:
[0087] The treatment of gastroenteritis mainly focuses on controlling symptoms and eliminating the cause through medication. Commonly used medications for gastroenteritis include:
[0088] 1. Antibiotics: used to treat gastroenteritis caused by bacteria, such as cephalosporins, fluoroquinolones, ampicillin, etc.
[0089] 2. Painkillers: used to relieve abdominal pain symptoms, such as aspirin, ibuprofen, etc.
[0090] 3. Anti-gastric drugs: used to reduce gastric acid secretion, such as omeprazole, lansoprazole, etc.
[0091] 4. Anti-inflammatory drugs: used to relieve inflammatory symptoms, such as ibuprofen, acetaminophen, etc.
[0092] The sentence in the consultation response result, "The treatment of gastroenteritis is mainly through controlling symptoms and eliminating causes through medication," is an analysis of the entity object "gastroenteritis" in the medical consultation request. The remaining sentences are used to provide targeted responses to the medical consultation request.
[0093] In an embodiment of the present application, a response format for responding to a medical consultation request is determined based on the medical consultation request. For example, different medical consultation requests may correspond to different response formats. In an embodiment of the present application, response formats corresponding to various types of medical consultation requests may be pre-set. After receiving a medical consultation request, a response format for the medical consultation request may be determined based on the pre-set format.
[0094] As another example, a response pattern generation model can be pre-trained to generate a response pattern corresponding to a medical consultation request. After receiving a medical consultation request, the medical consultation request can be input into the response pattern generation model to obtain a response pattern output by the response pattern generation model.
[0095] A large amount of medical consultation request data can be collected as training samples, and professional medical staff can mark the response paradigms corresponding to the medical consultation request data as training labels to train the response paradigm generation model. The training process is the same as the training process of the request classification model in the above embodiment. Regarding the specific training process of the response paradigm generation model, technicians in this field can refer to the above records on the request classification model training process, which will not be repeated here. The response paradigm generation model can use a language model, such as a Transformer model, a Bert model, etc., and can also use an open source LLM dialogue system, such as ChatGPT, which is not limited in this embodiment.
[0096] It should also be noted that in the embodiments of the present application, the execution order of step S201 and step S202 is not limited. Step S201 can be executed first, then step S202, or step S202 can be executed first, then step S201, or step S201 and step S202 can be executed simultaneously.
[0097] S203. Generate a consultation response result that meets the response risk level requirements and the response paradigm based on the medical consultation request, consultation intention, and response paradigm.
[0098] The steps in the above embodiment, based at least on the medical consultation request and the consultation intent, generate a consultation response that meets the response risk level requirements corresponding to the consultation intent. Specifically, the steps include: generating a consultation response that meets the response risk level requirements and conforms to the response paradigm based on the medical consultation request, the consultation intent, and the response paradigm. The process for determining the response risk level requirements can be referred to the description in the above embodiment.
[0099] Specifically, after determining the medical consultation request, consultation intention and response paradigm, a consultation response result that meets the response risk level requirements and conforms to the response paradigm can be generated based on the medical consultation request, consultation intention and response paradigm.
[0100] In some embodiments, the steps recorded in the above embodiments can be followed to generate reply content that meets the reply risk level requirements based at least on the medical consultation request and the consultation intention, and then adjust the reply content according to the reply paradigm to obtain a consultation reply result that meets both the reply risk level requirements and the reply paradigm.
[0101] Adjusting the response content according to the response paradigm can also be achieved based on a network model. For example, a content adjustment model can be pre-trained. The training goal of the content adjustment model is to be able to generate consultation responses that conform to the response paradigm based on the input response results and response paradigm.
[0102] Specifically, a large amount of reply content and reply paradigms can be collected as training samples, and then professional medical staff can modify the reply content according to the reply paradigm to obtain training labels. Among them, the training process of the content adjustment model is the same as the training process of the request classification model in the above embodiment. Regarding the specific training process of the content adjustment model, technical personnel in this field can refer to the above-mentioned records on the training process of the request classification model, which will not be repeated here. The content adjustment model can adopt a language model, such as a Transformer model, a Bert model, etc., and can also adopt an open source LLM dialogue system, such as ChatGPT, which is not limited in this embodiment.
[0103] In the above embodiment, a response paradigm for answering medical consultation requests is determined based on the medical consultation requests, so as to output consultation response results that meet both the response risk level requirements and the response paradigm, making the consultation response results clearer, more organized, and more professional.
[0104] As an optional implementation, as shown in FIG3 , another embodiment of the present application discloses that step (S202) of the above embodiment: determining a response paradigm for responding to the medical consultation request based on the medical consultation request may specifically include the following steps:
[0105] S301. Check whether the medical consultation request contains valid information; if the medical consultation request contains valid information, execute step S302; if the medical consultation request does not contain valid information, execute step S303.
[0106] The above-mentioned valid information includes the necessary information for generating a consultation response corresponding to the medical consultation request. Only when this necessary information is included can an accurate consultation response be generated. In other words, if the medical consultation request lacks this information, an accurate consultation response cannot be generated. For example, if the medical consultation request is "What causes headaches?", and the medical consultation request lacks necessary information such as the cause of the headache, the characteristics of the headache, and the duration of the headache, an accurate consultation response cannot be generated.
[0107] Based on this, in an embodiment of the present application, after receiving a medical consultation request, the process can first detect whether the medical consultation request contains valid information. If the medical consultation request contains valid information, step S302 can be executed; if the medical consultation request does not contain valid information, step S303 can be executed.
[0108] S302: Determine the first reply paradigm as the reply paradigm for replying to the medical consultation request.
[0109] The first reply paradigm includes an answer paradigm for replying to a medical consultation request. In this embodiment, if it is determined that the medical consultation request contains valid information, the first reply paradigm can be determined as the reply paradigm for replying to the medical consultation request.
[0110] Specifically, if the medical consultation request contains valid information, it means that an accurate consultation response result can be generated based on the current medical consultation request, so the first response paradigm can be determined as the response paradigm for responding to the medical consultation request.
[0111] An exemplary first reply paradigm may include an analysis statement and a reply statement, wherein the analysis statement is used to analyze the entity object in the medical consultation request, and the reply statement is used to provide a targeted reply to the medical consultation request.
[0112] S303: Determine the second reply paradigm as the reply paradigm for replying to the medical consultation request.
[0113] The second reply paradigm includes a question paradigm for asking for valid information. In this embodiment, when it is determined that the medical consultation request does not contain valid information, the second reply paradigm can be determined as the reply paradigm for replying to the medical consultation request.
[0114] Specifically, if the medical consultation request does not contain valid information, it means that an accurate consultation response result cannot be generated based on the current medical consultation request. Therefore, the second response paradigm can be determined as the response paradigm for responding to the medical consultation request to facilitate further inquiries for valid information.
[0115] In an embodiment of the present application, the questioning paradigm includes question statements that inquire for valid information. Questions can be asked to the user in the form of multiple rounds of questioning to collect the user's reply information to form a medical consultation request. When the medical consultation request contains necessary information, the first reply paradigm is determined as the reply paradigm for replying to the medical consultation request.
[0116] For example, if the medical consultation request is "What causes headaches?", since the medical consultation request lacks necessary information such as the patient's age, gender, duration, cause, feelings, and characteristics, the second response paradigm can generate the following multi-round dialogue (where A is the medical consultation request input by the user, and B is the question sentence generated by the second response paradigm to obtain valid information):
[0117] A: What’s wrong with your headache?
[0118] B: Could you please tell me your age and gender? How long have you had this headache?
[0119] A: Male, 40 years old, it has lasted for more than a month.
[0120] B: Under what circumstances did the headache start? Are there any obvious triggers, such as a headache after catching a cold, after an injury, or after exercise?
[0121] A: After exercise.
[0122] B: What does the pain feel like? For example, throbbing pain, distending pain, stabbing pain, etc.
[0123] A: Bloating and pain.
[0124] B: What are the characteristics of the pain? For example, continuous, paroxysmal, transient, etc.
[0125] A: Continuous pain.
[0126] After this point in the conversation, all necessary information has been collected, and the user's medical consultation request can be responded to in accordance with the first-response paradigm.
[0127] In the above embodiments, in the absence of valid information, the user can be proactively queried to enrich the content of the medical consultation request, determine the necessary information for generating a consultation response result corresponding to the medical consultation request, and ensure the accuracy of the consultation response result.
[0128] As an optional implementation, another embodiment of the present application discloses that the first reply paradigm of the above embodiment includes an analysis statement, a reply statement, and a medical advice statement;
[0129] Among them, the analysis statement includes a statement for analyzing the entity object corresponding to the medical consultation request, the reply statement includes a statement for replying to the medical consultation request, and the medical advice statement includes a statement for advising the user to seek professional medical assistance.
[0130] The entity objects corresponding to the medical consultation request include entity objects extracted from the medical consultation request statement, which may include the drug name, disease type and other content in the medical consultation request; and also include entity objects determined based on the medical consultation request, which may include the drug name, disease type and other content determined based on the medical consultation request.
[0131] An analysis statement refers to the analysis of relevant medical knowledge about an entity object. If the entity object is a drug, the analysis statement may include the drug name, indications, instructions for use, and contraindications. If the entity object is a disease, the analysis statement may include symptoms and pathogenic mechanisms. If the entity object is a surgical procedure, the analysis statement may include surgical details and duration.
[0132] For example, if the medical consultation request is "Can I take berberine for acute gastroenteritis?", the entity objects are "acute gastroenteritis" and "berberine". The generated analysis statements can include analysis statements for "acute gastroenteritis" and "berberine", for example:
[0133] "Acute gastroenteritis is a common digestive system disease, usually caused by infections such as viruses, bacteria, and parasites. Berberine is a traditional Chinese medicine that has the effects of clearing heat and detoxifying, and having antibacterial and anti-inflammatory effects."
[0134] For another example, if the medical consultation request is "A 40-year-old male has persistent headaches after exercise for a month. What should I do?", and the user is determined to have a migraine based on the medical consultation request, then the entity object determined based on the medical consultation request is "migraine", and the generated analysis statement may include an analysis statement for "migraine", for example:
[0135] "Migraine is a common neurological disease characterized by recurrent headaches, often accompanied by nausea, vomiting, and sensitivity to light, smell, and sound. The cause of migraine is still unclear, but may be related to genetics, neurotransmitters, vasodilation, and other factors."
[0136] The reply statement includes a statement that responds to a medical consultation request, and mainly includes the answer to the medical question in the medical consultation request. For example, if the medical consultation request is "Can I take berberine for acute gastroenteritis?", the reply statement can be:
[0137] "For patients with acute gastroenteritis, if the symptoms are mild, berberine can be tried."
[0138] For example, if the medical consultation request is "A 40-year-old man has persistent headaches after exercise for a month. What should I do?", the response statement could be:
[0139] “Avoid triggering factors: Migraine attacks are often related to factors such as diet, sleep, and environment. Reducing stimuli can alleviate migraine attacks.
[0140] Medication: Painkillers, anti-inflammatory drugs, trigeminal nerve blockers and other drugs can be used to relieve headaches.
[0141] Relaxation training: Deep breathing, progressive muscle relaxation training and other methods can help relieve headaches caused by tension and muscle tension.
[0142] Traditional Chinese Medicine treatment: Acupuncture, acupoint massage and other traditional Chinese medicine methods can effectively relieve migraine symptoms.
[0143] Lifestyle adjustments: Maintaining a regular schedule, exercising moderately, avoiding excessive fatigue, etc. can help reduce the incidence of migraines.
[0144] In short, the treatment of migraine needs to take into account the patient's specific situation and choose the appropriate method to relieve symptoms."
[0145] Medical advice statements include statements that advise users to seek professional medical assistance, in order to prompt users to seek medical treatment in a timely manner and ensure their physical health.
[0146] For example, if the medical consultation request is "Can I take berberine for acute gastroenteritis?", the entity objects are "acute gastroenteritis" and "berberine", and the generated medical advice statements may include:
[0147] "For patients with severe symptoms such as high fever, vomiting, and diarrhea, it is recommended to seek medical attention promptly and use appropriate medication according to the doctor's advice. In addition, berberine also has some adverse reactions, such as dizziness, nausea, vomiting, and diarrhea. When using it, you should pay attention to observe the patient's reaction and seek medical attention immediately if you feel uncomfortable."
[0148] For example, if the medical consultation request is "A 40-year-old man has persistent headaches after exercise for a month. What should I do?", the generated medical advice statements may include:
[0149] "Please note that the quality of the relevant drugs needs to be taken under the guidance of a doctor. If the symptoms worsen or other discomfort occurs, please seek medical attention in time. In addition, the possibility of brain tumors, intracranial infections and other diseases cannot be ruled out, and further examination is required to confirm the diagnosis. Therefore, it is recommended that patients go to the neurology department for a clear diagnosis and treatment plan."
[0150] In the above embodiment, it is stipulated that the reply paradigm may include an analysis statement, a reply statement, and a medical advice statement, so as to make the consultation reply result clearer, more organized, and more professional.
[0151] As an optional implementation, another embodiment of the present application discloses that, based on a medical consultation request, both the consultation intent to which the medical consultation request belongs and the response paradigm for responding to the medical consultation request can be determined. Specifically, the following steps may be included:
[0152] Inputting the medical consultation request into a pre-trained intent classification model so that the intent classification model determines, based on the medical consultation request, the consultation intent to which the medical consultation request belongs and determines a response paradigm for answering the medical consultation request;
[0153] The intent classification model is trained using sample medical consultation requests as training samples, with the goal of predicting the consultation intent corresponding to the sample medical consultation requests and predicting the response paradigm used to answer the sample medical consultation requests.
[0154] Specifically, in the embodiment of the present application, an intent classification model is pre-trained, and the training goal of the intent classification model is to be able to predict the consultation intention corresponding to the sample medical consultation request, and to predict the response paradigm for answering the sample medical consultation request.
[0155] A large amount of sample medical consultation request data can be collected as training samples, and professionals, such as medical staff, can annotate the consultation intent and response paradigms corresponding to the sample medical consultation requests to obtain training labels. In some embodiments, the sample medical consultation requests include sample medical consultation requests containing valid information and sample medical consultation requests containing no valid information. When annotating the response paradigms, professionals can annotate sample medical consultation requests containing valid information according to the first response paradigm, and annotate sample medical consultation requests containing no valid information according to the second response paradigm.
[0156] The intent classification model is trained using training samples and training labels. The training process for the intent classification model is the same as the training process for the request classification model in the above embodiment. For the specific training process of the intent classification model, those skilled in the art can refer to the above-mentioned description of the request classification model training process, which will not be described here. The intent classification model can use a language model, such as a Transformer model, a Bert model, etc., which is not limited in this embodiment.
[0157] In the above embodiments, the consultation intention and the response paradigm can be determined simultaneously based on the pre-trained intention classification model, with high speed and reliability.
[0158] As an optional implementation, another embodiment of the present application discloses the steps of the above embodiment: generating a consultation response result that meets the response risk level requirements and conforms to the response paradigm based on the medical consultation request, consultation intent, and response paradigm, which may specifically include the following steps:
[0159] The medical consultation request, consultation intention and response paradigm are input into a pre-trained consultation response result generation model so that the consultation response result generation model determines the response risk level requirement corresponding to the consultation intention, and generates a consultation response result that meets the response risk level requirements and the response paradigm based on the medical consultation request, consultation intention, response paradigm and response risk level requirements.
[0160] The consultation response result generation model is obtained by supervised training and reinforcement training using sample medical consultation requests, as well as sample consultation intentions and sample response paradigms corresponding to the sample medical consultation requests as training samples.
[0161] Among them, supervised training at least aims to predict the consultation response results that meet the sample response paradigm; intensive training at least aims to predict the consultation response results that meet the response risk level requirements of the sample consultation intention.
[0162] Specifically, supervised training refers to training with training labels. The goal of supervised training is to enable the inquiry response generation model to predict inquiry response results that conform to the sample response paradigm. Professionals can label inquiry response results that conform to the sample response paradigm based on training samples to obtain training labels. This allows for supervised training of the inquiry response generation model based on the training samples and these training labels.
[0163] In addition, when professionals label consultation response results that conform to the sample response paradigm based on training samples, they need to label the correct consultation response results as training labels according to medical common sense to avoid the consultation response result generation model outputting consultation response results that conform to the sample response paradigm but do not conform to medical common sense.
[0164] In some embodiments, the supervised training objective also includes enabling the consultation response result generation model to predict consultation response results that meet the response risk level requirements of the sample consultation intent. When professionals label consultation response results that meet the sample response paradigm based on training samples, they can also only label consultation response results that meet the response risk level requirements as training labels, thereby facilitating supervised training of the consultation response result generation model based on the training samples and the training labels.
[0165] Specifically, the training objectives of intensive training include enabling the consultation response result generation model to predict consultation response results that meet the response risk level requirements of the sample consultation intent. The consultation response result generation model can generate multiple consultation response results, and then professionals can score each consultation response result based on the response risk level requirements. For example, results that meet the response risk level requirements can be given high scores, while results that do not meet the response risk level requirements can be given low scores. Based on the scores of each consultation response result, feedback adjustments are made to the consultation response result generation model to achieve the purpose of intensive training.
[0166] In some embodiments, the training goal of intensive training also includes enabling the consultation response result generation model to predict consultation response results that conform to the sample response paradigm. The consultation response result generation model can be enabled to generate multiple consultation response results, and then professionals can score each consultation response result based on whether the consultation response result conforms to the sample response paradigm. For example, consultation response results that conform to the sample response paradigm can be scored high, while consultation response results that do not conform to the sample response paradigm can be scored low. Feedback adjustment is performed on the consultation response result generation model based on the scores of each consultation response result to achieve the purpose of intensive training.
[0167] The above-mentioned consultation response result generation model can adopt a language model, such as a Transformer model, a Bert model, etc., and can also adopt an open source LLM dialogue system, such as ChatGPT, which is not limited in this embodiment.
[0168] As an optional implementation, as shown in FIG4 , another embodiment of the present application discloses that supervised training is used to predict consultation response results that conform to the sample response paradigm. The supervised training process may specifically include the following steps:
[0169] S401: Input the training sample into the pre-trained dialogue generation model to obtain the response data generated by the dialogue generation model.
[0170] The above-mentioned dialogue generation model is a model that can generate corresponding answers based on questions. The dialogue generation model can be implemented by calling an open source LLM dialogue system, such as ChatGPT, which is not limited in this embodiment.
[0171] The training samples of the above embodiment, including the sample medical consultation request, and the sample consultation intention and sample response paradigm corresponding to the sample medical consultation request, are input into the dialogue generation model to obtain the response data generated by the dialogue generation model, so as to construct a supervised training training label based on the response data generated by the dialogue generation model.
[0172] S402: Obtain the corrected data after adjusting the reply data.
[0173] The aforementioned adjustment process includes adjusting the response data that does not conform to medical common sense or sample response patterns. Generally, professional personnel, such as professional medical staff, will adjust the response data that does not conform to medical common sense or sample response patterns.
[0174] The response data output by the dialogue generation model cannot be directly used as training labels because the dialogue generation model has not undergone targeted training. The response data may not conform to medical common sense or the requirements of the response paradigm. Therefore, the response data needs to be adjusted and processed. The response data that does not conform to medical common sense and the sample response paradigm needs to be adjusted, and then the corrected data after the adjustment of the response data is obtained.
[0175] S403: Determine the corrected data as a training label, and use the training samples and the training label to perform consultation response generation training on the consultation response result generation model.
[0176] The corrected data obtained in the above steps can be determined as training labels. Based on the training samples and training labels, supervised training is performed on the consultation response result generation model to achieve the training goal of enabling the consultation response result generation model to predict consultation response results that conform to the sample response paradigm.
[0177] In the embodiment of the present application, the method of constructing training labels for supervised training using the response data generated by the dialogue generation model is faster and more efficient than the method of professionals writing training labels themselves.
[0178] As an optional implementation, as shown in FIG5 , another embodiment of the present application discloses that intensive training is performed with the goal of predicting consultation response results that meet the response risk level requirements of the sample consultation intention. The training process of the intensive training may specifically include the following steps:
[0179] S501. Input the training sample into the consultation reply result generation model to obtain multiple consultation reply results output by the consultation reply result generation model.
[0180] The training samples of the above embodiment, including the sample medical consultation request, and the sample consultation intention and sample response paradigm corresponding to the sample medical consultation request, are input into the consultation response result generation model to obtain multiple consultation response results generated by the consultation response result generation model.
[0181] S502: Obtain labeled data after labeling multiple consultation response results corresponding to the training samples.
[0182] The above-mentioned labeling process includes labeling the response risk level of multiple consultation response results. Generally, professional personnel, such as professional medical staff, label each consultation response result. For example, results that meet the response risk level requirements can be labeled as high, and results that do not meet the response risk level requirements can be labeled as low.
[0183] S503: Using the labeled data, the consultation response generation model is trained to generate consultation responses.
[0184] Feedback adjustment is performed on the consultation response result generation model based on the labeled data of each consultation response result, so as to achieve the training goal of enabling the consultation response result generation model to predict the consultation response results that meet the response risk level requirements of the sample consultation intention.
[0185] In the above embodiments, by intensively training the consultation response result generation model, the consultation response result generation model can display consultation response results that meet the response risk level requirements to the user, avoiding misleading the user into using high-risk medications and treatment methods, and ensuring that the user's physical health is not affected.
[0186] In some embodiments, a proximal policy optimization (PPO) algorithm may be used to perform intensive training on the consultation response result generation model, which is not limited in this embodiment.
[0187] In some embodiments, the consultation intention includes at least one of consultation on a disease, consultation on symptoms, consultation on medication, and consultation on surgery;
[0188] Consultation diseases include at least one of the following: disease concept, disease cause, and disease treatment department;
[0189] Consultation symptoms include at least one of the following: symptom cause, symptom severity, and symptom management measures;
[0190] Medication consultation includes at least one of the following: medication type, medication method, medication time, and medication precautions;
[0191] Surgery consultation includes at least one of whether surgery is needed, surgical method, surgical precautions, and surgical complications.
[0192] In a specific embodiment, an intent classification model and a consultation response result generation model are used to analyze medical consultation requests and generate consultation response results that meet the response risk level requirements and conform to the response paradigm.
[0193] In the embodiment shown in FIG6 , before training the intention classification model and the consultation response result generation model, training data is first constructed.
[0194] Specifically, a large number of sample medical consultation requests may be obtained first, and the consultation intention and response paradigm corresponding to each sample medical consultation request may be marked.
[0195] The sample medical consultation requests, the consultation intentions corresponding to the sample medical consultation requests, and the response paradigm are input into the dialogue generation model to obtain the response data generated by the dialogue generation model.
[0196] Professionals modify the response data to obtain revised data that conforms to medical common sense and meets the requirements of the response paradigm.
[0197] Then, the sample medical consultation requests, the consultation intentions and response paradigms corresponding to the sample medical consultation requests, and the correction data are stored in the database.
[0198] Sample medical consultation requests, the consultation intent and response paradigm corresponding to each sample medical consultation request are retrieved from the database to train the intent classification model, so that the intent classification model can predict the consultation intent and response paradigm corresponding to the medical consultation request based on the medical consultation request.
[0199] Sample medical consultation requests, the consultation intentions and response paradigms corresponding to each sample medical consultation request, and correction data are retrieved from the database to perform supervised training on the consultation response result generation model, so that the consultation response result generation model can predict the consultation response results that conform to the sample response paradigm based on the medical consultation requests, the consultation intentions and response paradigms corresponding to the medical consultation requests.
[0200] Then, the consultation response result generation model is intensively trained so that it can output multiple candidates. Each candidate is manually labeled and scored based on whether it meets the response risk level requirements, and the consultation response result generation model is adjusted based on the labeling and scoring results.
[0201] Once the intent classification model and consultation response generation model are trained, they can be used to respond to medical consultation requests. Specifically, after receiving a medical consultation request, the medical consultation request can be first fed into the intent classification model, which then determines the consultation intent and response paradigm. The medical consultation request, consultation intent, and response paradigm are then fed into the consultation response generation model. The model then generates a consultation response that meets the response risk level requirements and conforms to the response paradigm.
[0202] For example, if a medical consultation request is "Why do I have palpitations and how can I treat them?", the medical consultation request can be first fed into the intent classification model. This model can then determine that the medical consultation request's intent is to consult about a disease. The response paradigm includes an analysis statement, a response statement, and a medical advice statement. The medical consultation request, consultation intent, and response paradigm are fed into the consultation response result generation model, resulting in the following consultation response:
[0203] Palpitations may be caused by a variety of reasons, such as heart disease, anemia, psychological stress, etc. To treat palpitations, you need to first determine the cause and then treat it accordingly.
[0204] If the palpitations are caused by heart disease, heart disease treatment is required, such as medication, surgery, etc.
[0205] If the palpitations are caused by anemia, you need to supplement nutrients such as iron and vitamin B12 to increase the number of red blood cells in the blood.
[0206] If the palpitations are caused by psychological stress, you can use some relaxation techniques, such as deep breathing, yoga, meditation, etc., to relieve tension.
[0207] In short, to treat palpitations, you need to first determine the cause, and then take appropriate treatment measures based on the specific situation. It is recommended to seek medical attention promptly to avoid delaying the condition.
[0208] The above consultation response results do not contain any drugs or treatments that may affect the user's physical health, and meet the response paradigm requirements.
[0209] Corresponding to the above-mentioned consultation reply result generation method, the embodiment of the present application further discloses a consultation reply result generation device, as shown in FIG7 , which includes:
[0210] A determination module 100 is configured to determine, based on the medical consultation request, the consultation intention to which the medical consultation request belongs;
[0211] The generation module 110 is used to generate a consultation response result that meets the response risk level requirements corresponding to the consultation intention based on at least the medical consultation request and the consultation intention.
[0212] As an optional implementation, another embodiment of the present application discloses that the determination module 100 is further configured to determine, based on the medical consultation request, a reply paradigm for responding to the medical consultation request, where the reply paradigm represents a sentence structure of a consultation reply result;
[0213] The generation module 110 of the above embodiment, when generating a consultation response result that meets the response risk level requirements corresponding to the consultation intent based on at least the medical consultation request and the consultation intent, is specifically used to:
[0214] Based on the medical consultation request, consultation intention and response paradigm, generate a consultation response result that meets the response risk level requirements and complies with the response paradigm.
[0215] As an optional implementation, another embodiment of the present application discloses that the determination module 100 of the above embodiment, when determining a response paradigm for responding to a medical consultation request based on the medical consultation request, is specifically configured to:
[0216] Detect whether the medical consultation request contains valid information; valid information includes necessary information for generating a consultation response result corresponding to the medical consultation request; if the medical consultation request contains valid information, determine the first response paradigm as the response paradigm for replying to the medical consultation request, and the first response paradigm includes the answer paradigm for replying to the medical consultation request; if the medical consultation request does not contain valid information, determine the second response paradigm as the response paradigm for replying to the medical consultation request, and the second response paradigm includes a question paradigm for inquiring for valid information.
[0217] As an optional implementation, another embodiment of the present application discloses that the first reply paradigm includes an analysis statement and a reply statement;
[0218] The analysis statement includes a statement for analyzing the entity object in the medical consultation request, and the reply statement includes a statement for replying to the medical consultation request.
[0219] As an optional implementation method, the first reply paradigm also includes a medical advice statement, and the medical advice statement includes a statement suggesting that the user seek professional medical assistance.
[0220] As an optional implementation, another embodiment of the present application discloses that the determination module 100 of the above embodiment, when determining the consultation intent to which the medical consultation request belongs based on the medical consultation request and determining the response paradigm for responding to the medical consultation request, is specifically configured to:
[0221] The medical consultation request is input into a pre-trained intent classification model, so that the intent classification model determines the consultation intent to which the medical consultation request belongs based on the medical consultation request, and determines a response paradigm for answering the medical consultation request, wherein:
[0222] The intent classification model is trained using sample medical consultation requests as training samples, with the goal of predicting the consultation intent corresponding to the sample medical consultation requests and predicting the response paradigm used to answer the sample medical consultation requests.
[0223] As an optional implementation, another embodiment of the present application discloses that the generation module 110 of the above embodiment, when generating a consultation response result that meets the response risk level requirements and conforms to the response paradigm based on the medical consultation request, consultation intent, and response paradigm, is specifically used to:
[0224] Inputting the medical consultation request, consultation intent, and response paradigm into a pre-trained consultation response result generation model, so that the consultation response result generation model determines the response risk level requirement corresponding to the consultation intent, and generates a consultation response result that meets the response risk level requirement and the response paradigm based on the medical consultation request, consultation intent, response paradigm, and response risk level requirement, wherein the consultation response result generation model is obtained by supervised training and reinforcement training using sample medical consultation requests, and sample consultation intents and sample response paradigms corresponding to the sample medical consultation requests as training samples;
[0225] Among them, supervised training at least aims to predict the consultation response results that meet the sample response paradigm; intensive training at least aims to predict the consultation response results that meet the response risk level requirements of the sample consultation intention.
[0226] As an optional implementation, another embodiment of the present application discloses that the generation module 110, when performing supervised training, is specifically configured to:
[0227] The training samples are input into a pre-trained dialogue generation model to obtain the response data generated by the dialogue generation model; the corrected data after the response data is adjusted is obtained, and the adjustment processing includes adjusting the response data in the response data that does not conform to medical common sense and does not conform to the sample response paradigm; the corrected data is determined as a training label, and the training samples and training labels are used to train the consultation response result generation model to generate consultation responses.
[0228] As an optional implementation, another embodiment of the present application discloses that the generation module 110, when performing intensive training, is specifically configured to:
[0229] Input the training samples into the consultation response result generation model to obtain multiple consultation response results output by the consultation response result generation model; obtain the labeled data after the multiple consultation response results corresponding to the training samples are labeled, and the labeling processing includes labeling the response risk level of the multiple consultation response results; use the labeled data to train the consultation response result generation model to generate consultation responses.
[0230] As an optional implementation method, the generation module 110 is used to: determine the response risk level requirements corresponding to the consultation intention according to preset rules; and generate a consultation response result that meets the response risk level requirements based on the medical consultation request, consultation intention and response risk level requirements.
[0231] As an optional implementation, generation module 110 is configured to input the medical consultation request, consultation intent, and response risk level requirements into a first question-and-answer model, so that the first question-and-answer model generates a consultation response that meets the response risk level requirements. The first question-and-answer model is trained using the medical consultation request data, the consultation intent corresponding to the medical consultation request data, and the response risk level requirements corresponding to the medical consultation request data as training samples, and using standard responses corresponding to the medical consultation request data as training labels.
[0232] As an optional implementation method, the generation module 110 is used to: generate multiple candidate consultation response results based on the medical consultation request and consultation intention; and select the candidate consultation response result that meets the response risk level requirements from multiple candidate consultation response results as the consultation response result based on the response risk level requirements.
[0233] As an optional implementation, generation module 110 is configured to input the medical consultation request and consultation intent into a second question-answering model, and output multiple candidate consultation responses from the second question-answering model. The second question-answering model is trained using the medical consultation request data and the consultation intent corresponding to the medical consultation request data as training samples, and using multiple responses corresponding to the medical consultation request data as training labels.
[0234] As an optional implementation, generation module 110 is configured to input multiple candidate consultation response results into a risk classification model to obtain a risk level corresponding to each candidate consultation response result. Based on the risk level corresponding to each candidate consultation response result in the multiple candidate consultation response results, a consultation response result that meets the response risk level requirements is selected from the multiple candidate consultation response results.
[0235] As an optional implementation method, the generation module 110 is used to: input the response risk level requirement and multiple candidate consultation response results into the risk classification model, and obtain the consultation response result output by the risk classification model that meets the response risk level requirement.
[0236] As an optional implementation, another embodiment of the present application discloses that the consultation intention of the above embodiment includes at least one of consultation on disease, consultation on symptoms, consultation on medication, and consultation on surgery;
[0237] Consultation diseases include at least one of the following: disease concept, disease cause, and disease treatment department;
[0238] Consultation symptoms include at least one of the following: symptom cause, symptom severity, and symptom management measures;
[0239] Medication consultation includes at least one of the following: medication type, medication method, medication time, and medication precautions;
[0240] Surgery consultation includes at least one of whether surgery is needed, surgical method, surgical precautions, and surgical complications.
[0241] Specifically, for the specific working contents of each module of the above-mentioned consultation reply result generating device, please refer to the contents of the above-mentioned method embodiment, which will not be repeated here.
[0242] An embodiment of the present application further provides a control device, which includes a processor and an interface circuit. The processor in the control device is connected to an input and output component through the interface circuit of the control device.
[0243] The input and output components specifically refer to hardware components that enable users to input information and output information to users, such as microphones, keyboards, handwriting tablets, touch screens, displays, speakers, printers, etc.
[0244] The above-mentioned interface circuit can be any interface circuit that can realize data communication function, for example, it can be a USB interface circuit, a Type-C interface circuit, a serial port circuit, a PCIE circuit, etc.
[0245] The processor in the control device is a circuit with signal processing capability, which executes any one of the consultation reply result generation methods introduced in the above embodiments.
[0246] When the control device is applied to a device with human-computer interaction function, the input and output components of the control device can be the input components and output components on the device, such as a microphone, keyboard, handwriting tablet, touch screen, display, audio player, etc. At the same time, the processor of the control device can be the CPU or GPU of the device, etc., and the interface circuit of the control device can be the interface circuit between the information input component of the device and the processor such as the CPU or GPU.
[0247] Corresponding to the above-mentioned method for generating a consultation reply result, an embodiment of the present application further discloses an electronic device, as shown in FIG8 , comprising:
[0248] Memory 200 and processor 210;
[0249] The memory 200 is connected to the processor 210 and is used to store programs;
[0250] The processor 210 is configured to implement the consultation reply result generating method disclosed in any of the above embodiments by running the program stored in the memory 200 .
[0251] Specifically, the electronic device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .
[0252] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are interconnected via a bus.
[0253] A bus may include a pathway that transfers information between components of a computer system.
[0254] Processor 210 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, or the like, or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component.
[0255] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0256] The memory 200 stores a program for executing the technical solution of the present application, and may also store an operating system and other key services. Specifically, the program may include program code, and the program code includes computer operating instructions. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, disk storage, flash, etc.
[0257] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0258] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speakers, etc.
[0259] The communication interface 220 may include any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0260] The processor 210 executes the program stored in the memory 200 and calls other devices, which can be used to implement the various steps of the consultation response result generation method provided in the above embodiment of the present application.
[0261] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions. When the computer program instructions are executed by a processor, the processor executes the various steps of the consultation response result generation method provided in the above-mentioned embodiment.
[0262] The computer program product may be written in any combination of one or more programming languages to implement the program code of the embodiments of the present application, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0263] In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes each step of the consultation response result generation method provided in the above embodiment.
[0264] The computer-readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0265] For the sake of simplicity, the aforementioned method embodiments are described as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required for this application.
[0266] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between the various embodiments can be referred to in conjunction with each other. For device embodiments, since they are generally similar to method embodiments, their description is relatively simplified. For relevant parts, refer to the description of the method embodiments.
[0267] The steps in the methods of each embodiment of the present application can be adjusted in sequence, merged, and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0268] The modules and sub-modules in the devices and terminals in the various embodiments of the present application can be merged, divided, and deleted according to actual needs.
[0269] In the several embodiments provided in this application, it should be understood that the disclosed terminals, devices, and methods can be implemented in other ways. For example, the terminal embodiments described above are merely illustrative. For example, the division of modules or submodules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or module, which can be electrical, mechanical or other forms.
[0270] The modules or submodules described as separate components may or may not be physically separate, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules may be selected to achieve the purpose of this embodiment according to actual needs.
[0271] In addition, each functional module or submodule in each embodiment of the present application may be integrated into a processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into a single module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or software functional modules or submodules.
[0272] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0273] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, software units executed by a processor, or a combination of the two. The software units may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.
[0274] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0275] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating consultation response results, characterized in that: include: Based on the medical consultation request, determining the consultation intention to which the medical consultation request belongs; At least based on the medical consultation request and the consultation intention, generate a consultation response result that meets the response risk level requirements corresponding to the consultation intention.
2. The method according to claim 1, characterized in that Also includes: Based on the medical consultation request, a reply paradigm for answering the medical consultation request is determined, wherein the reply paradigm represents a sentence structure of the consultation reply result, wherein: The step of generating a consultation response result that meets the response risk level requirement corresponding to the consultation intention at least according to the medical consultation request and the consultation intention includes: According to the medical consultation request, the consultation intention and the response paradigm, the consultation response result that meets the response risk level requirements and complies with the response paradigm is generated.
3. The method according to claim 2, characterized in that The step of determining a response paradigm for answering the medical consultation request based on the medical consultation request includes: Detecting whether the medical consultation request contains valid information; the valid information includes necessary information for generating the consultation response result corresponding to the medical consultation request; If the medical consultation request contains the valid information, determining a first reply paradigm as a reply paradigm for replying to the medical consultation request, wherein the first reply paradigm includes an answer paradigm for replying to the medical consultation request; If the medical consultation request does not include the valid information, a second response paradigm is determined as a response paradigm for responding to the medical consultation request, and the second response paradigm includes a question paradigm for inquiring about the valid information.
4. The method according to claim 3, characterized in that The first response paradigm includes analysis sentences and response sentences; The analysis statement includes a statement for analyzing the entity object corresponding to the medical consultation request, and the reply statement includes a statement for replying to the medical consultation request.
5. The method according to claim 4, characterized in that The first reply paradigm also includes a medical advice statement, and the medical advice statement includes a statement advising the user to seek professional medical assistance.
6. The method according to any one of claims 2 to 5, characterized in that Based on the medical consultation request, determining the consultation intention to which the medical consultation request belongs, and determining the response paradigm for answering the medical consultation request, including: The medical consultation request is input into a pre-trained intent classification model, so that the intent classification model determines the consultation intent to which the medical consultation request belongs based on the medical consultation request, and determines the response paradigm for answering the medical consultation request, wherein: The intention classification model is trained using sample medical consultation requests as training samples, with the goal of predicting the consultation intention corresponding to the sample medical consultation requests and predicting the response paradigm used to answer the sample medical consultation requests.
7. The method according to any one of claims 2 to 6, characterized in that The step of generating the consultation response result that meets the response risk level requirement and the response paradigm according to the medical consultation request, the consultation intention and the response paradigm includes: The medical consultation request, the consultation intention and the response paradigm are input into a pre-trained consultation response result generation model, so that the consultation response result generation model determines the response risk level requirement corresponding to the consultation intention, and generates a consultation response result that meets the response risk level requirement and the response paradigm according to the medical consultation request, the consultation intention, the response paradigm and the response risk level requirement, wherein: The consultation response result generation model is obtained by conducting supervised training and reinforcement training using sample medical consultation requests, sample consultation intentions corresponding to the sample medical consultation requests, and sample response paradigms as training samples; Wherein, the supervised training at least takes the prediction of the consultation response results that conform to the sample response paradigm as the training goal; The intensive training at least aims to predict the consultation response results that meet the response risk level requirements of the sample consultation intention.
8. The method according to claim 7, characterized in that The training process of the supervised training includes: Inputting the training sample into a pre-trained dialogue generation model to obtain response data generated by the dialogue generation model; Acquire corrected data after adjusting the reply data, wherein the adjustment processing includes adjusting the reply data that does not conform to medical common sense and does not conform to the sample reply paradigm; The correction data is determined as a training label, and the consultation response generation model is trained to generate consultation responses using the training samples and the training labels.
9. The method according to claim 7 or 8, characterized in that: The training process of the intensive training includes: Inputting the training sample into the consultation reply result generation model to obtain a plurality of consultation reply results output by the consultation reply result generation model; Acquire annotated data after annotating the plurality of consultation reply results corresponding to the training samples, wherein the annotating process includes annotating the plurality of consultation reply results with a reply risk level; The labeled data is used to train the consultation response generation model.
10. The method according to claim 1, characterized in that The step of generating a consultation response result that meets the response risk level requirement corresponding to the consultation intention at least according to the medical consultation request and the consultation intention includes: Determine the response risk level requirement corresponding to the consultation intention according to preset rules; Based on the medical consultation request, the consultation intention and the response risk level requirement, the consultation response result that meets the response risk level requirement is generated.
11. The method according to claim 10, characterized in that The generating, based on the medical consultation request, the consultation intention and the response risk level requirement, the consultation response result that meets the response risk level requirement includes: The medical consultation request, the consultation intention and the response risk level requirement are input into the first question-answering model, so that the first question-answering model generates the consultation response result that meets the response risk level requirement, The first question-answering model is trained using medical consultation request data, the consultation intent corresponding to the medical consultation request data, and the response risk level requirements corresponding to the medical consultation request data as training samples, and using the standard responses corresponding to the medical consultation request data as training labels.
12. The method according to claim 10, characterized in that The generating, based on the medical consultation request, the consultation intention and the response risk level requirement, the consultation response result that meets the response risk level requirement includes: Generate multiple candidate consultation response results according to the medical consultation request and the consultation intention; According to the response risk level requirement, a candidate consultation response result that meets the response risk level requirement is selected from the multiple candidate consultation response results as the consultation response result.
13. The method according to claim 12, characterized in that The generating a plurality of candidate consultation response results according to the medical consultation request and the consultation intention includes: Inputting the medical consultation request and the consultation intention into a second question-answering model to obtain the plurality of candidate consultation response results output by the second question-answering model, The second question-answering model is trained by using medical consultation request data and the consultation intentions corresponding to the medical consultation request data as training samples, and using multiple responses corresponding to the medical consultation request data as training labels.
14. The method according to claim 12 or 13, characterized in that The step of selecting, according to the response risk level requirement, a candidate consultation response result that meets the response risk level requirement from the multiple candidate consultation response results as the consultation response result includes: Input the plurality of candidate consultation response results into a risk classification model to obtain a risk level corresponding to each candidate consultation response result in the plurality of candidate consultation response results, According to the risk level corresponding to each candidate consultation response result in the plurality of candidate consultation response results, The consultation response result that meets the response risk level requirement is selected from the candidate consultation response results.
15. The method according to claim 12 or 13, characterized in that The step of selecting, according to the response risk level requirement, a candidate consultation response result that meets the response risk level requirement from the multiple candidate consultation response results as the consultation response result includes: The response risk level requirement and the multiple candidate consultation response results are input into a risk classification model to obtain the consultation response result output by the risk classification model that meets the response risk level requirement.
16. The method according to any one of claims 1 to 15, characterized in that The consultation intention includes at least one of consultation on disease, consultation on symptoms, consultation on medication, and consultation on surgery; The consultation disease includes at least one of the disease concept, disease cause, and disease treatment department; The consultation symptoms include at least one of the causes of the symptoms, the severity of the symptoms, and the measures to deal with the symptoms; The medication consultation includes at least one of the medication type, medication method, medication time, and medication precautions; The surgical consultation includes at least one of whether surgery is needed, surgical method, surgical precautions, and surgical complications.
17. A consultation response result generating device, characterized in that: include: A determination module, configured to determine, based on the medical consultation request, the consultation intention to which the medical consultation request belongs; A generation module is used to generate a consultation response result that meets the response risk level requirements corresponding to the consultation intention based on at least the medical consultation request and the consultation intention.
18. The device according to claim 17, characterized in that The determining module is also used for: Based on the medical consultation request, determining a reply paradigm for answering the medical consultation request, wherein the reply paradigm represents a sentence structure of the consultation reply result; The generation module is used to generate the consultation response result that meets the response risk level requirements and complies with the response paradigm based on the medical consultation request, the consultation intention and the response paradigm.
19. An electronic device, characterized in that: include: Memory and processor; Wherein, the memory is used to store programs; The processor is configured to implement the method according to any one of claims 1 to 16 by running the program in the memory.
20. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 16 is implemented.
Citation Information
Patent Citations
Method and device for pushing information
CN106789595A
Medical consultation method, device and equipment and computer readable storage medium
CN111063429A
Intelligent question answering method and device based on medical knowledge graph
CN113505243A
Medical risk information pushing method and device based on machine learning
CN113724878A
Method, system, device and medium for automatically replying medical consultation
CN114999676A
Cited By
Medical question and answer method and system based on multi-agent cooperation
CN120853998A
