Drug recommendation method, device, equipment, system and program product
By obtaining the user's current problems and historical dialogue, conducting entity extraction and semantic understanding, and combining potential image information to search for drug knowledge, it solves the problem of insufficient accuracy and stability of intelligent technology in drug recommendations, and achieves more accurate drug recommendations.
Patent Information
- Application Number
- CN202411842955.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-05-02
AI Technical Summary
In the field of medicine, especially in terms of rational use of drugs, the drug recommendations given by intelligent technology may have an impact on the patient's condition judgment and treatment plan selection, and require higher requirements on the accuracy and stability of question-and-answer technology.
By obtaining the current problems and historical conversations initiated by the target user, performing entity extraction to obtain medical portrait information, and obtaining user habit information through semantic understanding, and configuring potential portrait information. Knowledge search is carried out based on current problems and medical portrait information, potential portrait information is used to influence tendency parameters on the knowledge search process, and drug recommendation information is generated.
The accuracy of drug recommendations is improved, and the targetedness of Q&A knowledge is ensured in the process of knowledge retrieval of user portraits and enhanced the integrity of user portraits.
Smart Images

Figure CN119917649A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a drug recommendation method, device, equipment, system and program product. Background Art
[0002] With the continuous development of artificial intelligence technology, large language model question-answering technology has been widely used in conversational services in various fields.
[0003] In the medical field, especially in the rational use of drugs, since the answers given by intelligent technology may have a direct impact on patients' judgment of their own condition and choice of treatment options, it puts higher demands on the accuracy and stability of question-answering technology. Therefore, how to make accurate drug recommendations has become a problem. Summary of the invention
[0004] In view of this, the present application provides a drug recommendation method to improve the accuracy of drug recommendations.
[0005] According to a first aspect of an embodiment of the present application, a method for drug recommendation is provided, which can be applied to a system or program including a drug recommendation function in a terminal device, and specifically includes:
[0006] Get the current questions and historical conversations initiated by the target user;
[0007] Performing entity extraction on the current question and the historical conversation to obtain medical portrait information corresponding to the target user;
[0008] Performing semantic understanding on the historical conversation to obtain habit information corresponding to the target user, so as to configure potential profile information corresponding to the target user according to the habit information;
[0009] Performing knowledge retrieval based on the current question and the medical portrait information to obtain prompt information, and obtaining a target drug suitable for the target user through the prompt information, wherein the knowledge retrieval process corresponding to the prompt information is affected by the tendency parameter corresponding to the potential portrait information;
[0010] Generate drug recommendation information indicating the target drug based on the potential portrait information.
[0011] Optionally, in some possible implementations, the performing entity extraction on the current question and the historical conversation to obtain the medical portrait information corresponding to the target user includes:
[0012] Inputting the current question and the historical dialogue into an entity relationship extraction model to extract information to obtain an object entity and a medical entity;
[0013] Inputting the medical entity into the image confidence evaluation model for binary classification to obtain a classification score of the medical entity belonging to the object entity;
[0014] Entity screening is performed based on the classification score to configure a portrait archive corresponding to the object entity;
[0015] The medical image information is obtained by calling the image archive of the object entity matching the target user.
[0016] Optionally, in some possible implementations, obtaining the medical portrait information by calling a portrait archive of an object entity matching the target user includes:
[0017] Obtain archived portrait information by calling a portrait archive of an object entity matching the target user;
[0018] Determine a current portrait and a historical portrait in the archived portrait information, wherein the current portrait matches the current question, and the historical portrait matches the historical conversation;
[0019] The current portrait and the historical portrait are detected for contradictions, so as to adjust the archived portrait information to the medical portrait information. In case of contradiction selection, the priority of the current portrait is greater than the priority of the historical portrait.
[0020] Optionally, in some possible implementations, the performing contradiction detection on the current portrait and the historical portrait to adjust the archived portrait information to the medical portrait information includes:
[0021] Mapping the current portrait and the historical portrait into standard medical terms based on medical resources;
[0022] Performing contradiction detection on the standard medical terms according to preset rules to obtain contradictory terms;
[0023] The conflicting items are screened out to adjust the archived image information to the medical image information.
[0024] Optionally, in some possible implementations, the performing semantic understanding on the historical conversation to obtain habit information corresponding to the target user, and configuring potential portrait information corresponding to the target user according to the habit information, includes:
[0025] Inputting the historical conversation into a large language model for semantic understanding to score preset indicators and obtain indicator score information, wherein the preset indicators are set for question-answering habits and medication habits;
[0026] Performing parameter configuration on the question-answering habit and the medication habit according to the indicator score information to obtain the habit information;
[0027] The potential portrait information corresponding to the target user is configured according to the habit information.
[0028] Optionally, in some possible implementations, the performing knowledge retrieval based on the current question and the medical image information to obtain prompt information, and obtaining a target drug suitable for the target user through the prompt information, includes:
[0029] Determining a pharmaceutical knowledge base associated with the current problem;
[0030] Based on the drug knowledge base, a structured knowledge search is performed on the current question and the medical image information to obtain structured prompt content;
[0031] Performing unstructured knowledge retrieval on the current problem and the medical image information based on Internet knowledge to obtain unstructured prompt content;
[0032] Answer the current question and the medical image information based on the large language model to obtain candidate drugs;
[0033] The prompt information is obtained by combining the structured prompt content and the unstructured prompt content, and a target drug suitable for the target user is selected from the candidate drugs based on the prompt information.
[0034] Optionally, in some possible implementations, the performing structured knowledge retrieval on the current question and the medical image information based on the drug knowledge base to obtain structured prompt content includes:
[0035] Performing knowledge retrieval on the current problem based on the drug knowledge base to obtain structured text knowledge, wherein the structured text knowledge includes entity extraction results and intent classification results;
[0036] If the intention classification result leads to the use of drugs, risk knowledge matching is performed in the drug knowledge base based on the entity extraction result to obtain multiple risk items;
[0037] Determine the content intersection of a plurality of the risk items to obtain the structured prompt content.
[0038] Optionally, in some possible implementations, performing unstructured knowledge retrieval on the current question and the medical image information based on Internet knowledge to obtain unstructured prompt content includes:
[0039] Splitting the current question into multiple sub-questions, and constructing a portrait retrieval clause based on the medical portrait information;
[0040] Extracting content from the Internet knowledge to obtain index keywords;
[0041] Determine the search result by calculating the similarity score between the sub-question, the portrait search clause and the index keyword;
[0042] Binary classify the search results based on knowledge orientation to obtain classification results;
[0043] The unstructured prompt content is determined according to the proportion of negative knowledge in the classification result.
[0044] Optionally, in some possible implementations, answering the current question and the medical image information based on the large language model to obtain candidate drugs includes:
[0045] Performing question analysis on the current question and the medical image information based on a large language model to obtain a candidate list, wherein the question analysis includes feasibility questions and answers, appeal questions and answers, object demand questions and answers, recommendation type questions and answers, and medical record questions and answers;
[0046] The problem analysis is repeated based on the candidate list to obtain the candidate drugs.
[0047] Optionally, in some possible implementations, the method further includes:
[0048] determining medication habits indicated by the potential profile information;
[0049] Based on the medication habits, the structured knowledge retrieval, unstructured knowledge retrieval and the candidate drug determination process are fine-tuned to adjust the target drug.
[0050] Optionally, in some possible implementations, generating drug recommendation information indicating the target drug according to the potential portrait information includes:
[0051] Determining the question-answering habits indicated by the potential profile information;
[0052] The question-and-answer style information for the target user is configured through the question-and-answer habit;
[0053] The recommended content including the target drug is adjusted based on the question-answer style information to obtain the drug recommendation information.
[0054] According to a second aspect of an embodiment of the present application, a drug recommendation device is provided, comprising:
[0055] An acquisition unit, used to acquire the current question and historical conversations initiated by the target user;
[0056] A processing unit, configured to extract entities from the current question and the historical conversation to obtain medical portrait information corresponding to the target user;
[0057] The processing unit is further configured to perform semantic understanding on the historical conversation to obtain habit information corresponding to the target user, so as to configure potential portrait information corresponding to the target user according to the habit information;
[0058] The processing unit is further used to perform knowledge retrieval based on the current question and the medical portrait information to obtain prompt information, and obtain a target drug suitable for the target user through the prompt information, wherein the knowledge retrieval process corresponding to the prompt information is affected by the tendency parameter corresponding to the potential portrait information;
[0059] A recommendation unit is used to generate drug recommendation information indicating the target drug based on the potential portrait information.
[0060] Optionally, in some possible implementations, the processing unit is used to input the current question and the historical conversation into an entity relationship extraction model for information extraction to obtain an object entity and a medical entity when performing entity extraction on the current question and the historical conversation to obtain the medical portrait information corresponding to the target user; input the medical entity into a portrait confidence evaluation model for binary classification to obtain a classification score for the medical entity belonging to the object entity; perform entity screening based on the classification score to configure a portrait archive corresponding to the object entity; and obtain the medical portrait information by calling the portrait archive of the object entity matching the target user.
[0061] Optionally, in some possible implementations, the processing unit is used to obtain archived portrait information by calling the portrait archive of the object entity matching the target user when the medical portrait information is obtained by calling the portrait archive of the object entity matching the target user; determine the current portrait and historical portrait in the archived portrait information, the current portrait matches the current problem, and the historical portrait matches the historical conversation; perform contradiction detection on the current portrait and the historical portrait to adjust the archived portrait information to the medical portrait information, and in the event of contradiction selection, the priority of the current portrait is greater than the priority of the historical portrait.
[0062] Optionally, in some possible implementations, the processing unit is used to map the current portrait and the historical portrait into standard medical terms based on medical resources when performing contradiction detection on the current portrait and the historical portrait to adjust the archived portrait information to the medical portrait information; perform contradiction detection on the standard medical terms according to preset rules to obtain contradictory items; and screen out the contradictory items to adjust the archived portrait information to the medical portrait information.
[0063] Optionally, in some possible implementations, the processing unit is used to input the historical conversation into a large language model for semantic understanding when the habit information corresponding to the target user is obtained by performing semantic understanding on the historical conversation, and to configure the potential portrait information corresponding to the target user according to the habit information, so as to score the preset indicators and obtain indicator score information, wherein the preset indicators are set for question-and-answer habits and medication habits; to configure parameters of the question-and-answer habits and the medication habits according to the indicator score information to obtain the habit information; and to configure the potential portrait information corresponding to the target user according to the habit information.
[0064] Optionally, in some possible implementations, the processing unit is used to determine a drug knowledge base associated with the current question when the prompt information is obtained by performing knowledge retrieval based on the current question and the medical image information, and the target drug suitable for the target user is obtained through the prompt information; perform structured knowledge retrieval on the current question and the medical image information based on the drug knowledge base to obtain structured prompt content; perform unstructured knowledge retrieval on the current question and the medical image information based on Internet knowledge to obtain unstructured prompt content; answer the current question and the medical image information based on a large language model to obtain candidate drugs; obtain the prompt information by combining the structured prompt content and the unstructured prompt content, and select the target drug suitable for the target user from the candidate drugs based on the prompt information.
[0065] Optionally, in some possible implementations, the processing unit is used to perform knowledge retrieval on the current question based on the drug knowledge base to obtain structured text knowledge when performing structured knowledge retrieval on the current question and the medical image information based on the drug knowledge base to obtain structured prompt content, and the structured text knowledge includes entity extraction results and intent classification results; if the intent classification result leads to the use of drugs, risk knowledge matching is performed in the drug knowledge base based on the entity extraction result to obtain multiple risk items; and the content intersection of the multiple risk items is determined to obtain the structured prompt content.
[0066] Optionally, in some possible implementations, the processing unit is used to split the current question into multiple sub-questions and construct a portrait retrieval clause based on the medical portrait information when performing unstructured knowledge retrieval on the current question and the medical portrait information based on Internet knowledge to obtain unstructured prompt content; extract content from the Internet knowledge to obtain index keywords; determine the retrieval results by calculating the similarity scores between the sub-questions, the portrait retrieval clauses and the index keywords; perform binary classification on the retrieval results based on knowledge orientation to obtain classification results; and determine the unstructured prompt content based on the proportion of negative knowledge in the classification results.
[0067] Optionally, in some possible implementations, the processing unit is used to answer the current question and the medical image information based on the large language model to obtain candidate drugs, including performing question analysis on the current question and the medical image information based on the large language model to obtain a candidate list, the question analysis including feasibility questions and answers, appeal questions and answers, object demand questions and answers, recommendation type questions and answers, and medical history questions and answers; repeating the question analysis based on the candidate list to obtain the candidate drugs.
[0068] Optionally, in some possible implementations, the processing unit is also used to determine the medication habits indicated by the potential portrait information; based on the medication habits, fine-tune the structured knowledge retrieval, unstructured knowledge retrieval and the candidate drug determination process to adjust the target drug.
[0069] Optionally, in some possible implementations, the recommendation unit is used to determine the question and answer habits indicated by the potential portrait information when generating the drug recommendation information indicating the target drug based on the potential portrait information; configure the question and answer style information for the target user through the question and answer habits; and adjust the recommendation content containing the target drug based on the question and answer style information to obtain the drug recommendation information.
[0070] According to a third aspect of an embodiment of the present application, there is provided a drug recommendation device, including an input and output component and a processor;
[0071] The input-output component is used to obtain the current question;
[0072] The processor is used to recommend drugs for the current problem obtained by the input-output component by executing the drug recommendation method as described in the first aspect or any one of the first aspects.
[0073] According to a fourth aspect of an embodiment of the present application, there is provided a drug recommendation system, including an interactive client and a server;
[0074] The interactive client is used to obtain the current question and send the current question to the server, and to display the drug recommendation results output by the server;
[0075] The server is used to recommend drugs for the current problem obtained by the input-output component by executing the drug recommendation method described in the first aspect or any one of the first aspects.
[0076] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising: a computer program, which, when executed by a processor, implements the drug recommendation method described in the first aspect or any one of the first aspects.
[0077] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0078] By obtaining the current question and historical conversation initiated by the target user; then extracting entities from the current question and historical conversation to obtain the medical portrait information corresponding to the target user; and semantically understanding the historical conversation to obtain the habit information corresponding to the target user, so as to configure the potential portrait information corresponding to the target user according to the habit information; then performing knowledge retrieval based on the current question and medical portrait information to obtain prompt information, and obtaining the target drug suitable for the target user through the prompt information. The knowledge retrieval process corresponding to the prompt information is affected by the tendency parameters corresponding to the potential portrait information; and then generating drug recommendation information indicating the target drug according to the potential portrait information. Thus, the drug recommendation process combined with the user portrait is realized, and the integrity of the user portrait is improved by expanding the multi-perspective portrait data of the user and mining the potential portrait information in combination with the user's habits. The user portrait is combined with the knowledge retrieval process to ensure the pertinence of the question-and-answer knowledge and improve the accuracy of drug recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0080] Figure 1 A diagram of the network architecture that runs the drug recommendation system;
[0081] Figure 2 A process architecture diagram for drug recommendation provided in an embodiment of the present application;
[0082] Figure 3 A flowchart of a drug recommendation method provided in an embodiment of the present application;
[0083] Figure 4 A schematic diagram of a scenario of a drug recommendation method provided in an embodiment of the present application;
[0084] Figure 5 A schematic diagram of another scenario of a drug recommendation method provided in an embodiment of the present application;
[0085] Figure 6 A flowchart of a question-and-answer analysis provided in an embodiment of the present application;
[0086] Figure 7 A schematic diagram of the structure of a drug recommendation device provided in an embodiment of the present application;
[0087] Figure 8 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0088] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0089] It should be understood that the drug recommendation method provided in the present application can be applied to a system or program in a terminal device that includes a drug recommendation function, such as a medical application. Specifically, the drug recommendation system can be run on Figure 1 In the network architecture shown in Figure 1 As shown in FIG. 1 , it is a network architecture diagram of the operation of the drug recommendation system. As can be seen from the figure, the drug recommendation system can provide a drug recommendation process with multiple information sources, that is, the current problem is determined through the acquisition operation on the terminal side, and then sent to the server for the corresponding drug recommendation process; it can be understood that Figure 1 A variety of terminal devices are shown in FIG. 1 . The terminal devices may be computer devices. In actual scenarios, more or fewer types of terminal devices may be involved in the process of drug recommendation. The specific number and type depend on the actual scenario and are not limited here. In addition, Figure 1 One server is shown in the figure, but in actual scenarios, multiple servers may be involved, especially in multidisciplinary solution scenarios, and the specific number of servers depends on the actual scenario.
[0090] In this embodiment, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected through wired or wireless communication, and the terminal and the server can be connected to form a blockchain network, which is not limited in this application.
[0091] It is understandable that the above-mentioned drug recommendation system can run on a personal mobile terminal, for example: as an application such as smart medical care, it can also run on a server, and it can also run on a third-party device to provide drug recommendations to obtain the drug recommendation processing results of the information source; the specific drug recommendation system can be run in the above-mentioned device in the form of a program, or it can be run as a system component in the above-mentioned device, and it can also be run as a cloud service program. The specific operation mode depends on the actual scenario and is not limited here.
[0092] With the continuous development of artificial intelligence technology, large language model question-answering technology has been widely used in conversational services in various fields.
[0093] In the medical field, especially in the rational use of drugs, since the answers given by intelligent technology may have a direct impact on patients' judgment of their own condition and choice of treatment options, it puts higher demands on the accuracy and stability of question-answering technology. Therefore, how to make accurate drug recommendations has become a problem.
[0094] In order to solve the above problems, this application proposes a drug recommendation method, which is applied to Figure 2 In the process framework of drug recommendation shown in Figure 2 As shown, a process architecture diagram of drug recommendation provided in an embodiment of the present application is provided. The current question is determined through interactive operations on the terminal side and then sent to the server for answering. The answering process is combined with the user portrait. The portrait is constructed by calling the user's historical conversations to build a comprehensive portrait, and then knowledge retrieval is performed based on the portrait. The output instructions are adaptively adjusted according to the portrait to obtain the content of drug recommendation.
[0095] It is understandable that the drug recommendation method provided in the present application can be written as a program as a processing logic in a hardware system, or as a drug recommendation device, which implements the above processing logic in an integrated or external manner. As an implementation method, the drug recommendation device obtains the current question and historical dialogue initiated by the target user; then extracts the entity of the current question and historical dialogue to obtain the medical portrait information corresponding to the target user; and semantically understands the historical dialogue to obtain the habit information corresponding to the target user, so as to configure the potential portrait information corresponding to the target user according to the habit information; then performs knowledge retrieval based on the current question and medical portrait information to obtain prompt information, and obtains the target drug suitable for the target user through the prompt information, and the knowledge retrieval process corresponding to the prompt information is affected by the tendency parameter corresponding to the potential portrait information; and then generates drug recommendation information indicating the target drug according to the potential portrait information. Thus, the drug recommendation process combined with the user portrait is realized, and the integrity of the user portrait is improved by expanding the multi-perspective portrait data of the user and mining the potential portrait information in combination with the user's habits, and the user portrait is combined in the knowledge retrieval process to ensure the pertinence of the question-and-answer knowledge and improve the accuracy of drug recommendation.
[0096] Combined with the above process architecture, the following will introduce the drug recommendation method in this application. Please refer to Figure 3 , Figure 3 A flowchart of a drug recommendation method provided in an embodiment of the present application, the embodiment of the present application at least includes the following steps:
[0097] 301. Obtain the current question and historical conversations initiated by the target user.
[0098] In this embodiment, the current question initiated by the target user can be input in text, voice, or other input methods, and the specific method depends on the actual scenario. Correspondingly, the current question is the question about medical consultation input by the user, and the historical conversation is the user's historical record of medical consultation. The data source of the historical record can be the same interactive device (such as a medical robot), the same medical provider (such as a hospital), or a combination of multiple data sources (such as conversation information uploaded to the cloud). The specific source and combination of historical data depends on the actual scenario and is not limited here.
[0099] It is understandable that the historical conversation may be a conversation related to the current issue. For example, if the current conversation is a disease consultation, the historical conversation is the medical record information of the user and the conversation content related to the medical record information.
[0100] 302. Perform entity extraction on the current question and historical conversations to obtain the medical portrait information corresponding to the target user.
[0101] In this embodiment, the medical portrait information corresponding to the target user is a labeled display of the collection of medication information involved in the treatment or prevention of the disease by the user. Therefore, the entity extraction of the current question and the historical conversation is performed, that is, the process of portrait construction. For the process of medical portrait construction, the current question and the historical conversation can be first input into the entity relationship extraction model for information extraction to obtain the object entity and the medical entity; then the medical entity can be input into the portrait confidence evaluation model for binary classification to obtain the classification score of the medical entity belonging to the object entity; and the entity is screened based on the classification score to configure the portrait archive corresponding to the object entity; and then the medical portrait information is obtained by calling the portrait archive of the object entity matching the target user.
[0102] Specifically, the object entity can be a personal pronoun or other indicative vocabulary type, while the medical entity is an entity related to medication or treatment. Therefore, for a user's question, the entity relationship extraction model can be used to extract information from the personal pronouns and medication-related entities in the question. For example, for the question "My father just had a kidney stone surgery and developed a urinary tract infection. He has been taking cefixime dispersible tablets for two and a half days. How many days can he take it at most? Should he take other medicines?" The extracted information includes the person "father", the disease "kidney stone" and "urinary tract infection", the surgery "kidney stone surgery", the drug "cefixime dispersible tablets", the time attributes "just" and "two and a half days", and the corresponding relationships between the disease, surgery, and drug entities and the personal pronouns and time attributes.
[0103] Furthermore, for the binary classification process based on the portrait confidence evaluation model, the entities such as diseases, surgeries, and drugs are marked in the question and then input into the portrait confidence evaluation model for binary classification to obtain the confidence that the medical entity belongs to the medical portrait information of the person. For example, "kidney stones" will get a higher score in the input "I had ##kidney stones## last year", but will get a lower score in the input "I want to know what the symptoms of ##kidney stones## are".
[0104] In addition, after the medical entity whose portrait confidence reaches the threshold is stored in the portrait archive of the corresponding role, the occurrence time of the medical entity can be calculated and recorded based on the extracted time attribute and the time when the question is raised, which facilitates the portrait management process of disease evolution based on time sequence.
[0105] Optionally, in some possible scenarios, the user's disease medication process is changing, that is, the dosage or type of drugs used in different disease stages is different. At this time, the medical portraits configured according to the current problem and historical dialogue may be contradictory, and the priority processing process can be performed at this time. That is, before using the portrait information, the portrait content is standardized and screened, and then the historical portrait and the current problem portrait are successively judged for contradiction and content priority to obtain the portrait that should be actually used. Therefore, for the determination of medical portrait information, first, the archived portrait information is obtained by calling the portrait archive of the object entity matching the target user; then the current portrait and the historical portrait in the archived portrait information are determined, where the current portrait matches the current problem and the historical portrait matches the historical dialogue; then the current portrait and the historical portrait are detected for contradictions, so as to adjust the archived portrait information to medical portrait information, and the priority of the current portrait is greater than the priority of the historical portrait when the contradiction is selected. In this way, the negative impact that may be brought about by historical dialogues is avoided, the portrait information from different sources is effectively decoupled, and the situation of confusion or error in combining portraits in the large model answer is avoided.
[0106] Specifically, for the process of conflict resolution, the current portrait and the historical portrait can be mapped to standard medical terms based on medical resources; then, the standard medical terms are detected for conflicts through preset rules to obtain conflicting items; and then, the conflicting items are screened out to adjust the archived portrait information to medical portrait information.
[0107] In a possible scenario, for the determination process of the above-mentioned medical portrait information, the extracted portrait entities can be mapped to standard medical terms using medical resource mapping methods and entity fuzzy matching algorithms, and contradictory items can be screened and removed using empirical rules. For example, a portrait with an age of "8 years old" and a gender of "male" cannot have a disease history of "uterine fibroids". Then, the portrait information that still affects the user can be screened based on the portrait entity recording time and the cure cycle and medication cycle of each disease.
[0108] Then, the current portrait is compared with the historical portrait. On the one hand, the historical portrait is switched by identifying the people mentioned in the current portrait. For example, if the "role" in the current portrait is "mother", the historical portrait should be switched to the file of the user's mother. On the other hand, the specific contents of the current portrait and the historical portrait are detected for contradictions. When there is a contradiction, the current portrait content is given priority, thus realizing the process of portrait priority judgment.
[0109] This embodiment supports parallel processing of historical portraits and current portraits in structured knowledge retrieval, establishes priority rules for different portrait information, and implements portrait conflict resolution. At the same time, it uses the identification of strong conflicting information to reach a judgment on role replacement, avoiding the risk of answering caused by incorrect portrait mounting.
[0110] 303. Perform semantic understanding on historical conversations to obtain habit information corresponding to the target user, so as to configure potential profile information corresponding to the target user according to the habit information.
[0111] In this embodiment, in order to improve the comprehensiveness of the user portrait in the medication recommendation process, potential problems are mined from the patient portrait and the questions currently asked by the patient, and structured and unstructured knowledge retrieval is performed on these potential problems in addition to the knowledge retrieval of the current problem, thereby providing stable knowledge support for the generation of a large model combined with the portrait.
[0112] Therefore, for potential portrait information, that is, mining user habits by mining potential problems from patient portraits and the questions currently asked by patients. The user habits are related to the drug recommendation process, and because the drug recommendation process is carried out in the form of questions and answers, the habit information can include question-and-answer habits and medication habits.
[0113] Specifically, to determine the potential portrait information, the historical conversation can first be input into the large language model for semantic understanding, so as to score the preset indicators and obtain indicator score information. The preset indicators are set for question-and-answer habits and medication habits; then, the question-and-answer habits and medication habits are parameterized according to the indicator score information to obtain habit information; and then the potential portrait information corresponding to the target user is configured according to the habit information.
[0114] In a possible scenario, the process of scoring the preset indicators can be to input the user's multi-round conversation history into the big model for personalized analysis in units of conversations, score and record according to the predefined personalized indicator items, and obtain the user's personalized question and answer parameters in terms of "question and answer habits" and "medication habits". For example, the conversation "[User] I have a big pimple on my face, it doesn't hurt, what's going on? [Big model] How big is this pimple? Where is it exactly? [User] Don't be long-winded, just tell me the possible situation." will make the user get a high score in the "direct answer tendency" indicator item in "question and answer habits", and a low score in the "tolerance for counter-questions" indicator item; for another example, the conversation "[User] I often feel uncomfortable in the stomach, fatigue, and cold hands. What medicine should I take? [Big model] According to your situation, I recommend the prescription Xiangsha Liujunzi Decoction to you... [User] No, Chinese medicine is too bitter, is there any capsule preparation?" will make the user get a low score in the "Chinese medicine tendency" indicator item of "medication habits", and a high score in the "capsule preparation tendency" indicator item. Afterwards, all the index scores of the user are summarized and averaged, and we can get the user's question-answering habit parameters "{'direct answer tendency': 0.8, 'tolerance for counter-questions': 0.2, 'detailed analysis tendency': 0.5, 'humorous answer tendency': 0.7,......}" and medication habit parameters "{'traditional Chinese medicine tendency': 0.1, 'capsule preparation tendency': 0.7, 'tablet tendency': 0.5, 'new drug tendency': 0.4,......}".
[0115] It can be seen that the habit information in this embodiment includes the extraction process of medication portraits of "double habit" potential portraits. Based on the cooperation of large and small models, multi-angle portrait extraction is carried out from three perspectives: current problems, historical problems, and overall conversation records, realizing the extraction of all-round portraits of users who ask questions about medication.
[0116] Furthermore, after obtaining the potential image information, a multi-dimensional image drug recommendation process combining the medical image information and the potential image information is performed. Figure 4 As shown, Figure 4 A schematic diagram of a scenario of a drug recommendation method provided in an embodiment of the present application; the figure shows the following steps:
[0117] S1: Extraction of medical image information. This is the process of step 302 above, which uses the entity relationship extraction model to identify the person, medication-related medical entities and the relationship between them from the conversation between the user and the big model, and then uses the image confidence evaluation model to identify and record the patient's medical image information from the conversation between the patient and the big model, such as the patient's disease history, medication history, surgical history, and the patient's group of people.
[0118] S2: Extraction of latent profile information. This is the process of step 303 above. Based on the language understanding ability of the big model, the user's question-answering habits and medication habits are collected and summarized from the conversation history between the user and the big model, and recorded in the form of confidence according to specific indicators, thereby obtaining the user's personalized medication question-answering parameters.
[0119] S3: Preprocessing of portrait information. This is the process of conflict handling in step 302 above. Before using the portrait information, the portrait content is standardized and screened, and then the historical portrait and the current problem portrait are successively judged for conflicts and content priority to obtain the portrait that should be actually used.
[0120] S4: Structured knowledge retrieval with portraits. Based on the drug knowledge base, structured knowledge retrieval related to user questions combined with portraits is performed. It is divided into two parts: structured knowledge retrieval for questions and structured knowledge retrieval for portraits. The former provides knowledge that can help the big model answer the user's current questions, while the latter provides drug contraindications, risk warnings, and medication regimen prompts based on the user's own situation.
[0121] S5: Drug recommendation with portraits. For users who are seeking drug recommendations, the big model is used to gradually reason through thought chains to obtain candidate drugs that may be suitable for the user.
[0122] S6: Unstructured knowledge retrieval with portraits. Based on Internet knowledge, unstructured knowledge retrieval is performed on user questions combined with portraits. It is also divided into two parts: unstructured knowledge retrieval for questions and unstructured knowledge retrieval for portraits. The former retrieves Internet knowledge from the Internet that can help the big model answer the user's current question. The latter combines the portrait with the drugs mentioned in the user's question to construct the portrait to be retrieved sub-questions, and retrieves and screens the knowledge related to the portrait, such as drug contraindications and risk warnings, from the Internet.
[0123] S7: Adjustment of answer tendency in combination with latent portraits. Based on the latent portrait parameters, the large model instructions are adjusted and the retrieved unstructured knowledge is rearranged. The former is used for explicit large model answer scheduling and style adjustment, while the latter implicitly affects the answer tendency and emphasis by adjusting the knowledge type priority.
[0124] Next, combine Figure 4 The execution flow shown illustrates the drug recommendation process of multi-dimensional portraits that combine medical portrait information and potential portrait information.
[0125] 304. Based on the current question and the medical portrait information, knowledge retrieval is performed to obtain prompt information, and the target drug suitable for the target user is obtained through the prompt information. The knowledge retrieval process corresponding to the prompt information is affected by the tendency parameters corresponding to the potential portrait information.
[0126] In this embodiment, the prompt information is used to enhance the retrieval of the large language model, that is, for the knowledge retrieval process with portraits, potential problems are mined from the patient portraits and the questions currently asked by the patients, and structured and unstructured knowledge retrieval is performed on these potential problems in addition to the knowledge retrieval of the current problems, thereby providing stable knowledge support for the generation of a large model combined with portraits.
[0127] Therefore, in the process of combining knowledge retrieval with drug recommendation, we can first determine the drug knowledge base associated with the current question; then perform structured knowledge retrieval on the current question and medical image information based on the drug knowledge base to obtain structured prompt content; and perform unstructured knowledge retrieval on the current question and medical image information based on Internet knowledge to obtain unstructured prompt content; then answer the current question and medical image information based on the large language model to obtain candidate drugs; then combine the structured prompt content and the unstructured prompt content to obtain prompt information, and select the target drug suitable for the target user from the candidate drugs based on the prompt information.
[0128] It is understandable that the structured knowledge retrieval of medication combined with portraits, that is, the process of determining the structured prompt content, can be based on the drug knowledge base. Since the knowledge in the drug knowledge base has the characteristic of structuredness, that is, there is correlation between knowledge, it can also be called a drug structured knowledge base; that is, the generation process of knowledge retrieval with portrait question and answer of medication scenarios combined with the drug knowledge base is realized, and the retrieval rules are designed from the starting point of risk warnings and medication reminders, realizing the structured knowledge retrieval of drugs combining user questions and portraits.
[0129] Specifically, for the extraction of structured prompt content, we can first perform knowledge retrieval on the current problem based on the drug knowledge base to obtain structured text knowledge, which includes entity extraction results and intent classification results; if the intent classification result leads to the use of drugs, risk knowledge matching is performed in the drug knowledge base based on the entity extraction result to obtain multiple risk items; then determine the content intersection of multiple risk items to obtain structured prompt content.
[0130] In one possible scenario, the risk knowledge matching process is as follows: Figure 5 As shown, Figure 5 A schematic diagram of another drug recommendation method provided in an embodiment of the present application; the content shown in the figure can be applied to Figure 4 In step S4, first, knowledge retrieval is performed for the current user question based on the entity extraction and intent classification model. For example, for the question "How many times a day should I take ibuprofen capsules?", the corresponding structured text knowledge is indexed based on the entity extraction result "ibuprofen capsules" and the intent classification result "dosage query".
[0131] Furthermore, when the intent classification result of the question may lead to the use of drugs, structured knowledge matching is performed on the image content. Figure 5 As shown, for the drug entities mentioned in the question, their structured risk items are extracted, including: indication items, contraindications items, interaction items, adverse reaction items, and ingredient items. The intersection with the risk items in the portrait: diseases, drugs, populations, surgeries, allergies and their equivalent medical entities and superior and subordinate medical entities is taken, and medical judgment is performed on the hit intersection entities to obtain conclusions such as whether the user should apply, use with caution, prohibit or delay the use of the drug, thereby forming structured knowledge for the portrait.
[0132] In addition, for the unstructured knowledge retrieval scheme of medication combined with portraits. This embodiment provides a knowledge retrieval generation process of medication scenarios with portrait questions and answers based on Internet knowledge, which completes the screening and filtering of portrait-related retrieval results by positive and negative judgment of knowledge opinions and knowledge voting, greatly improving the effectiveness of unstructured knowledge retrieval results with portraits.
[0133] Specifically, for the process of unstructured knowledge retrieval, the current problem is first split into multiple sub-problems, and a portrait retrieval clause is constructed based on the medical portrait information; then the content of Internet knowledge is extracted to obtain index keywords; and the retrieval results are determined by calculating the similarity scores of the sub-problems, portrait retrieval clauses and index keywords; then the retrieval results are binary classified based on knowledge orientation to obtain classification results; and then the unstructured prompt content is determined according to the proportion of negative knowledge in the classification results.
[0134] It can be understood that the above unstructured knowledge retrieval process can correspond to Figure 4 In step S6 shown, the user question with multiple intentions is split into multiple sub-questions using a large model, and then Internet knowledge retrieval is performed on the original user question and the sub-questions based on conventional web page knowledge retrieval technology. That is, first, index keywords are extracted from the Internet medical knowledge content, and then the sentence similarity score between the question and the web page title, and the similarity score between the question keywords and the knowledge index keywords are calculated using a small model. Finally, the Internet knowledge is sorted based on the comprehensive score of the knowledge, and re-sorted in a way that the crowd entities mentioned in the portrait are given priority, and the topN are taken as the retrieval results.
[0135] In addition, for the process of constructing image retrieval clauses based on medical image information, that is, when the intent classification model obtains the intent related to the use of drugs, for the drug entity mentioned in the question, its image retrieval clause is constructed based on the image information. For example, for the question "What is the dosage of atorvastatin calcium tablets", if the disease history includes "diabetes", then the clause "Can people with diabetes take atorvastatin calcium tablets" is constructed; if the population is "elderly", then the clause "Is atorvastatin calcium tablets suitable for the elderly" is constructed. Use the same method as above to perform Internet knowledge retrieval.
[0136] Furthermore, the process of binary classification of the search results based on knowledge orientation, that is, since the number of portrait entities M may be as many as ten or more, the M*N knowledge retrieved from the above is likely to exceed the upper limit of the large model input or make the large model too difficult to understand, and the knowledge is filtered by positive and negative voting of opinions. That is, the BERT-based text positive and negative classification model is trained to binary classify Internet knowledge content. For example, if the knowledge believes that "taking atorvastatin calcium tablets may have the side effect of increasing blood sugar, and atorvastatin calcium tablets are not recommended for diabetic patients", then the knowledge is negative; if the knowledge believes that "atorvastatin calcium tablets have no contraindications for diabetes, and it is not a big problem to take atorvastatin calcium tablets with diabetes", then the knowledge is positive. For the N Internet knowledge retrieved by a certain portrait search clause, if more than N / 2 of the knowledge is negative, then 1 negative knowledge is retained, and if more than N / 2 of the knowledge is positive, then the knowledge is not retained. Thus, the portrait risk warning combined with external knowledge is realized.
[0137] It can be seen that this embodiment realizes the identification of necessary information in knowledge retrieval with portraits through structured and unstructured retrieval with positive and negative judgment of viewpoints, reduces the knowledge redundancy rate and answer redundancy rate, and reduces the difficulty of knowledge integration in knowledge retrieval generation, avoiding the explosion of the input length of the large model. That is, by actively controlling only the necessary portrait-related knowledge to be input to the large model, adaptive portrait combination is achieved, and the redundant answer rate of the portrait combination is reduced.
[0138] In addition, for the process of determining candidate drugs, that is, the process of recommending drugs combined with portraits, this embodiment designs a drug recommendation scheme with portraits based on a large model in a thinking chain manner, and realizes drug recommendations that closely revolve around user needs by focusing on the user's main demands, secondary demands, and demands with portraits.
[0139] Specifically, the determination of candidate drugs is to analyze the current question and medical image information based on the large language model to obtain a candidate list. The question analysis includes feasibility questions and answers, appeal questions and answers, object demand questions and answers, recommendation type questions and answers, and medical history questions and answers; then the question analysis is repeated based on the candidate list to obtain candidate drugs.
[0140] In a possible scenario, for the above problem analysis process, when the intent classification model results contain the intent of "drug recommendation", the user's question and user profile information are input into the big model to require the recommendation of candidate drugs, and the big model is required to gradually analyze the user's needs and information using instructions. The specific analysis process is as follows: Figure 6 As shown, Figure 6 A flowchart of a question-and-answer analysis provided for an embodiment of the present application is shown in the figure; the first step is to analyze whether the user's condition is suitable for treatment with drugs; the second step is to consider the user's main demands, that is, whether to require the recommendation of drugs for diseases, symptoms or indicators, or to require the recommendation of drugs with certain efficacy or substitutes for certain drugs, etc.; the third step is to consider whether the user has detailed requirements for drugs, that is, whether there are requirements for drug types, dosage forms, and routes of administration; the fourth step is to consider whether the user has priority drug types based on the portrait information, for example, if the user is a child, children's drugs should be recommended first, and if the user is a middle-aged woman with menopausal symptoms, menopausal drugs should be recommended first; the fifth step is to analyze the disease history, medication history, allergy history, etc. in the portrait, and reflect on its impact on the user's use of drugs; the sixth step is to let the large model output a preliminary list of candidate drug names; the seventh step is to simply repeat the thinking from the second to fifth steps again for the specific indications and contraindications of the drugs recommended in the sixth step (i.e., repeat the problem analysis based on the candidate list); the eighth step is to output the final candidate drug list based on the reflection results of the seventh step.
[0141] Through the above structured and unstructured knowledge retrieval process, a relatively complete set of candidate drugs can be obtained. However, in order to further improve the matching degree of drugs to users, candidate drugs can also be optimized based on potential profile information. That is, first determine the medication habits indicated by the potential profile information; then fine-tune the structured knowledge retrieval, unstructured knowledge retrieval and candidate drug determination process based on medication habits to adjust the target drug.
[0142] Specifically, the above process of optimizing candidate drugs based on potential profile information may correspond to Figure 4 Step S7 shown is the process of fine-tuning the structured knowledge retrieval based on medication habits, that is, fine-tuning the entity mapping step in the structured knowledge retrieval based on the personalized question-answer parameter of "medication habits", and recommending knowledge that is more in line with user habits when circumstances permit. For example, if the user's "capsule preparation tendency" score is high, when asking "how to use amoxicillin", it will be preferentially mapped to the usage and dosage knowledge of "amoxicillin capsules" rather than other dosage forms of amoxicillin.
[0143] In addition, for the process of fine-tuning the candidate drug determination process based on medication habits, the drug recommendation thinking chain can be fine-tuned based on the personalized question and answer parameters of "medication habits", and the user's medication habits can be textualized as one of the instruction requirements for problem analysis in S5, so as to recommend drugs that are more in line with the user's medication habits without affecting other demands.
[0144] In addition, in the process of fine-tuning unstructured knowledge retrieval based on medication habits, the knowledge reordering in the unstructured knowledge retrieval can be fine-tuned based on the "medication habits" personalized question and answer parameters, and high-scoring "medication habits" parameter items can be added to the knowledge keyword matching, so that knowledge containing relevant keywords can obtain relatively higher scores, so that the answer tendency is more in line with the user's medication habits.
[0145] It can be seen that the above-mentioned personalized interaction process based on latent portraits conducts an overall analysis of the past medication preferences and attention points of specific users through the conversation history, summarizes and parameterizes the user's medication habits, and incorporates this parameter information into knowledge retrieval, thereby adjusting the answer style of the large model and realizing personalized interaction in medication scenarios.
[0146] 305. Generate drug recommendation information indicating the target drug based on the potential profile information.
[0147] In this embodiment, drug recommendation information indicating the target drug is generated based on the potential portrait information, that is, the question and answer habits in the potential portrait information are combined to realize personalized question and answer interaction in the medication scenario by combining the user's potential question and answer habits and medication habits, that is, customized intelligent large-model question and answer combined with the user's situation is realized.
[0148] Specifically, to determine the drug recommendation information, we can first determine the question-answering habits indicated by the potential portrait information; then configure the question-answering style information for the target user through the question-answering habits; and then adjust the recommended content containing the target drug based on the question-answering style information to obtain the drug recommendation information.
[0149] It is understandable that the above recommendation process can be applied to Figure 4In step S7 shown, the knowledge integration instruction and knowledge retrieval process are fine-tuned based on the personalized question-and-answer parameters of "question-and-answer habits" to adjust the answer style (question-and-answer style information). For example, for users with a low "direct answer tendency" and a high "reverse question tolerance" score, if an intention related to "seeking diagnosis" is detected, such as asking "what medicine to take for a headache", the large model rewrites the sub-question into "what may be the cause of a headache", "other symptoms that are easily accompanied by a headache", and the knowledge integration instruction adds the requirement of "understanding the condition through reverse questioning", so that the answer is adjusted to reverse questioning the user's other symptoms, etc.; for users with a high "direct answer tendency" and a low "reverse question tolerance" score, in the same situation, the original question is directly retrieved, and the user's question is answered as directly as possible. Thereby realizing the answer tendency adjustment process combined with the potential portrait.
[0150] The above-mentioned knowledge retrieval generation process combines the user's potential medication question and answer needs. Through keyword-based retrieval ranking technology and expert experience rules based on medication question and answer demand analysis, it realizes the on-demand rearrangement of knowledge retrieval results and the adjustment of the method and style of the large model answer, thus realizing personalized question and answer combined with the user's potential portrait.
[0151] In combination with the above embodiments, it can be known that by obtaining the current question and historical conversation initiated by the target user; then performing entity extraction on the current question and historical conversation to obtain the medical portrait information corresponding to the target user; and performing semantic understanding on the historical conversation to obtain the habit information corresponding to the target user, so as to configure the potential portrait information corresponding to the target user according to the habit information; then performing knowledge retrieval based on the current question and medical portrait information to obtain prompt information, and obtaining the target drug suitable for the target user through the prompt information, the knowledge retrieval process corresponding to the prompt information is affected by the tendency parameter corresponding to the potential portrait information; and then generating drug recommendation information indicating the target drug according to the potential portrait information. Thus, the drug recommendation process combined with the user portrait is realized, and the integrity of the user portrait is improved by expanding the multi-perspective portrait data of the user and mining the potential portrait information in combination with the user's habits, and the user portrait is combined with the knowledge retrieval process to ensure the pertinence of the question-and-answer knowledge and improve the accuracy of the drug recommendation.
[0152] In order to better implement the above solution of the embodiment of the present application, the following also provides related devices for implementing the above solution. Figure 7 , Figure 7 This is a schematic diagram of the structure of a drug recommendation device provided in an embodiment of the present application. The recommendation device 700 includes:
[0153] An acquisition unit 701 is used to acquire the current question and historical conversations initiated by the target user;
[0154] The processing unit 702 is used to extract entities from the current question and the historical conversation to obtain medical portrait information corresponding to the target user;
[0155] The processing unit 702 is further configured to perform semantic understanding on the historical conversation to obtain habit information corresponding to the target user, so as to configure potential portrait information corresponding to the target user according to the habit information;
[0156] The processing unit 702 is further configured to perform knowledge retrieval based on the current question and the medical portrait information to obtain prompt information, and obtain a target drug suitable for the target user through the prompt information, wherein the knowledge retrieval process corresponding to the prompt information is affected by the tendency parameter corresponding to the potential portrait information;
[0157] The recommendation unit 703 is used to generate drug recommendation information indicating the target drug according to the potential portrait information.
[0158] Optionally, in some possible implementations, the processing unit 702 is used to input the current question and the historical conversation into an entity relationship extraction model for information extraction to obtain an object entity and a medical entity when performing entity extraction on the current question and the historical conversation to obtain the medical portrait information corresponding to the target user; input the medical entity into a portrait confidence evaluation model for binary classification to obtain a classification score for the medical entity belonging to the object entity; perform entity screening based on the classification score to configure a portrait archive corresponding to the object entity; and obtain the medical portrait information by calling the portrait archive of the object entity matching the target user.
[0159] Optionally, in some possible implementations, the processing unit 702 is used to obtain archived portrait information by calling the portrait archive of the object entity matching the target user when the medical portrait information is obtained by calling the portrait archive of the object entity matching the target user; determine the current portrait and historical portrait in the archived portrait information, the current portrait matches the current question, and the historical portrait matches the historical conversation; perform contradiction detection on the current portrait and the historical portrait to adjust the archived portrait information to the medical portrait information, and in the case of contradiction selection, the priority of the current portrait is greater than the priority of the historical portrait.
[0160] Optionally, in some possible implementations, the processing unit 702 is used to map the current portrait and the historical portrait into standard medical terms based on medical resources when performing contradiction detection on the current portrait and the historical portrait to adjust the archived portrait information to the medical portrait information; perform contradiction detection on the standard medical terms according to preset rules to obtain contradictory items; and screen out the contradictory items to adjust the archived portrait information to the medical portrait information.
[0161] Optionally, in some possible implementations, the processing unit 702 is used to input the historical conversation into a large language model for semantic understanding when the habit information corresponding to the target user is obtained by semantically understanding the historical conversation, so as to configure the potential portrait information corresponding to the target user according to the habit information, so as to score the preset indicators and obtain indicator score information, wherein the preset indicators are set for question-and-answer habits and medication habits; configure parameters of the question-and-answer habits and the medication habits according to the indicator score information to obtain the habit information; and configure the potential portrait information corresponding to the target user according to the habit information.
[0162] Optionally, in some possible implementations, the processing unit 702 is used to determine a drug knowledge base associated with the current question when the prompt information is obtained by performing knowledge retrieval based on the current question and the medical image information, and the target drug suitable for the target user is obtained through the prompt information; perform structured knowledge retrieval on the current question and the medical image information based on the drug knowledge base to obtain structured prompt content; perform unstructured knowledge retrieval on the current question and the medical image information based on Internet knowledge to obtain unstructured prompt content; answer the current question and the medical image information based on a large language model to obtain candidate drugs; obtain the prompt information by combining the structured prompt content and the unstructured prompt content, and select the target drug suitable for the target user from the candidate drugs based on the prompt information.
[0163] Optionally, in some possible implementations, the processing unit 702 is used to perform knowledge retrieval on the current question based on the drug knowledge base to obtain structured text knowledge when performing structured knowledge retrieval on the current question and the medical image information based on the drug knowledge base to obtain structured prompt content, and the structured text knowledge includes entity extraction results and intent classification results; if the intent classification result leads to the use of drugs, risk knowledge matching is performed in the drug knowledge base based on the entity extraction result to obtain multiple risk items; and the content intersection of the multiple risk items is determined to obtain the structured prompt content.
[0164] Optionally, in some possible implementations, the processing unit 702 is used to split the current question into multiple sub-questions and construct a portrait retrieval clause based on the medical portrait information when performing unstructured knowledge retrieval on the current question and the medical portrait information based on Internet knowledge to obtain unstructured prompt content; extract content from the Internet knowledge to obtain index keywords; determine the retrieval results by calculating the similarity scores between the sub-questions, the portrait retrieval clauses and the index keywords; classify the retrieval results into two categories based on knowledge orientation to obtain classification results; and determine the unstructured prompt content based on the proportion of negative knowledge in the classification results.
[0165] Optionally, in some possible implementations, the processing unit 702 is used to answer the current question and the medical image information based on the large language model to obtain candidate drugs, including performing question analysis on the current question and the medical image information based on the large language model to obtain a candidate list, the question analysis including feasibility questions and answers, appeal questions and answers, object demand questions and answers, recommendation type questions and answers, and medical history questions and answers; repeating the question analysis based on the candidate list to obtain the candidate drugs.
[0166] Optionally, in some possible implementations, the processing unit 702 is also used to determine the medication habits indicated by the potential portrait information; based on the medication habits, fine-tune the structured knowledge retrieval, unstructured knowledge retrieval and the candidate drug determination process to adjust the target drug.
[0167] Optionally, in some possible implementations, the recommendation unit 703 is used to determine the question and answer habits indicated by the potential portrait information when generating the drug recommendation information indicating the target drug based on the potential portrait information; configure the question and answer style information for the target user through the question and answer habits; and adjust the recommended content containing the target drug based on the question and answer style information to obtain the drug recommendation information.
[0168] By obtaining the current question and historical conversation initiated by the target user; then extracting entities from the current question and historical conversation to obtain the medical portrait information corresponding to the target user; and semantically understanding the historical conversation to obtain the habit information corresponding to the target user, so as to configure the potential portrait information corresponding to the target user according to the habit information; then performing knowledge retrieval based on the current question and medical portrait information to obtain prompt information, and obtaining the target drug suitable for the target user through the prompt information. The knowledge retrieval process corresponding to the prompt information is affected by the tendency parameters corresponding to the potential portrait information; and then generating drug recommendation information indicating the target drug according to the potential portrait information. Thus, the drug recommendation process combined with the user portrait is realized, and the integrity of the user portrait is improved by expanding the multi-perspective portrait data of the user and mining the potential portrait information in combination with the user's habits. The user portrait is combined with the knowledge retrieval process to ensure the pertinence of the question-and-answer knowledge and improve the accuracy of drug recommendations.
[0169] The drug recommendation device provided in this embodiment belongs to the same application concept as the method provided in the above embodiments of this application, and can execute the drug recommendation method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the drug recommendation method. For technical details not fully described in this embodiment, please refer to the specific processing content of the drug recommendation method provided in the above embodiments of this application, and will not be repeated here.
[0170] The functions implemented by the above acquisition unit 701, processing unit 702 and recommendation unit 703 may be implemented by the same or different processors, respectively, and are not limited in the embodiment of the present application.
[0171] It should be understood that each unit in the above device can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the unit in the device can be implemented in the form of a hardware circuit, and the functions of some or all units can be realized by designing the hardware circuit. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all units above are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all units above. All units of the above device can be implemented in the form of a processor calling software, or in the form of a hardware circuit, or in the form of a processor calling software, and the remaining part can be implemented in the form of a hardware circuit.
[0172] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
[0173] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0174] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0175] The embodiment of the present application also provides a drug recommendation device; the drug recommendation device includes a processor and an input-output component. The input-output component is used to obtain the current question;
[0176] The processor is used to answer the target question in the current problem obtained by the input-output component by executing any one of the drug recommendation methods in the above embodiments.
[0177] The above-mentioned interface circuit can be any interface circuit that can realize the 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.
[0178] Optionally, the embodiment of the present application further provides a system, wherein the interactive client is used to obtain the current question and send the current question to the server, and to display the drug recommendation result output by the server;
[0179] The server is used to recommend drugs for the current problem obtained by the input and output components by executing the drug recommendation method described in any one of the above embodiments.
[0180] Another embodiment of the present application also provides a drug recommendation device, see Figure 8 As shown, the device includes:
[0181] Memory 800 and processor 810;
[0182] The memory 800 is connected to the processor 810 and is used to store programs;
[0183] The processor 810 is used to implement the drug recommendation method disclosed in any of the above embodiments by running the program stored in the memory 800.
[0184] Specifically, the above-mentioned drug recommendation device may also include: a bus, a communication interface 820 , an input device 830 and an output device 840 .
[0185] The processor 810, the memory 800, the communication interface 820, the input device 830 and the output device 840 are connected to each other via a bus.
[0186] A bus may include a pathway that transfers information between components of a computer system.
[0187] The processor 810 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 scheme 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.
[0188] The processor 810 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0189] The memory 800 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 800 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 storage, a flash, and the like.
[0190] The input device 830 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.
[0191] Output device 840 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0192] The communication interface 820 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.
[0193] The processor 810 executes the program stored in the memory 800 and calls other devices, which can be used to implement each step of any drug recommendation method provided in the above embodiments of the present application.
[0194] 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, which, when executed by a processor, enable the processor to execute the steps of the drug recommendation method according to various embodiments of the present application described in any of the above embodiments of this specification.
[0195] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0196] In addition, the embodiment of the present application may also be a storage medium on which a computer program is stored. The computer program is executed by a processor to execute the steps of the drug recommendation method according to various embodiments of the present application described in any of the above embodiments of this specification, and specifically the following steps may be implemented:
[0197] Get the current questions and historical conversations initiated by the target user;
[0198] Performing entity extraction on the current question and the historical conversation to obtain medical portrait information corresponding to the target user;
[0199] Performing semantic understanding on the historical conversation to obtain habit information corresponding to the target user, so as to configure potential profile information corresponding to the target user according to the habit information;
[0200] Performing knowledge retrieval based on the current question and the medical portrait information to obtain prompt information, and obtaining a target drug suitable for the target user through the prompt information, wherein the knowledge retrieval process corresponding to the prompt information is affected by the tendency parameter corresponding to the potential portrait information;
[0201] Generate drug recommendation information indicating the target drug based on the potential portrait information.
[0202] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0203] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0204] The steps in the methods of each embodiment of the present application can be adjusted in sequence, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0205] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0206] In the several embodiments provided in 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 only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, 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 interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0207] The modules or submodules described as separate components may or may not be physically separated, 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 they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0208] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0209] 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 composition and steps of each example have been generally described in the above description according to function. 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 to be beyond the scope of this application.
[0210] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0211] 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.
[0212] 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 drug recommendation method, characterized in that: include: Get the current questions and historical conversations initiated by the target user; Performing entity extraction on the current question and the historical conversation to obtain medical portrait information corresponding to the target user; Performing semantic understanding on the historical conversation to obtain habit information corresponding to the target user, so as to configure potential profile information corresponding to the target user according to the habit information; Performing knowledge retrieval based on the current question and the medical portrait information to obtain prompt information, and obtaining a target drug suitable for the target user through the prompt information, wherein the knowledge retrieval process corresponding to the prompt information is affected by the tendency parameter corresponding to the potential portrait information; Generate drug recommendation information indicating the target drug based on the potential portrait information.
2. The method according to claim 1, characterized in that The entity extraction of the current question and the historical conversation to obtain the medical portrait information corresponding to the target user includes: Inputting the current question and the historical dialogue into an entity relationship extraction model to extract information to obtain an object entity and a medical entity; Inputting the medical entity into the image confidence evaluation model for binary classification to obtain a classification score of the medical entity belonging to the object entity; Entity screening is performed based on the classification score to configure a portrait archive corresponding to the object entity; The medical image information is obtained by calling the image archive of the object entity matching the target user.
3. The method according to claim 2, characterized in that The obtaining of the medical portrait information by calling the portrait archive of the object entity matching the target user includes: Obtain archived portrait information by calling a portrait archive of an object entity matching the target user; Determine a current portrait and a historical portrait in the archived portrait information, wherein the current portrait matches the current question, and the historical portrait matches the historical conversation; The current portrait and the historical portrait are detected for contradictions, so as to adjust the archived portrait information to the medical portrait information. In case of contradiction selection, the priority of the current portrait is greater than the priority of the historical portrait.
4. The method according to claim 3, characterized in that The performing of contradiction detection on the current portrait and the historical portrait to adjust the archived portrait information to the medical portrait information includes: Mapping the current portrait and the historical portrait into standard medical terms based on medical resources; Performing contradiction detection on the standard medical terms according to preset rules to obtain contradictory terms; The conflicting items are screened out to adjust the archived image information to the medical image information.
5. The method according to claim 1, characterized in that The semantic understanding of the historical conversation to obtain the habit information corresponding to the target user, and configuring the potential portrait information corresponding to the target user according to the habit information, includes: Inputting the historical conversation into a large language model for semantic understanding to score preset indicators and obtain indicator score information, wherein the preset indicators are set for question-answering habits and medication habits; Performing parameter configuration on the question-answering habit and the medication habit according to the indicator score information to obtain the habit information; The potential portrait information corresponding to the target user is configured according to the habit information.
6. The method according to claim 1, characterized in that The step of performing knowledge retrieval based on the current question and the medical image information to obtain prompt information, and obtaining a target drug suitable for the target user through the prompt information, includes: Determining a pharmaceutical knowledge base associated with the current problem; Based on the drug knowledge base, a structured knowledge search is performed on the current question and the medical image information to obtain structured prompt content; Performing unstructured knowledge retrieval on the current problem and the medical image information based on Internet knowledge to obtain unstructured prompt content; Answer the current question and the medical image information based on the large language model to obtain candidate drugs; The prompt information is obtained by combining the structured prompt content and the unstructured prompt content, and a target drug suitable for the target user is selected from the candidate drugs based on the prompt information.
7. The method according to claim 6, characterized in that The structured knowledge retrieval of the current question and the medical image information based on the drug knowledge base to obtain structured prompt content includes: Performing knowledge retrieval on the current problem based on the drug knowledge base to obtain structured text knowledge, wherein the structured text knowledge includes entity extraction results and intent classification results; If the intention classification result leads to the use of drugs, risk knowledge matching is performed in the drug knowledge base based on the entity extraction result to obtain multiple risk items; Determine the content intersection of a plurality of the risk items to obtain the structured prompt content.
8. The method according to claim 6, characterized in that The unstructured knowledge retrieval of the current question and the medical image information based on Internet knowledge to obtain unstructured prompt content includes: Splitting the current question into multiple sub-questions, and constructing a portrait retrieval clause based on the medical portrait information; Extracting content from the Internet knowledge to obtain index keywords; Determine the search result by calculating the similarity score between the sub-question, the portrait search clause and the index keyword; Binary classify the search results based on knowledge orientation to obtain classification results; The unstructured prompt content is determined according to the proportion of negative knowledge in the classification result.
9. The method according to claim 6, characterized in that The step of answering the current question and the medical image information based on the large language model to obtain candidate drugs includes: Performing question analysis on the current question and the medical image information based on a large language model to obtain a candidate list, wherein the question analysis includes feasibility questions and answers, appeal questions and answers, object demand questions and answers, recommendation type questions and answers, and medical record questions and answers; The problem analysis is repeated based on the candidate list to obtain the candidate drugs.
10. The method according to claim 6, characterized in that The method further comprises: determining medication habits indicated by the potential profile information; Based on the medication habits, the structured knowledge retrieval, unstructured knowledge retrieval and the candidate drug determination process are fine-tuned to adjust the target drug.
11. The method according to claim 1, characterized in that: The generating of drug recommendation information indicating the target drug according to the potential portrait information includes: Determining the question-answering habits indicated by the potential profile information; The question-and-answer style information for the target user is configured through the question-and-answer habit; The recommended content including the target drug is adjusted based on the question-answer style information to obtain the drug recommendation information.
12. A drug recommendation device, characterized in that: include: An acquisition unit, used to acquire the current question and historical conversations initiated by the target user; A processing unit, configured to extract entities from the current question and the historical conversation to obtain medical portrait information corresponding to the target user; The processing unit is further configured to perform semantic understanding on the historical conversation to obtain habit information corresponding to the target user, so as to configure potential portrait information corresponding to the target user according to the habit information; The processing unit is further used to perform knowledge retrieval based on the current question and the medical portrait information to obtain prompt information, and obtain a target drug suitable for the target user through the prompt information, wherein the knowledge retrieval process corresponding to the prompt information is affected by the tendency parameter corresponding to the potential portrait information; A recommendation unit is used to generate drug recommendation information indicating the target drug based on the potential portrait information.
13. A drug recommendation device, comprising an input and output component and a processor; The input-output component is used to obtain the current question; The processor is used to recommend drugs for the current problem obtained by the input-output component by executing the drug recommendation method as described in any one of claims 1 to 11.
14. A drug recommendation system, comprising an interactive client and a server; The interactive client is used to obtain the current question and send the current question to the server, and to display the drug recommendation results output by the server; The server is used to recommend drugs for the current problem obtained by the input and output components by executing the drug recommendation method described in any one of claims 1 to 11.
15. A computer program product, characterized in that include: A computer program which, when executed by a processor, implements the drug recommendation method according to any one of claims 1 to 11.
Citation Information
Cited By
Response method, model training method and related products
CN120541178A
Memory system, reasoning method and electronic equipment
CN121052386A
Mechanical arm personalized medicine taking method and system based on AI dialogue driving
CN121733546A