Medication query method and device, electronic equipment, storage medium and product
By integrating information and identifying current drug use problems with historical dialogue information, and integrating knowledge inference with drug knowledge base, the problems of low efficiency and insufficient accuracy of traditional drug use query are solved, and more efficient and accurate drug use query results are achieved.
Patent Information
- Application Number
- CN202510029393.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-05-27
AI Technical Summary
In traditional medical models, drug use inquiry is inefficient and limited in accuracy. Doctors work hard and long-term work may affect the accuracy of drug use inquiry.
By integrating the obtained current drug use problems with historical dialogue information, identifying intentions, combining knowledge integration and reasoning with the pre-constructed drug knowledge base, the results of drug use query are automatically determined.
It improves the efficiency and accuracy of drug use query, combines user characteristics, drug use information and disease information, and enhances the accuracy of knowledge integration reasoning.
Smart Images

Figure CN120048553A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of natural language processing, and particularly relates to a medication query method, device, electronic device, storage medium, and product. Background Art
[0002] In the field of medical health, medication query is an important link. For example, querying medication knowledge, querying medication advice, or medication recommendation, etc. The traditional medical model mainly relies on patients to actively seek help from doctors, relying on doctors' professional knowledge and experience. Doctors provide feedback on medication knowledge, or provide medication advice or drug recommendations to patients. However, in most cases, it is necessary to communicate face-to-face with doctors, resulting in low efficiency of medication query, and the workload of doctors is relatively large. Working for a long time may affect the accuracy of medication query. Summary of the Invention
[0003] Based on the above requirements, this application proposes a medication query method, device, electronic device, storage medium, and product, which can improve the efficiency and accuracy of medication query.
[0004] To achieve the above object, this application proposes the following technical solutions:
[0005] According to the first aspect of the embodiments of this application, a medication query method is provided, including:
[0006] Fusing the obtained current medication problem with historical conversation information to obtain medication query information corresponding to the current medication problem;
[0007] Identifying the intention of the medication query information to determine the intention type to which the medication query information belongs;
[0008] Based on the intention type, the medication query information, and a pre-constructed medication knowledge base, performing knowledge integration and reasoning to determine the medication query result corresponding to the current medication problem.
[0009] Optionally, based on the intention type, the medication query information, and a pre-constructed medication knowledge base, performing knowledge integration and reasoning to determine the medication query result corresponding to the current medication problem, including:
[0010] Based on the corresponding relationship between the pre-constructed intention type and the interaction method, determining the target interaction method corresponding to the intention type to which the medication query information belongs;
[0011] According to the target interaction method, using the medication query information and a pre-constructed medication knowledge base to determine the knowledge call information corresponding to the medication query information;
[0012] Based on the knowledge call information and the medication query information, perform knowledge integration reasoning to determine the medication query result corresponding to the current medication problem.
[0013] Optionally, the intention type includes at least one of the drug popularization type and the drug recommendation type; based on the pre - constructed correspondence between the intention type and the interaction method, determining the target interaction method corresponding to the intention type to which the medication query information belongs includes:
[0014] If the intention type is the drug popularization type, then determine that the target interaction method corresponding to the intention type to which the medication query information belongs is the passive reply method;
[0015] If the intention type is the drug recommendation type, then determine that the target interaction method corresponding to the intention type to which the medication query information belongs is the active consultation method.
[0016] Optionally, according to the target interaction method, use the medication query information and the pre - constructed drug knowledge base to determine the knowledge call information corresponding to the medication query information, including:
[0017] If the target interaction method is the passive reply method, then retrieve information from the pre - constructed drug knowledge base according to the medication query information to obtain the knowledge call information corresponding to the medication query information.
[0018] Optionally, according to the target interaction method, use the medication query information and the pre - constructed drug knowledge base to determine the knowledge call information corresponding to the medication query information, including:
[0019] If the target interaction method is the active consultation method, then conduct an active consultation interaction with the user based on the medication query information to obtain the consultation interaction information, and determine the active consultation conclusion based on the medication query information and the consultation interaction information; the active consultation conclusion includes the recommended drugs corresponding to the medication query information.
[0020] Retrieve information from the pre - constructed drug knowledge base according to the active consultation conclusion to obtain the knowledge call information corresponding to the medication query information.
[0021] Optionally, based on the medication query information, conduct an active consultation interaction with the user to obtain the consultation interaction information, and determine the active consultation conclusion based on the medication query information and the consultation interaction information, including:
[0022] Input the medication query information into a pre-trained active inquiry interaction model. The active inquiry interaction model conducts active inquiry interaction with the user based on an inquiry instruction to obtain inquiry interaction information, and determines an active inquiry conclusion based on the medication query information and the inquiry interaction information. Among them, the active inquiry interaction model uses a large language model.
[0023] Optionally, based on the knowledge invocation information and the medication query information, perform knowledge integration reasoning to determine the medication query result corresponding to the current medication problem, including:
[0024] Perform knowledge integration reasoning on the medication query information, the knowledge invocation information, and the historical conversation information to determine the medication query result corresponding to the current medication problem.
[0025] Optionally, perform knowledge integration reasoning on the medication query information, the knowledge invocation information, and the historical conversation information to determine the medication query result corresponding to the current medication problem, including:
[0026] Input the medication query information, the knowledge invocation information, and the historical conversation information into a pre-trained knowledge integration reasoning model. The knowledge integration reasoning model performs knowledge integration reasoning based on an integration reasoning instruction to obtain the medication query result corresponding to the current medication problem. Among them, the knowledge integration reasoning model uses a large language model.
[0027] According to the second aspect of the embodiments of the present application, a medication query device is provided, including:
[0028] An information fusion module, configured to perform information fusion on the obtained current medication problem and historical conversation information to obtain the medication query information corresponding to the current medication problem;
[0029] An intention recognition module, configured to perform intention recognition on the medication query information to determine the intention type to which the medication query information belongs;
[0030] An integration reasoning module, configured to perform knowledge integration reasoning based on the intention type, the medication query information, and a pre-constructed drug knowledge base to determine the medication query result corresponding to the current medication problem.
[0031] According to the third aspect of the embodiments of the present application, an electronic device is provided, including: a memory and a processor;
[0032] The memory is connected to the processor and is used to store programs;
[0033] The processor is configured to implement the above-mentioned medication query method by running the programs in the memory.
[0034] According to a fourth aspect of the embodiments of the present application, a storage medium is provided. A computer program is stored on the storage medium. When the computer program is executed by a processor, the above-mentioned medication query method is implemented.
[0035] According to a fifth aspect of the embodiments of the present application, a computer program product is provided, including computer program instructions. When the computer program instructions are run by a processor, the processor implements the above-mentioned medication query method.
[0036] For the medication query method proposed in the present application, the current medication problem obtained and the historical conversation information are fused to obtain the medication query information corresponding to the current medication problem; the intent of the medication query information is recognized to determine the intent type to which the medication query information belongs; based on the intent type, the medication query information, and the pre-constructed medication knowledge base, knowledge integration reasoning is performed to determine the medication query result corresponding to the current medication problem. By adopting the technical solution of the present application, it is possible to automatically perform a medication query on the medication problem input by the user, improving the efficiency and accuracy of the medication query. Moreover, when performing the medication query, user characteristics, medication information, disease information, etc. included in the historical conversation information are combined, making the user's medication query information richer. In addition, the medication knowledge base is called during the knowledge integration reasoning process, making the result of the knowledge integration reasoning more accurate and further improving the accuracy of the medication query. Description of the Drawings
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0038] Figure 1 It is a schematic flowchart of a medication query method provided by an embodiment of the present application;
[0039] Figure 2 It is a schematic flowchart of a process for determining a medication query result provided by an embodiment of the present application;
[0040] Figure 3 It is another schematic flowchart of a process for determining a medication query result provided by an embodiment of the present application;
[0041] Figure 4 It is a schematic structural diagram of a medication query device provided by an embodiment of the present application;
[0042] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0043] The technical solution of the embodiment of the present application is applicable to the application scenario of medication query. By adopting the technical solution of the embodiment of the present application, it is possible to automatically perform medication query on the medication problems input by the user, improving the efficiency and accuracy of medication query.
[0044] In the field of medical health, medication query is an important link. For example, medication knowledge query, medication advice query or medication recommendation, etc. The traditional medical mode mainly relies on patients to actively seek help from doctors, relying on the professional knowledge and experience of doctors. Doctors provide medication knowledge feedback, medication advice or drug recommendations to patients. However, in most cases, face-to-face communication with doctors is required, resulting in low efficiency of medication query, and the workload of doctors is relatively large. Working for a long time may affect the accuracy of medication query.
[0045] In recent years, with the rapid development of artificial intelligence technology, the intelligent transformation in the medical field has been accelerating. Especially with the support of natural language processing technology, artificial intelligence systems can efficiently process patients' health information and provide the ability to query medications. However, despite the convenience brought by these technologies, current artificial intelligence systems still face multiple existing problems in practice, which limit their wide application in medicine. Specifically, when current artificial intelligence systems perform medication query, the problem of many medical knowledge errors is an urgent problem to be solved. Due to the limitations of model training data and the complexity of medical knowledge, current artificial intelligence systems often provide inaccurate or incomplete medical advice, and may even mislead patients. Such errors are particularly dangerous when providing medication advice, which may lead to inappropriate treatment plans.
[0046] Based on this, the present application proposes a medication query method. This technical solution can automatically perform medication query on the medication problems input by the user. Moreover, when performing medication query, it combines user characteristics, medication information, disease information, etc. contained in the historical conversation information, making the user's medication query information more abundant. And, when performing knowledge integration and reasoning, it calls the drug knowledge base, making the results obtained by knowledge integration and reasoning more accurate, thus solving the problem of low efficiency and accuracy of medication query in the prior art.
[0047] Next, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0048] Exemplary method
[0049] See Figure 1 As shown, an embodiment of the present application proposes a medication query method. The method includes:
[0050] S101. Perform information fusion on the obtained current medication problem and historical conversation information to obtain medication query information corresponding to the current medication problem.
[0051] In this embodiment, the user can interact with the interaction system in the medical field. During the interaction process, the user can ask medication questions, and use the medication questions asked by the user as the current medication problem, that is, the medication problem in the current interaction round. If the interaction system wants to reply to the current medication problem, it first needs to obtain the current medication problem and the historical conversation information with the interaction system. Among them, the current medication problem is the medication query problem in the current interaction round, and the historical conversation information is the interaction content between the user and the system in each interaction round before the current interaction round. For example, if the current interaction round is the Nth round, then the current medication problem is the medication query problem proposed by the user to the system in the Nth round, and the historical conversation information is all the interaction content between the user and the interaction system in the previous N - 1 rounds (the 1st round to the N - 1st round).
[0052] In this embodiment, in the historical conversation between the user and the interaction system, there may have been interactions regarding the user's basic characteristics, symptoms, medications, diseases, etc., or supplementary explanations regarding the current medication problem, or explanations regarding some noun aliases in the current medication problem, etc. Therefore, in this embodiment, while obtaining the current medication problem, it is also necessary to obtain the historical conversation information between the user and the interaction system, and perform information fusion on the current medication problem and the historical conversation information to obtain medication query information corresponding to the current medication problem, so that the medication query information not only includes the current medication problem, but also includes the explanatory information of the name aliases existing in the current medication problem, supplementary explanation information, or the user's basic characteristics, symptoms, medications, diseases, etc. included in the historical conversation information. In addition, in this embodiment, performing information fusion on the current medication problem and the historical conversation information can process the current medication problem into a complete sentence expressed in natural language through this fusion, that is, the medication query information corresponding to the current medication problem. Since the medication query information not only includes the current medication problem, but also includes various information included in the historical conversation information, the information included in the medication query information is richer, the intention recognition of the user through the medication query information is more accurate, and when performing a medication query through the medication query information, the richer the content included in the medication query information, the higher the accuracy of the query result.
[0053] Specifically, in this embodiment, the information fusion of the current medication problem and historical dialogue information is implemented by the above-mentioned information inheritance and fusion module. Among them, the above-mentioned information inheritance and fusion module is preferably constructed using a large language model. For this large language model, a fusion instruction is designed in advance, and training samples are collected in advance. The training samples include sample medication problems and the corresponding sample historical dialogues of the sample medication problems. In this embodiment, the training samples are input into the large language model, so that the large language model performs information fusion training on the training samples according to the pre-designed fusion instruction, and performs supervised fine-tuning on the large language model. Finally, a large language model that can implement the above-mentioned information inheritance and fusion function and output a natural and fluent complete sentence is trained. Using the trained large language model can realize the fusion of the current medication problem and historical dialogue information, that is, both the current medication problem and historical dialogue information are input into the above-mentioned trained large language model, and the large language model performs information fusion on the current medication problem and historical dialogue information according to the fusion instruction, so as to obtain the medication query information corresponding to the current medication problem.
[0054] S102. Perform intent recognition on the medication query information to determine the intent type to which the medication query information belongs.
[0055] After fusing the current medication problem and historical dialogue information in this embodiment, it is necessary to perform intent recognition on the fused medication query information to determine the intent type to which the medication query information belongs. Specifically, in this embodiment, the intent of the user is analyzed through the medication query information, and according to the analyzed user intent, the intent type to which the user intent belongs is determined as the intent type to which the medication query information belongs. Among them, the intent types involved in this embodiment include at least one of intent types such as drug popularization type and drug recommendation type.
[0056] Among them, the user intent of the drug popularization type mainly refers to the consultation intent with drugs as the consultation object, including the intent of the user to consult drug-related information, such as the user's inquiry about the ingredients, mechanism of action, indications, drug dosage, dosing frequency, taboos, side effects, etc. of certain drugs.
[0057] The user intent of the drug recommendation type mainly refers to the consultation intent with diseases or symptoms as the consultation object, including the intent of the user to consult recommended drugs for certain diseases or symptoms. For example, for a certain disease or symptom, which drugs are recommended, the dosage, frequency, administration method, taboos, adverse reaction treatment measures, etc. of the recommended drugs.
[0058] For example, if the medication query information is "What is aspirin used for?", its corresponding user intention is to query the applicable symptoms of the drug aspirin, and the intention type to which this user intention belongs is the drug popular science type. If the medication query information is "What are the adverse reactions of aspirin?", its corresponding user intention is to query the adverse reactions of the drug aspirin, and the intention type to which this user intention belongs is also the drug popular science type. If the user query information is "What medicine can relieve headache and dizziness?", its corresponding user intention is to query the drugs recommended for the symptoms of headache and dizziness, and the intention type to which this user intention belongs is the drug recommendation type. If the user query information is "I had an appendectomy recently and still feel a little pain. What medicine can I take?", its corresponding user intention is to query the drugs recommended for the pain symptoms caused by the appendectomy, and the intention type to which this user intention belongs is also the drug recommendation type.
[0059] In this embodiment, an intention recognition model pre-trained can be used to recognize the intention of the medication query information. Among them, the intention recognition model preferably adopts the BERT+Softmax architecture. In this embodiment, sample sentences and the corresponding intention type labels are collected in advance. The sample sentences are input into the intention recognition model, and the predicted intention type corresponding to the sample sentences is predicted. Based on the difference between the intention type label and the predicted intention type, a loss function is calculated. Based on the loss function, with the goal of minimizing the difference between the intention type label and the predicted intention type, the intention recognition model is trained to obtain the finally trained intention recognition model. In this embodiment, the medication query information corresponding to the current medication problem can be input into the intention recognition model, so as to predict the intention type to which the medication query information belongs.
[0060] S103. Based on the intention type, the medication query information, and the pre-constructed drug knowledge base, perform knowledge integration and reasoning to determine the medication query result corresponding to the current medication problem.
[0061] In this embodiment, a drug knowledge base is pre-constructed. The drug knowledge base stores the relevant knowledge of various drugs. Among them, the relevant knowledge of drugs includes various information such as the drug name, drug type, indications, usage and dosage, taboos, precautions, efficacy purposes, adverse reactions, etc. The drug knowledge base also stores knowledge in aspects such as drug interactions, drug combinations, and pediatric medications. The drug knowledge base can be constructed by obtaining the relevant information of various drugs from the Pharmacopoeia of the People's Republic of China, or by parsing the drug instructions, etc.
[0062] After determining the intent type of the user in this embodiment, it is necessary to combine the intent type, the medication query information, and the information in the pre-constructed medication knowledge base, and through knowledge integration and reasoning, analyze the medication query result corresponding to the current medication problem. Specifically, for the medication query information of the drug popularization type intent, it mainly queries the relevant knowledge of the drug itself, that is, it has a strong association with the knowledge of the drug itself, and it is necessary to directly rely on the pre-constructed medication knowledge base for query and retrieval. Then, based on the relevant information retrieved by the query and the medication query information, integrate and reason to obtain the medication query result corresponding to the current medication problem. For the medication query information of the drug recommendation type intent, it mainly queries the medications for the user's symptoms, which has a stronger correlation with the user's relevant information. Therefore, in order to improve the accuracy of the medication query, it is also necessary to collect more relevant information of the user as auxiliary information, and query the relevant information of the corresponding medications from the medication knowledge base. By integrating and reasoning the collected auxiliary information, the relevant information of the medications, and the medication query information, determine the medication query result corresponding to the current medication problem.
[0063] Furthermore, the medication query information is the information after the fusion of the current medication problem and the historical dialogue information. However, information loss may occur during the information fusion process. Therefore, during the process of knowledge integration and reasoning, on the basis of combining the intent type, the medication query information, and the medication knowledge base, the historical dialogue information can be combined again to reuse the information lost during the fusion process, thereby improving the accuracy of knowledge integration and reasoning, that is, improving the accuracy of the medication query result. And, if the intent type to which the medication query information belongs is the drug recommendation type, and more relevant information of the user is collected as auxiliary information, then in this embodiment, the historical dialogue information combined again can include not only the interaction content in the interaction rounds before the current medication problem, but also the relevant information of the user collected.
[0064] As can be seen from the above introduction, the medication query method proposed in the embodiments of the present application performs information fusion on the obtained current medication problem and historical conversation information to obtain the medication query information corresponding to the current medication problem; performs intent recognition on the medication query information to determine the intent type to which the medication query information belongs; the intent types include: drug popularization type and drug recommendation type; based on the intent type, medication query information, and a pre-constructed drug knowledge base, performs knowledge integration and reasoning to determine the medication query result corresponding to the current medication problem. By adopting the technical solution of the present application, it is possible to automatically perform medication queries on the medication problems input by users, improving the efficiency and accuracy of medication queries. Moreover, when performing medication queries, user characteristics, medication information, disease information, etc. included in the historical conversation information are combined, making the user's medication query information more abundant. Additionally, the drug knowledge base is called during the knowledge integration and reasoning process, making the results obtained from the knowledge integration and reasoning more accurate, and further improving the accuracy of medication queries.
[0065] As an alternative implementation, refer to Figure 2 As shown, in another embodiment of the present application, it is disclosed that step S103, based on the intent type, medication query information, and a pre-constructed drug knowledge base, performs knowledge integration and reasoning to determine the medication query result corresponding to the current medication problem, specifically includes the following steps:
[0066] S201. Based on the pre-constructed correspondence between the intent type and the interaction method, determine the target interaction method corresponding to the intent type to which the medication query information belongs.
[0067] Since different intent types have different information focus points when performing medication queries, and different information focus points require different interaction methods to obtain information, in this embodiment, it is necessary to first determine the corresponding target interaction method according to the intent type to which the medication query information belongs, and then use the corresponding target interaction method to obtain relevant information. For example, for the intent type of drug popularization, it is mainly to query the relevant knowledge of the drug itself, that is, it has a strong association with the knowledge of the drug itself, and only needs to directly rely on the pre-constructed drug knowledge base for query and retrieval. Therefore, the interaction method corresponding to the drug popularization type can be the passive reply method. However, for the intent type of drug recommendation, it is mainly to query the medications for the user's symptoms, which has a stronger correlation with the user's relevant information, and more user-related information needs to be collected as auxiliary information. Therefore, the interaction method corresponding to the drug recommendation type can be the active interrogation method to actively ask the user some information related to the user.
[0068] In this embodiment, a correspondence between intention types and interaction modes is pre-established, that is, the interaction modes corresponding to different intention types are pre-stored. After identifying the intention type to which the user's query information belongs in this embodiment, it is necessary to query the target interaction mode corresponding to the intention type to which the user's query information belongs from the pre-established correspondence between intention types and interaction modes. Specifically, if the intention type to which the user's query information belongs is the drug popular science type, it is determined that the target interaction mode corresponding to the intention type to which the drug use query information belongs is the passive reply mode; if the intention type to which the user's query information belongs is the drug recommendation type, it is determined that the target interaction mode corresponding to the intention type to which the drug use query information belongs is the active consultation mode.
[0069] S202. According to the target interaction mode, use the drug use query information and the pre-established drug knowledge base to determine the knowledge call information corresponding to the drug use query information.
[0070] In this embodiment, it is necessary to use the drug use query information and the pre-established drug knowledge base to determine the knowledge call information corresponding to the drug use query information according to the target interaction mode corresponding to the intention type to which the drug use query information belongs. Specifically, when the target interaction mode corresponding to the intention type to which the drug use query information belongs is the passive reply mode, directly perform information retrieval from the pre-established drug knowledge base according to the drug use query information, that is, perform knowledge call on the pre-established drug knowledge base, query the relevant information corresponding to the drug use query information from the drug knowledge base, and use it as the knowledge call information corresponding to the drug use query information. For example, if the drug use query information is "What is aspirin used for?", information retrieval is performed from the drug knowledge base, and the relevant information about the indications of aspirin can be retrieved and used as the knowledge call information corresponding to the drug use query information.
[0071] When the target interaction mode corresponding to the intention type to which the drug use query information belongs is the active consultation mode, the specific steps for using the drug use query information and the pre-established drug knowledge base to determine the knowledge call information corresponding to the drug use query information are as follows:
[0072] First, based on the drug use query information, conduct an active consultation interaction with the user to obtain the consultation interaction information, and based on the drug use query information and the consultation interaction information, determine the active consultation conclusion.
[0073] When the target interaction method is the active inquiry method, it indicates that relevant information needs to be collected from the user through the active inquiry method to improve the accuracy of drug query when the intention type is the drug recommendation type. For example, when the user needs to query drug usage suggestions for their own situation, etc., in order to improve the accuracy of the query, it is necessary to understand as much information as possible about the user's own symptoms, diseases, surgical history, etc. However, this information may not be included in the historical conversation information. Therefore, the system needs to further interact with the user through active inquiry to collect the user's relevant information. That is, based on the drug query information, an active inquiry interaction is carried out with the user, and all conversations in the interaction are used as inquiry interaction information. For example, when the drug query information is "I had an appendicitis operation recently and still feel a little pain. What medicine can I take?", the system actively sends an inquiry question to the user, such as "Have you taken any medicine after the operation?" The user replies to the inquiry question, such as "I took some medicine in the first few days, but now I have stopped taking it." The system continues to send an inquiry question based on the user's reply, such as "What medicine did you take and for how many days?" The user then replies to the inquiry question, and so on, realizing the system's multi-round active inquiry interaction. The inquiry questions of the system and the user's replies in the multi-round active inquiry interaction are both stored as inquiry interaction information.
[0074] After obtaining the inquiry interaction information in this embodiment, it is necessary to determine the active inquiry conclusion based on the drug query information and the inquiry interaction information. Among them, the active inquiry conclusion includes the recommended drug corresponding to the drug query information. Specifically, by integrating the drug query information and the inquiry interaction information, and inferring the recommended drug that matches the drug query information and conforms to the user's own situation in the inquiry interaction information, this recommended drug is used as the active inquiry conclusion.
[0075] Furthermore, in this embodiment, an active inquiry interaction model can be pre-trained, and inquiry instructions are also pre-designed for the active inquiry interaction model so that the active inquiry interaction model processes information according to the inquiry instructions. Specifically, the medication query information is input into the pre-trained active inquiry interaction model. Based on the inquiry instructions, the active inquiry interaction model conducts an active inquiry interaction with the user to obtain inquiry interaction information, and determines an active inquiry conclusion based on the medication query information and the inquiry interaction information. Among them, the active inquiry interaction model preferably adopts a large language model. For the active inquiry interaction model, in this embodiment, a batch of dialogue data of doctors communicating with patients about symptoms, conditions, and other types of medication recommendations can be pre-collected as training samples (where each group of training samples is usually about 10 rounds of conversations, and one question and one answer is called one round of conversation). In this embodiment, each group of training samples is respectively input into the active inquiry interaction model so that the active inquiry interaction model outputs inquiry questions according to the inquiry instructions, learns the active inquiry interaction function with the user, realizes supervised parameter fine-tuning of the active inquiry interaction model, and then activates the ability of the active inquiry interaction model in the active multi-round inquiry scenario. In addition, it is also necessary to train the active inquiry interaction model for knowledge integration of the medication query information and the inquiry interaction information, as well as the reasoning ability of the inquiry conclusion. In this embodiment, in model training, a framework of the GPTs series is used for parameter fitting. The training method of the large language model has been disclosed in the prior art, and this embodiment will not elaborate specifically.
[0076] Second, according to the active inquiry conclusion, information retrieval is performed from the pre-constructed drug knowledge base to obtain knowledge call information corresponding to the medication query information.
[0077] Through the above steps, after determining the active inquiry conclusion, it is necessary to call knowledge from the pre-constructed drug knowledge base, perform information retrieval from the drug knowledge base, and retrieve information that matches the active inquiry conclusion as the knowledge call information corresponding to the medication query information. For example, if the active inquiry conclusion includes a recommended drug, then knowledge is called from the drug knowledge base, that is, relevant information corresponding to the recommended drug is retrieved from the drug knowledge base, such as information on the indications, contraindications, precautions, efficacy purposes, drug interactions, adverse reactions, etc. of the recommended drug. All the retrieved information is used as the knowledge call information corresponding to the medication query information.
[0078] Through this step, this embodiment realizes the free switching between active inquiry and passive reply, so that different methods can be selected according to different intention types, improving the efficiency and accuracy of medication query.
[0079] S203. Based on the knowledge call information and the medication query information, conduct knowledge integration and reasoning to determine the medication query result corresponding to the current medication problem.
[0080] After obtaining the knowledge call information from the drug knowledge base through the above steps, the knowledge call information and the medication query information are integrated and inferred to determine the medication query result corresponding to the current medication problem. Specifically, in this embodiment, after integrating the knowledge call information and the medication query information, the medication query result corresponding to the current medication problem is inferred. For example, when the intention type is drug popular science type, the content in the knowledge call information is organized into a natural and smooth reply statement as the medication query result; when the intention type is drug recommendation type, the drug-related information in the knowledge call information is matched and analyzed with the relevant information of the user contained in the historical conversation information obtained by integrating with the medication query information to determine whether there is a conflict between the drug-related information and the relevant information of the user. For example, if the contraindication of a certain drug has been expressed by the user in the historical conversation information, it means that there is a conflict between the drug-related information and the relevant information of the user. In this case, the drug is not used as a recommended drug, and the medication query result should specifically state that the drug can treat the disease, but conflicts with the symptoms of the user, and the user is not suitable for the drug, etc. If it is determined that there is no conflict between the drug-related information and the relevant information of the user, the drug is used as the final recommended drug, and a natural and smooth reply statement is generated as the medication query result. In addition, a fallback statement can be set in the medication query result, such as "If the condition worsens, please seek medical attention in time" and other statements.
[0081] Furthermore, in this embodiment, a knowledge integration and inference model can be pre-trained, and integration and inference instructions are also pre-designed for the knowledge integration and inference model to enable the knowledge integration and inference model to process information according to the integration and inference instructions. Specifically, the medication query information and the knowledge call information are both input into the pre-trained knowledge integration and inference model, so that the knowledge integration and inference model performs knowledge integration and inference based on the integration and inference instructions to obtain the medication query result corresponding to the current medication problem. Among them, the knowledge integration and inference model preferably adopts a large language model. For the knowledge integration and inference model, this embodiment can pre-collect multiple groups of training samples, where each group of training samples includes the fusion information between multiple rounds of conversation data (usually about 10 rounds of conversation) and the sample user questions, as well as the knowledge related to the fusion information retrieved from the drug knowledge base. In this embodiment, each group of training samples is respectively input into the knowledge integration and inference model, so that the knowledge integration and inference model outputs the response information to the sample user questions according to the integration and inference instructions, thereby enabling supervised parameter fine-tuning of the knowledge integration and inference model. In this embodiment, in model training, the GPTs series framework is used for parameter fitting. The training method of the large language model has been publicly disclosed in the prior art, and this embodiment will not elaborate specifically.
[0082] As an alternative implementation, refer to Figure 3As shown, in another embodiment of the present application, step S203 is disclosed. Based on the knowledge invocation information and the medication query information, knowledge integration reasoning is performed to determine the medication query result corresponding to the current medication problem, which specifically includes the following steps:
[0083] S301. Integrate and reason the medication query information, knowledge invocation information, and historical conversation information to determine the medication query result corresponding to the current medication problem.
[0084] In this embodiment, the medication query information is the information after the fusion of the current medication problem and the historical conversation information. However, information loss may occur during the information fusion process. Therefore, during the knowledge integration reasoning process, based on the medication query information and the knowledge invocation information, the historical conversation information can be combined again to reuse the information lost during the fusion process, thereby improving the accuracy of the knowledge integration reasoning, that is, improving the accuracy of the medication query result. That is, integrate and reason the medication query information, knowledge invocation information, and historical conversation information to determine the medication query result corresponding to the current medication problem.
[0085] In addition, if the target interaction method corresponding to the intention type to which the medication query information belongs is the active inquiry interaction, several rounds of active inquiry interactions have been carried out between the system and the user, and inquiry interaction information has been obtained. Therefore, if there has been an active inquiry interaction between the system and the user, the inquiry interaction information also needs to be used as historical conversation information to participate in the knowledge integration reasoning. That is, at this time, the historical conversation information not only includes all rounds of historical conversations before the round corresponding to the current medication problem, but also includes multiple rounds of active inquiry interaction conversations during the active inquiry interaction for the current medication problem.
[0086] Furthermore, this embodiment can also perform knowledge integration reasoning operations using a pre-trained knowledge integration reasoning model. That is, input the medication query information, knowledge invocation information, and historical conversation information into the pre-trained knowledge integration reasoning model. The knowledge integration reasoning model performs knowledge integration reasoning based on the integration reasoning instruction to obtain the medication query result corresponding to the current medication problem. Among them, the knowledge integration reasoning model preferably adopts a large language model. And the training method of the knowledge integration reasoning model used in this embodiment is the same as that of the knowledge integration reasoning model in the above embodiment, and will not be specifically elaborated in this embodiment.
[0087] Exemplary device
[0088] Correspondingly, the embodiment of the present application also provides a medication query device. See Figure 4 As shown, the device includes:
[0089] An information fusion module 100 is configured to fuse the obtained current medication problem and historical conversation information to obtain medication query information corresponding to the current medication problem;
[0090] An intent recognition module 110 is configured to recognize the intent of the medication query information and determine the intent type to which the medication query information belongs;
[0091] An integrated reasoning module 120 is configured to perform knowledge integration reasoning based on the intent type, medication query information, and a pre-constructed medication knowledge base to determine a medication query result corresponding to the current medication problem.
[0092] As can be seen from the above introduction, the medication query device proposed in the embodiment of the present application can automatically perform a medication query on the medication problem input by the user, improving the efficiency and accuracy of the medication query. Moreover, when performing the medication query, user characteristics, medication information, disease information, etc. included in the historical conversation information are combined, making the user's medication query information richer. Additionally, the medication knowledge base is invoked during the knowledge integration reasoning process, making the result of the knowledge integration reasoning more accurate and further improving the accuracy of the medication query.
[0093] As an alternative implementation, in another embodiment of the present application, it is disclosed that the integrated reasoning module 120 includes: an interaction determination unit, a call information determination unit, and a query result determination unit.
[0094] The interaction determination unit is configured to determine a target interaction method corresponding to the intent type to which the medication query information belongs based on the pre-constructed correspondence between the intent type and the interaction method;
[0095] The call information determination unit is configured to determine knowledge call information corresponding to the medication query information according to the target interaction method, using the medication query information and the pre-constructed medication knowledge base;
[0096] The query result determination unit is configured to perform knowledge integration reasoning based on the knowledge call information and the medication query information to determine a medication query result corresponding to the current medication problem.
[0097] As an alternative implementation, in another embodiment of the present application, it is disclosed that the interaction determination unit is specifically configured to:
[0098] If the intent type is a drug popularization type, determine that the target interaction method corresponding to the intent type to which the medication query information belongs is a passive reply method;
[0099] If the intent type is a drug recommendation type, determine that the target interaction method corresponding to the intent type to which the medication query information belongs is an active inquiry method.
[0100] As an alternative implementation, in another embodiment of the present application, it is disclosed that the call information determination unit includes: an information retrieval unit.
[0101] The information retrieval unit is configured to, if the target interaction mode is a passive reply mode, retrieve information from a pre-constructed drug knowledge base according to the drug query information, and obtain the knowledge call information corresponding to the drug query information.
[0102] As an alternative implementation, in another embodiment of the present application, it is disclosed that the call information determination unit further includes: an interrogation interaction unit.
[0103] The interrogation interaction unit is configured to, if the target interaction mode is an active interrogation mode, perform an active interrogation interaction with the user based on the drug query information, obtain the interrogation interaction information, and determine an active interrogation conclusion based on the drug query information and the interrogation interaction information; the active interrogation conclusion includes the recommended drugs corresponding to the drug query information.
[0104] The information retrieval unit is further configured to retrieve information from a pre-constructed drug knowledge base according to the active interrogation conclusion, and obtain the knowledge call information corresponding to the drug query information.
[0105] As an alternative implementation, in another embodiment of the present application, it is disclosed that the interrogation interaction unit is specifically configured to:
[0106] Input the drug query information into a pre-trained active interrogation interaction model. The active interrogation interaction model performs an active interrogation interaction with the user based on the interrogation instruction, obtains the interrogation interaction information, and determines an active interrogation conclusion based on the drug query information and the interrogation interaction information; wherein, the active interrogation interaction model uses a large language model.
[0107] As an alternative implementation, in another embodiment of the present application, it is disclosed that the integration and reasoning module 120 is specifically configured to:
[0108] Integrate and reason about the drug query information, the knowledge call information, and the historical conversation information to determine the drug query result corresponding to the current drug problem.
[0109] As an alternative implementation, in another embodiment of the present application, it is disclosed that the integration and reasoning module 120 integrates and reasons about the drug query information, the knowledge call information, and the historical conversation information to determine the drug query result corresponding to the current drug problem, specifically including:
[0110] The medication query information, knowledge invocation information, and historical conversation information are all input into a pre-trained knowledge integration and reasoning model. The knowledge integration and reasoning model performs knowledge integration and reasoning based on the integration and reasoning instructions to obtain the medication query result corresponding to the current medication problem. Among them, the knowledge integration and reasoning model uses a large language model.
[0111] The medication query device provided in this embodiment belongs to the same inventive concept as the medication query method provided in the above embodiments of the present application. It can execute the medication query method provided in any of the above embodiments of the present application and has the corresponding functional modules and beneficial effects for executing the medication query method. For the technical details not described in detail in this embodiment, reference can be made to the specific processing content of the medication query method provided in the above embodiments of the present application, which will not be elaborated here.
[0112] Exemplary electronic device
[0113] Another embodiment of the present application also proposes an electronic device, as shown in Figure 5 shown, the device includes:
[0114] A memory 200 and a processor 210;
[0115] Among them, the memory 200 is connected to the processor 210 and is used to store programs;
[0116] The processor 210 is used to implement the medication query method disclosed in any of the above embodiments by running the program stored in the memory 200.
[0117] Specifically, the above electronic device may further include: a bus, a communication interface 220, an input device 230, and an output device 240.
[0118] The processor 210, the memory 200, the communication interface 220, the input device 230, and the output device 240 are interconnected through the bus. Among them:
[0119] The bus may include a path for transmitting information between various components of the computer system.
[0120] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0121] The processor 210 may include a main processor, and may also include a baseband chip, a modem, etc.
[0122] The memory 200 stores a program for implementing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include program code, and the program code includes computer operation 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, a disk memory, a flash memory, etc.
[0123] 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, etc.
[0124] The output device 240 may include a device for allowing information to be output to a user, such as a display screen, a printer, a speaker, etc.
[0125] The communication interface 220 may include a device of any transceiver type for communicating with other devices or communication networks, such as an Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.
[0126] The processor 210 executes the program stored in the memory 200 and calls other devices, and can be used to implement each step of any one of the medication query methods provided in the above embodiments of the present application.
[0127] Exemplary computer program product and storage medium
[0128] In addition to the above methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, and when the computer program instructions are run by a processor, the processor is caused to execute the steps in the medication query methods according to various embodiments of the present application described in the "Exemplary Methods" section of the present specification.
[0129] The computer program product can be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present application. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The programming code can be executed entirely on the user's computing device, partially on the user's device, executed as an independent 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.
[0130] In addition, an embodiment of the present application can also be a storage medium on which a computer program is stored, and the computer program is executed by a processor to perform the steps in the medication query method according to various embodiments of the present application described in the "Exemplary Method" section of the present specification.
[0131] For the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0132] It should be noted that the embodiments in this specification are all described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0133] The steps in the methods of the embodiments of the present application can be adjusted, combined, and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0134] The modules and sub-modules in the devices and terminals in the embodiments of the present application can be combined, divided, and deleted according to actual needs.
[0135] In several embodiments provided by the present 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 sub-modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple sub-modules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling, direct coupling, or communication connection to each other can be an indirect coupling or communication connection through some interfaces, devices, or modules, and can be in electrical, mechanical, or other forms.
[0136] The modules or sub-modules described as separate components may or may not be physically separated. The components as modules or sub-modules may or may not be physical modules or sub-modules, that is, they can be located in one place, or they can be distributed to multiple network modules or sub-modules. Some or all of the modules or sub-modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0137] In addition, in each embodiment of the present application, each functional module or sub-module can be integrated in a processing module, or each module or sub-module can exist physically alone, or two or more modules or sub-modules can be integrated in one module. The above-mentioned integrated modules or sub-modules can be implemented in the form of hardware or in the form of software functional modules or sub-modules.
[0138] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0139] The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, a software unit executed by a processor, or a combination of the two. The software unit can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.
[0140] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0141] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those 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 will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A medication query method, characterized in that: include: Fusing the acquired current medication problem with historical conversation information to obtain medication query information corresponding to the current medication problem; Performing intent recognition on the medication query information to determine the intent type to which the medication query information belongs; Based on the intention type, the medication query information and a pre-constructed drug knowledge base, knowledge integration reasoning is performed to determine the medication query result corresponding to the current medication problem.
2. The method according to claim 1, characterized in that Based on the intention type, the medication query information and the pre-built medication knowledge base, knowledge integration reasoning is performed to determine the medication query result corresponding to the current medication problem, including: Based on the pre-constructed correspondence between the intent type and the interaction mode, determining the target interaction mode corresponding to the intent type to which the medication query information belongs; According to the target interaction mode, using the medication query information and a pre-built drug knowledge base, determining knowledge call information corresponding to the medication query information; Based on the knowledge call information and the medication query information, knowledge integration reasoning is performed to determine the medication query result corresponding to the current medication problem.
3. The method according to claim 2, characterized in that The intention type includes at least one of a drug popularization type and a drug recommendation type; Based on the pre-constructed correspondence between the intent type and the interaction mode, determining the target interaction mode corresponding to the intent type to which the medication query information belongs includes: If the intention type is a drug popular science type, determining that the target interaction mode corresponding to the intention type to which the medication query information belongs is a passive response mode; If the intention type is a drug recommendation type, it is determined that the target interaction mode corresponding to the intention type to which the medication query information belongs is an active consultation mode.
4. The method according to claim 2, characterized in that: According to the target interaction mode, the medication query information and the pre-built drug knowledge base are used to determine the knowledge call information corresponding to the medication query information, including: If the target interaction mode is a passive response mode, information retrieval is performed from a pre-constructed drug knowledge base according to the medication query information to obtain knowledge call information corresponding to the medication query information.
5. The method according to claim 2, characterized in that: According to the target interaction mode, the medication query information and the pre-built drug knowledge base are used to determine the knowledge call information corresponding to the medication query information, including: If the target interaction mode is an active consultation mode, based on the medication query information, an active consultation interaction is performed with the user to obtain consultation interaction information, and based on the medication query information and the consultation interaction information, an active consultation conclusion is determined; the active consultation conclusion includes a recommended drug corresponding to the medication query information; According to the active consultation conclusion, information is retrieved from a pre-constructed drug knowledge base to obtain knowledge call information corresponding to the medication query information.
6. The method according to claim 5, characterized in that Based on the medication query information, actively conduct consultation interaction with the user to obtain consultation interaction information, and based on the medication query information and the consultation interaction information, determine the active consultation conclusion, including: The medication query information is input into a pre-trained active medical consultation interaction model. The active medical consultation interaction model conducts active medical consultation interaction with the user based on the medical consultation instruction to obtain medical consultation interaction information, and determines the active medical consultation conclusion based on the medication query information and the medical consultation interaction information; wherein the active medical consultation interaction model adopts a large language model.
7. The method according to claim 2, characterized in that Based on the knowledge call information and the medication query information, knowledge integration reasoning is performed to determine the medication query result corresponding to the current medication problem, including: The medication query information, the knowledge call information and the historical dialogue information are subjected to knowledge integration reasoning to determine the medication query result corresponding to the current medication problem.
8. The method according to claim 7, characterized in that The medication query information, the knowledge call information and the historical dialogue information are subjected to knowledge integration reasoning to determine the medication query result corresponding to the current medication problem, including: The medication query information, the knowledge call information and the historical dialogue information are all input into a pre-trained knowledge integration reasoning model. The knowledge integration reasoning model performs knowledge integration reasoning based on the integration reasoning instructions to obtain the medication query result corresponding to the current medication problem; wherein the knowledge integration reasoning model adopts a large language model.
9. A medication query device, characterized in that: include: An information fusion module is used to fuse the acquired current medication problem with the historical conversation information to obtain medication query information corresponding to the current medication problem; An intention recognition module, used to perform intention recognition on the medication query information and determine the intention type to which the medication query information belongs; The integrated reasoning module is used to perform knowledge integrated reasoning based on the intention type, the medication query information and a pre-built drug knowledge base to determine the medication query result corresponding to the current medication problem.
10. An electronic device, characterized in that: include: Memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the medication query method according to any one of claims 1 to 8 by running the program in the memory.
11. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the medication query method according to any one of claims 1 to 8 is implemented.
12. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor, enable the processor to implement the medication query method according to any one of claims 1 to 8.