CN117252664A - Medicine recommendation reason generation method, device, medium and equipment - Google Patents

Medicine recommendation reason generation method, device, medium and equipment Download PDF

Info

Publication number
CN117252664A
CN117252664A CN202311489484.6A CN202311489484A CN117252664A CN 117252664 A CN117252664 A CN 117252664A CN 202311489484 A CN202311489484 A CN 202311489484A CN 117252664 A CN117252664 A CN 117252664A
Authority
CN
China
Prior art keywords
medicine
information
doctor
patient
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311489484.6A
Other languages
Chinese (zh)
Inventor
张忠敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Koubei Network Technology Co Ltd
Original Assignee
Zhejiang Koubei Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Koubei Network Technology Co Ltd filed Critical Zhejiang Koubei Network Technology Co Ltd
Priority to CN202311489484.6A priority Critical patent/CN117252664A/en
Publication of CN117252664A publication Critical patent/CN117252664A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0631Item recommendations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles

Abstract

The application provides a method, a device, a medium and equipment for generating medicine recommendation reasons, wherein the method comprises the following steps: pre-training a large language model based on massive medical data to obtain a medicine recommendation reason original model; determining one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information, and carrying out parameter adjustment on each layer of the original model based on the vertical domain medicine data set to obtain a medicine recommendation reason optimization model with vertical domain medicine knowledge attributes; and when the target medicine is recommended, generating prompt information based on a prompt template, and guiding the optimization model to output medicine recommendation reasons with the vertical domain medicine knowledge attribute according to the prompt information. The method and the device can generate medicine recommendation reasons while recommending medicines, and solve the problem of imperfect information transmission in the existing medicine recommendation process.

Description

Medicine recommendation reason generation method, device, medium and equipment
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a method, a device, a medium and equipment for generating medicine recommendation reasons.
Background
Currently, consumer purchase channels typically include off-line purchases and on-line purchases. The off-line purchase is typically a user description of the corresponding symptoms, and the pharmacist recommends the drug based on the symptom description, so that the drugs recommended by the pharmacist of different experience may be different. Online purchases are typically matched for symptoms and applicability of the drug to obtain the drug to be recommended.
Under the current online medicine purchase scene, a target medicine is often recommended to a user, namely a recommendation task is completed, and then the user waits for ordering or applying for a prescription. Because of the large variety of medicines, general users often do not know the related information of the recommended medicines, and also know why the current medicines are recommended, so that the problem of incomplete information transmission is caused. Therefore, the problem that the information transmission is not in place due to the fact that the medicines are simply recommended in the existing medicine recommending process can affect the medicine purchasing experience of users in practice, and the ordering conversion rate is reduced.
Disclosure of Invention
In view of this, the application provides a method, a device, a medium and an electronic device for generating medicine recommendation reasons, which mainly aim to generate medicine recommendation reasons while recommending medicines in an on-line medicine purchasing scene, and solve the problem of imperfect information transmission in the existing medicine recommendation process.
According to one aspect of the present application, a method for generating a reason for recommending a drug is provided, which is used for a server, and includes:
pre-training a large language model based on massive medical data to obtain a medicine recommendation reason original model;
determining a vertical domain medicine data set consisting of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information, and carrying out parameter adjustment on each layer of the original model based on the vertical domain medicine data set to obtain a medicine recommendation reason optimization model with vertical domain medicine knowledge attributes;
and when the target medicine is recommended, generating prompt information based on a prompt template, and guiding the optimization model to output medicine recommendation reasons with the vertical domain medicine knowledge attribute according to the prompt information.
In one implementation, the method further comprises: and acquiring doctor-patient multi-round session information, wherein desensitization and/or filtering treatment is performed based on open source medical data to obtain doctor-patient multi-round session information, or a large language model is guided according to prompts to generate pseudo multi-round session information based on the large language model, and rationality judgment is performed on the pseudo multi-round session information to obtain doctor-patient multi-round session information.
In one implementation, the method further comprises: and acquiring medicine list information corresponding to the doctor-patient session, wherein the medicine list information corresponding to the doctor-patient session is acquired by matching the doctor-patient session with a local medicine map based on dictionary matching, tree matching, named entity recognition or entity relationship recognition modes.
In one implementation, the method further comprises: and acquiring personalized medicine recommendation reason information, wherein the personalized medicine recommendation reason information is generated based on the doctor-patient multi-round session information and medicine list information corresponding to the doctor-patient session and by combining the medicine specifications and/or the large language model context knowledge in the list.
In one implementation, the parameter adjustment of each layer of the original model based on the vertical domain medical dataset includes:
inserting a hint adapter at each layer of the original model;
based on the vertical domain medical dataset, updating and optimizing parameters of the prompt adapter to adjust the original model.
In one implementation, after the obtaining the medicine recommendation reason optimization model, the method further includes:
evaluating at least one dimension of the optimization model, wherein the dimension comprises a correctness dimension, an integrity dimension, a fluency dimension, a richness dimension and a format dimension;
And using the optimized model through evaluation to generate recommended reasons of the target medicine.
In one implementation, the performing the target drug recommendation includes:
receiving query information of a target user;
performing intention recognition based on the query information, and performing at least one round of doctor-patient session based on the intention recognition result;
based on the doctor-patient session information, a medical condition summary is determined, and based on the medical condition summary, a drug list including at least one target drug is determined.
In one implementation, the prompt template generates prompt information, including:
a prompt template is constructed in advance, and a doctor-patient session content field, a medicine list field and a medicine description field are set in the prompt template;
and inserting doctor-patient session information of the target user into the doctor-patient session content field, inserting at least one target medicine into the medicine list field, introducing medicine description of the target medicine into the medicine description field, and generating the prompt information.
In one implementation, the guiding the optimization model to output the recommended reason of the target drug with the vertical domain medical knowledge attribute according to the prompt information includes:
And guiding the optimization model to output the direction and the content of the recommended reason of the target medicine based on the doctor-patient session information, the target medicine and the medicine description of the target medicine of the prompt information, so that the optimization model outputs the recommended reason of the target medicine with the vertical domain medicine knowledge attribute.
According to one aspect of the present application, there is provided a method for generating a reason for recommending a drug, a user client, including:
receiving query information of a target user, and acquiring a medicine list comprising at least one target medicine from a server side according to the query information;
recommending the target medicine, and acquiring and displaying medicine recommendation reasons with the vertical domain medicine knowledge attribute obtained by guiding a medicine recommendation reason optimization model based on prompt information from the server, wherein the medicine recommendation reason optimization model is obtained by carrying out parameter adjustment on each layer of a medicine recommendation reason original model based on a vertical domain medicine data set, and the vertical domain medicine data set consists of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information.
In one implementation manner, the acquiring, from the server, the drug list including at least one target drug according to the query information includes:
The query information is sent to the server side, so that the server side carries out intention recognition based on the query information and carries out at least one round of doctor-patient session based on an intention recognition result;
and sending doctor-patient session information to the server side so that the server side can determine a disease abstract, search medicines based on the disease abstract and determine a medicine list comprising at least one target medicine.
According to one aspect of the present application, there is provided a medicine recommendation reason generating device for a server, including:
the original model training unit is used for pre-training the large language model based on massive medical data to obtain a medicine recommendation reason original model;
the data set construction unit is used for determining a vertical domain medicine data set consisting of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient session and personalized medicine recommendation reason information;
the model fine-tuning unit is used for carrying out parameter adjustment on each layer of the original model based on the vertical domain medicine data set to obtain a medicine recommendation reason optimization model with vertical domain medicine knowledge attributes;
the medicine recommending unit is used for recommending target medicines;
and the recommendation reason generating unit is used for generating prompt information based on a prompt template when recommending the target medicine, and guiding the optimization model to output medicine recommendation reasons with the vertical domain medicine knowledge attribute according to the prompt information.
In one implementation of the method, in one implementation,
the data set construction unit is further configured to: and acquiring doctor-patient multi-round session information, wherein desensitization and/or filtering treatment is performed based on open source medical data to obtain doctor-patient multi-round session information, or a large language model is guided according to prompts to generate pseudo multi-round session information based on the large language model, and rationality judgment is performed on the pseudo multi-round session information to obtain doctor-patient multi-round session information.
In one implementation of the method, in one implementation,
the data set construction unit is further configured to: and matching the local medicine map according to the doctor-patient session to obtain medicine list information corresponding to the doctor-patient session, wherein the local medicine map is matched based on dictionary matching, tree matching, named entity recognition or entity relationship recognition modes.
In one implementation of the method, in one implementation,
the data set construction unit is further configured to: based on the doctor-patient multi-turn session information and the medicine list information corresponding to the doctor-patient session, and combining the medicine specifications and/or the large language model context knowledge in the list, generating personalized medicine recommendation reason information.
In one implementation of the method, in one implementation,
the model fine-tuning unit is specifically configured to insert a hint adapter into each layer of the original model, and update and optimize parameters of the hint adapter based on the vertical domain medical dataset, so as to adjust the original model.
In one implementation, the method further comprises:
the model evaluation unit is used for evaluating at least one dimension of the optimized model, wherein the dimension comprises a correctness dimension, an integrity dimension, a fluency dimension, a richness dimension and a format dimension, and the evaluated optimized model is used for the recommendation reason generation unit to generate the recommendation reason of the target medicine.
In one implementation of the method, in one implementation,
the medicine recommending unit is specifically used for receiving query information of a target user; performing intention recognition based on the query information, and performing at least one round of doctor-patient session based on the intention recognition result; and determining a condition summary based on the doctor-patient session information, and searching for a drug based on the condition summary, determining a drug list including at least one target drug.
In one implementation of the method, in one implementation,
the recommendation reason generating unit is specifically used for pre-constructing a prompt template, and setting a doctor-patient session content field, a medicine list field and a medicine description field in the prompt template; and inserting doctor-patient session information of the target user into the doctor-patient session content field, inserting at least one target medicine into the medicine list field, introducing medicine descriptions of the target medicines into the medicine description field, and generating the prompt information.
In one implementation of the method, in one implementation,
the recommendation reason generating unit is specifically configured to guide the direction and the content of the recommendation reason of the target medicine output by the optimization model based on the doctor-patient session information, the target medicine and the medicine description of the target medicine of the prompt information, so that the recommendation reason of the target medicine with the vertical domain medicine knowledge attribute is output by the optimization model.
According to an aspect of the present application, there is provided a medicine recommendation reason generating apparatus, a user client, including:
the query information interaction unit is used for receiving query information of a target user and acquiring a medicine list comprising at least one target medicine from a server according to the query information;
a medicine recommending unit for recommending the target medicine;
the recommendation reason display unit is used for acquiring and displaying the medicine recommendation reason with the vertical domain medicine knowledge attribute obtained by guiding the medicine recommendation reason optimization model based on the prompt information from the server, wherein the medicine recommendation reason optimization model is obtained by carrying out parameter adjustment on each layer of the medicine recommendation reason original model based on a vertical domain medicine data set, and the vertical domain medicine data set consists of one or more items of doctor-patient multi-session information, medicine list information corresponding to doctor-patient session and personalized medicine recommendation reason information.
In one implementation of the method, in one implementation,
the query information interaction unit is specifically configured to send the query information to the server, so that the server performs intent recognition based on the query information, performs at least one round of doctor-patient session based on an intent recognition result, and sends doctor-patient session information to the server, so that the server determines a disease abstract, searches for a drug based on the disease abstract, and determines a drug list including at least one target drug.
According to an aspect of the present application, there is provided a storage medium having stored therein a computer program, wherein the computer program is configured to execute the above-described medicine recommendation reason generation method at run-time.
According to an aspect of the present application, there is provided an electronic device comprising a memory, in which a computer program is stored, and a processor arranged to run the computer program to perform the above-described method of generating a medicine recommendation reason.
By means of the technical scheme, the medicine recommendation reason generating method, the device, the medium and the equipment provided by the application are used for fine adjustment of the original model based on the vertical domain medicine data set to obtain the optimized model, and guiding the optimized model to output the recommendation reason of the target medicine based on the prompt information when the target medicine is recommended, so that the medicine recommendation reason is generated while the medicine is recommended in an on-line medicine purchasing scene, the problem of imperfect information transmission in the existing medicine recommending process is solved, medicine purchasing experience of a user is improved, and the medicine purchasing order conversion rate is improved.
For example, a session sample, a corresponding medicine list and a personalized recommendation reason based on a medicine instruction are self-constructed, fine adjustment (for example, fine adjustment by p-tuning v 2) is carried out on an original model (for example, a ChatGLM model) by the three items, and after an optimized model is obtained, a proper prompt (prompt) is optimized and iterated, so that the purposes of on-line generation authority and effective medicine recommendation reason are achieved. Therefore, the medicine recommendation reason is improved in the professional degree and the relevance.
The foregoing description is only an overview of the technical solutions of the present application, and may be implemented according to the content of the specification in order to make the technical means of the present application more clearly understood, and in order to make the above-mentioned and other objects, features and advantages of the present application more clearly understood, the following detailed description of the present application will be given.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
fig. 1 is a schematic diagram of an implementation scenario of a method for generating a reason for recommending a drug according to an embodiment of the present application;
Fig. 2 shows a flowchart of a method for generating a reason for recommending a drug according to an embodiment of the present application;
FIG. 3 shows a flowchart of a whole process of drug recommendation provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of a model optimization process according to an embodiment of the present application;
FIG. 5 shows a logic diagram for generating a medicine recommendation reason according to an embodiment of the present application;
FIG. 6 is a schematic view of a vertical domain medical dataset according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a model fine tuning principle according to an embodiment of the present application;
FIG. 8 shows a dimension diagram of an optimization model evaluation provided in an embodiment of the present application;
FIG. 9 is a schematic diagram of outputting recommended reasons through a prompt-guided optimization model according to an embodiment of the present application;
FIG. 10 is a flowchart illustrating another method for generating a reason for recommending a drug according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a device for generating medicine recommendation reasons according to an embodiment of the present application;
fig. 12 is a schematic diagram of another medicine recommendation reason generating apparatus according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.
With the development of the Internet and digital medical treatment, users are more and more used to online medicine purchasing, and the method is convenient and efficient. For example, various specialized digital medical APP or shopping platforms can make drug purchases. In order to improve the drug purchasing experience, the platform can be provided with the functions of pharmacist consultation and doctor inquiry. The user may consult a pharmacist with a condition or drug problem, who recommends a drug or solves the drug problem based on the user's description of the condition. For over-the-counter drugs, the user can click directly on the purchase; for prescription drugs, the user needs to confirm and prescribe the prescription by doctor's inquiry.
In the existing mode, a pharmacist needs to interact with a user for a plurality of times to acquire enough background information, then search for symptomatic drugs, provide the symptomatic drugs for the user, and solve the confusion of the user on the reason of medication. Although the requirements can be met, once the inquiry flow is large, the inquiry flow is limited by the number of pharmacists, the condition that the user waits on line can occur, the experience is poor, and the user loss is caused; secondly, the user is helpless to provide more information about medicines, so that in the embodiment of the application, if the user can acquire some priori knowledge in a robot session mode in the medicine asking process, the user can be helped to acquire the world (medicine) knowledge by means of LLM (Large Language Model ) and reasonably recommending reasons are generated, so that the user can be helped to solve medicine asking requirements generated on a platform, and busy line conditions of platform pharmacists can be relieved.
After the pharmacist has obtained sufficient patient information, a series of related drug recommendations may be searched for to the user. In fact, however, in the process of purchasing medicines online, shopping guide is a very critical ring, and if medicines are directly pushed to users, the users have no background knowledge and may feel uncomfortable. If the pharmacist manually edits the medicine recommendation reason, a lot of manpower is consumed, so the embodiment of the application aims to apply the mode of the LLM knowledge aggregation answer in the generation of the medicine recommendation reason, understand various complex demands and individual demands of users in medicine, and bring intelligent and practical recommendation to the users in an AIGC (generated artificial intelligence) mode. Through the content output that has strong knowledge, laminating user, can alleviate user's anxiety of using a medicine to a certain extent, let the user feel the humane care of platform, more trust the platform to form virtuous circle, improve and purchase medicine experience, help improving the medicine and order conversion rate.
Referring to fig. 1, a schematic diagram of an implementation scenario of a method for generating a reason for recommending a drug according to an embodiment of the present application is shown. Fig. 1 shows a client and a server, where the client may be a mobile phone, a tablet, a computer, etc., and a drug purchasing platform is installed or logged in the client, for example, the drug purchasing platform is a digital medical APP or an applet, or is a local shopping platform (for example, a take-out platform) supporting a drug purchasing service, etc., and the server refers to a network end corresponding to the drug purchasing platform. The server side comprises a medicine recommendation system, the medicine recommendation system matches target medicines according to user query information, patient information and the like acquired by the medicine purchasing platform, and particularly, in the embodiment of the application, the medicine recommendation system comprises a medicine recommendation reason generation module, the medicine recommendation reason generation module gives medicine recommendation reasons, for example, pharmacists, multiple rounds of conversations of users and a medicine list are used as input of an optimized LLM model, and the model is controllably enabled to output reasonable medicine recommendation reasons based on prompt, so that user medication anxiety is relieved, and the burden of the pharmacists is relieved.
Referring to fig. 2, a flowchart of a method for generating a reason for recommending a drug according to an embodiment of the present application is shown. The medicine recommendation reason generating method is applied to a server and comprises the following steps S201-S203.
S201: and pre-training a large language model based on massive medical data to obtain an original model of medicine recommendation reasons.
The large language model (LargeLanguageModel, LLM) is a modeling mode based on statistical and natural language processing technology, and is trained on massive texts by using a high-capacity model architecture (such as a transducer), so that a great amount of priori knowledge can be obtained by means of the pre-training, and a given instruction is a process of guiding the instruction to give related knowledge. Common LLMboackbones include ChatGLM, chinese-Alpaca, ziya-Llama, baichuan, and the like, which may be used as the underlying model skeleton for embodiments of the present application.
S202: and determining a vertical domain medicine data set consisting of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information, and carrying out parameter adjustment on each layer of the original model based on the vertical domain medicine data set to obtain a medicine recommendation reason optimization model with vertical domain medicine knowledge attributes.
According to analysis and practice, the inventor of the application finds that if an original LLM model which is not subjected to fine adjustment is directly adopted to generate medicine recommendation reasons, the realization cost is low, but the output of the model is controlled only by virtue of the promt, the influence of the gradient-free optimization on the whole model is uncontrollable, and when a basic model is changed, the effectiveness of the original promt cannot be ensured, and a great amount of manpower is required to maintain the constructed promt; in addition, the non-fine-tuned LLM pharmaceutical aspect describes the aphasia, and many terms are not precisely interpreted and are difficult to convince.
Therefore, the embodiment of the application performs fine adjustment on the basis of the original model to obtain the optimized model, so that the professionality and relevance of the medicine recommendation reason are improved. The final purpose of fine tuning the LLM model is to improve the capability of the large model in the specific field of medicine recommendation as much as possible on the premise of controllable cost.
Vertical domain data (vertical domain data) refers to data that is small in scale but has a specific domain depth. Therefore, to make SFT fine-tuning for the original model, a vertical domain medical dataset needs to be constructed. A homeotropic medical dataset can be understood as a smaller scale dataset that deeply reflects the medical field. In an example of the embodiment of the present application, the vertical domain medical data set includes a data set composed of three contents of doctor-patient multi-session information, medicine list information corresponding to doctor-patient session, and personalized medicine recommendation reason information. The method for acquiring the doctor-patient multi-round session information includes: desensitizing and/or filtering based on open source medical data to obtain doctor-patient multi-turn session information, or guiding a large language model to generate pseudo multi-turn session information based on a large language model according to prompt (prompt), and judging rationality of the pseudo multi-turn session information to obtain doctor-patient multi-turn session information. The medicine list information corresponding to the doctor-patient session is obtained by, for example: and matching the local medicine map according to the doctor-patient session to obtain medicine list information corresponding to the doctor-patient session, wherein the local medicine map can be matched based on dictionary matching, tree matching, named entity recognition or entity relationship recognition modes. The method for acquiring the reason information of personalized medicine recommendation includes the following steps: based on the doctor-patient multi-turn session information and the medicine list information corresponding to the doctor-patient session, and combining the medicine specifications and/or the context knowledge of the large language model in the list, personalized medicine recommendation reason information is generated.
From the Parameter scale perspective, the Tuning of a large model is divided into two types, one is to perform Tuning of a Full-scale Parameter, called Full Fine Tuning (FFT), and the other is to train only a part of the parameters, called Parameter-efficient Tuning (PEFT).
The FFT is a training of a large model with specific data, which has the advantage of performing well, but because the amount of parameters for fine tuning is as large as for pre-training, the cost of training can be high.
PEFT further includes several specific types from the point of view of the source of training data, and the method of training: the first is supervised fine tuning (Supervised Fine Tuning, SFT), which is mainly manually labeled data, for fine tuning large models by the method of supervised learning in traditional machine learning; the second type is reinforcement learning fine tuning (Reinforcement Learning with Human Feedback, RLHF) based on human feedback, and the feedback is introduced into fine tuning of a large model in a reinforcement learning mode, so that the result generated by the large model is more expected; the third category is reinforcement learning fine tuning (Reinforcement Learning with AI Feedback, RLAIF) based on AI feedback, which is substantially similar to RLHF, but the source of feedback is AI, which is mainly to solve the efficiency problem of the feedback system, because collecting human feedback is relatively costly and inefficient. Different classification angles are only different in emphasis point, and fine adjustment of the same large model can be performed by combining multiple schemes without being limited to a certain scheme.
In the embodiment of the application, the SFT mode in PEFT can be adopted to carry out fine adjustment on the original model, so that an optimized model is obtained. SFT, which acquires a smaller-scale but higher-quality data set, typically vertical domain data, further trains the pre-trained original model, and the data set can be present in the original data or can be a model unseen sample. With such supervised fine tuning, it is desirable that the post-fine tuned model be better able to fit the target data distribution. Specifically, the P-tunev 2 method of PEFT may be used for fine tuning, where P-tunev 2 is a fine tuning method comparable to full-scale fine tuning in different scales and tasks, and P-tunev 2 is used for generating and knowledge exploration, and is an important feature of applying continuous hints to each layer of the pre-training model, rather than just the input layer, that is, adding new parameters to the model and each layer of the large model. In one implementation, the manner in which the original model is trimmed based on the vertical domain medical dataset may include inserting a prompt adapter (prompt adapter) at each layer of the original model; based on the vertical domain medical data set, updating parameters of the optimized prompt adapter to adjust the original model. Therefore, parameters of the original model are adjusted through the vertical domain medical data set, so that the adjusted model has vertical domain medical knowledge, and the optimized model with vertical domain medical knowledge attributes is obtained.
Compared with the original model which only has general medical knowledge, the optimized model with the vertical domain medical knowledge attribute has richer and professional knowledge in the specific field of medicine recommendation reasons because the vertical domain medical data set comprises doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information. It will be appreciated that the original model has a broader medical knowledge, while the optimized model has a more specialized medical knowledge in the particular field of drug recommendation reasons.
In one implementation, after obtaining the drug recommendation reason optimization model, the optimization model may also be evaluated, including, for example: evaluating at least one dimension of the optimization model, wherein the dimension comprises a correctness dimension, an integrity dimension, a fluency dimension, a richness dimension and a format dimension; and using the optimized model through evaluation for the recommendation reason of the target medicine generated later.
S203: and when the target medicine is recommended, generating prompt information based on the prompt template, and guiding the optimization model to output medicine recommendation reasons with vertical domain medicine knowledge attributes according to the prompt information.
Under the actual medicine purchasing scene, a user generally inputs query information (consultation information) on a medicine purchasing platform of a client, then the medicine purchasing platform provides the query information to a server, a medicine purchasing recommendation system of the server carries out intention recognition based on the query information and carries out at least one round of doctor-patient session based on an intention recognition result, for example, at least one round of doctor-patient session information is obtained on the client through a doctor-patient session window or interface; then, based on the doctor-patient session information, a condition summary is determined, and based on the condition summary, a drug list including at least one target drug is determined.
In the embodiment of the application, when the client recommends the target medicine to the user, the server outputs the medicine recommendation reason and displays the medicine recommendation reason to the user at the client, so that the understanding degree of medicine information of the user is improved, and the medicine purchasing experience of the user is improved.
As previously analyzed, the original model without fine tuning has wider knowledge, while the optimized model has more specialized medical knowledge in the specific field, i.e. the reason for recommending medicines, so that when the medical knowledge in the specific field is generated according to the reason for recommending medicines, the model is guided to output the medical knowledge in the specific field by a prompt mode, i.e. the optimized model is guided to output the reason for recommending medicines with the attribute of the medical knowledge in the vertical field.
In the embodiment of the application, in order to improve the controllability of the generated medicine recommendation reasons, a prompt (prompt) mode may be adopted to guide the optimization model to output the recommendation reasons. Prompt is understood to be a way to specify the direction in which LLM generation is focused, which is a piece of text or sentence that directs LLM to generate an output of a particular type, topic or format. Guiding one model towards a desired prior direction through hinting (Prompt) is a less costly implementation method that uses correlation and prior information at training time to guide a large-scale language model (e.g., GPT series model) to generate desired output by setting, optimizing and evaluating input hints (promt). Thus, the model can be asked by prompt engineering to obtain the most useful, accurate answer. To achieve controllable text generation (ControlableTextGeneration), i.e. to bring the output of the model with a certain desired property, such as emotion, topic, triplet etc., in this embodiment of the application, it may be the property of the drug, the case information of the user etc., by which the controllable text generation may be performed, since the promt is essentially a means of stimulating knowledge in the language model.
In one implementation, the implementation process for guiding the optimization model to output the recommended reason of the target medicine based on the prompt information may include: constructing a prompt template in advance; generating prompt information through a prompt template, and guiding an optimization model to output the direction and the content of the recommended reason of the target medicine, wherein a doctor-patient session content field, a medicine list field and a medicine description field can be arranged in the prompt template; and inserting doctor-patient session information of the target user into a doctor-patient session content field, inserting at least one target medicine into the medicine list field, introducing medicine description of the target medicine into the medicine description field, and generating prompt information. For example, the model can be made to determine the direction and content of the generated content by a Prompt mode like "you are a professional medicine recommendation assistant, please generate recommended reason … for medicine according to the doctor-patient session content".
The drug recommendation reason generation method provided in the embodiment of the present application is described below in an exemplary manner from an overall point of view.
Referring to fig. 3, a flowchart of a whole process of drug recommendation provided in an embodiment of the present application is shown.
S301: receiving query information of a user at a medicine purchasing platform of a client;
S302: the medicine purchasing platform provides inquiry information to a medicine purchasing recommendation system of the server, and the medicine purchasing recommendation system carries out intention recognition on the inquiry information (user information or patient medical record information and the like) to determine medicine purchasing intention;
s303: based on the medicine purchasing intention, establishing a doctor-patient session to obtain at least one round of doctor-patient session information;
s304: performing illness abstract processing based on doctor-patient session, namely extracting key information in doctor-patient session information to obtain illness abstract;
s305: determining a condition based on the summary of the condition; the illness state can be determined by judging by accessing a pharmacist and performing professional personnel, and the illness state can be determined by analyzing based on the illness state abstract in an artificial intelligence mode;
s306: searching for medicines based on the determined illness state information to obtain a medicine list of at least one target medicine;
s307: in the process of recommending the target medicine, generating recommendation reasons aiming at the target medicine, and simultaneously displaying the recommendation reasons; the medicine list may be used to recommend medicines one by one according to the medicine order, or a plurality of medicines may be recommended at the same time. After the medicine recommendation reasons are given, the user can further refine and inquire according to the medicine recommendation reasons, or perform operations such as ordering or prescribing on the medicine.
In the step S307, the recommendation reasons may be obtained through the purchase drug recommendation reason optimization model described above, which is obtained by fine tuning the original model, as described above, referring to fig. 4, which shows a schematic diagram of a model optimization process provided in the embodiment of the present application. And after the original model is obtained, fine tuning the original model based on the constructed vertical domain medicine data set base to obtain the medicine recommendation reason optimization model. The purpose of fine tuning the model is to improve the capability of the large model in medicine recommendation reason as much as possible on the premise of controllable cost. According to the embodiment of the application, fine adjustment is performed on the basis of the original model, and the optimized model is obtained, so that the professionality and relevance of medicine recommendation reasons are improved.
Referring to fig. 5, a logic diagram for generating a medicine recommendation reason according to an embodiment of the present application is shown. This fig. 5 can be understood as a logical refinement of the aforementioned step S307. For example, based on information such as a medicine list, multi-round doctor-patient session information, illness state abstract and the like, the information is inserted into a prompt template to obtain prompt information, guidance is performed based on the prompt information, a medicine instruction understanding, a user illness state understanding and personalized recommendation reasons are performed, a LLM model is generated, the LLM model generates medicine recommendation reasons, and the model is guided by a prompt mode to generate recommendation reasons.
Further exemplary embodiments of the present application are described below in terms of vertical-domain medical dataset construction, model fine-tuning, and a prompt model.
The person skilled in the art understands that the generation of the reason for recommending the controllable medicine is realized, the sample is necessary, but the complete sample cannot be directly obtained, so that the corpus can be built in three steps. Since the data samples determine the ceiling of the model, its design collection is very important. Aiming at a medical inquiry scene, on one hand, due to cold start, doctor-patient multi-round session information cannot be obtained in advance; on the other hand, a real doctor-patient session involves private information of a large number of users, and is not suitable for model training without desensitization.
Referring to fig. 6, a schematic diagram of a vertical domain medical dataset composition according to an embodiment of the present application is shown.
Embodiments of the present application may construct a dataset in the following manner.
In the first step, a doctor-patient multi-round conversation similar to the local one needs to be acquired, and in this step, two acquisition modes can be adopted. The first approach is to directly utilize open source medical data, including WuDaoCorpus, medDialog, CHIP, etc., from which available samples are filtered, mostly through desensitization. The second method is a multi-round session construction method, for example, based on LLM (such as GPT 3.5/4), according to pseudo multi-round sessions produced by given promt, and judging the rationality of the pseudo multi-round sessions, multiple promtt engineering needs to be passed, and multi-round session information is generated.
And secondly, acquiring recommended medicines related in the session according to the doctor-patient session and the local medicine map, wherein the recommended medicines can be determined by matching the local medicine map through the doctor-patient session, such as dictionary matching, tree matching, named Entity Recognition (NER), entity relationship recognition and the like. Through the medicine map, the relation among the dimensions of the medical entity, the medicine components, the efficacy, the contraindications, the audience and the like can be clarified, so that the recommended medicine corresponding to the symptoms related to the doctor-patient session can be determined.
And thirdly, generating proper personalized medicine recommendation reasons by using medicine specifications, LLM world knowledge and the like based on all the information of the previous two steps. For example, by using LLM model, two pieces of information (doctor-patient multi-round session, recommended medicine) are used as input, and by combining with the content of medicine instruction, the model is guided by the prompt mode to give the recommended reason of medicine. In a specific operation, the recommended reasons for each target drug may be generated sequentially, or the recommended reasons may be requested for each drug separately, and then the recommended reasons for each drug may be spliced.
Referring to fig. 7, a schematic diagram of a model fine tuning principle provided in an embodiment of the present application is shown. In overview, the pre-trained raw model was further trained using a smaller scale but higher quality vertical domain medical dataset constructed as in fig. 6. The vertical domain medical dataset may appear in the original data of the original model or may be an undiscovered sample of the original model. With such supervised tuning, it is desirable that the post-tuning model be better able to fit the target medical data distribution, in this example ChatGLM-6B, in the manner of ptning-v 2 in the PEFT method. Parameter efficient tuning (Parameter-EfficientFinetuning, PEFT) freezes a large portion of the original model, only tuning a relatively small set of model parameters, which enables consumer hardware to fine tune a fairly large base model. One feature of P-tuingv 2 is that a continuous hint is applied to each layer of the pre-trained model, not just the input layer, i.e. Embedding and each layer of the large model is preceded by new parameters. As shown in FIG. 7, successive probes are applied at each layer of the model (e.g., layer1, langye2 …, layerN) and update optimization is performed on the parameters of the probes.
After the fine adjustment of the model is performed in the above manner, the model can be evaluated. Referring to fig. 8, a dimension diagram of an optimization model evaluation provided in an embodiment of the present application is shown. In this example, the model is scored using five evaluation dimensions, including: the correctness dimension, the integrity dimension, the fluency dimension, the richness dimension and the format dimension can be evaluated by adopting any one or a combination of several dimensions, and the evaluation is not limited.
Referring to fig. 9, a schematic diagram of outputting recommended reasons through a prompt guidance optimization model according to an embodiment of the present application is shown. And generating the model according to the assumption by iteratively fine-tuning the simplet of the model, thereby realizing the controllability in medicine question and answer. For example, a template is designed as follows:
"you are a professional medicine recommendation assistant of the medicine purchasing platform, please generate recommendation reasons for medicines according to doctor-patient session contents, please remember:
text in "" "text" "" is doctor-patient session content,
drugs in [ drugs ] are drug lists,
【】 The corresponding description of the medicine is provided for reference,
now please generate the reason for recommendation, think step by step, recommend each drug in turn, and knowledge not involved in the session should not be speculated.
As shown in fig. 9, for the "headache" of the patient, in combination with the contents of the doctor-patient session, the list of medicines and the instruction manual, when the user clicks the "get recommended reason" button, a medicine recommended reason is shown, and in this example, the recommended reason of the "gastrodia elata headache tablet" is shown.
As analyzed before, the LLM model without fine adjustment has the problems of uncontrollable and inaccurate, and the LLM controllable medicine recommendation reason generation scheme provided by the embodiment of the application takes multiple rounds of session and medicine list information of pharmacists and users as input to controllably give out reasonable medicine recommendation reasons. In the implementation, a session sample, a corresponding medicine list and a personalized recommendation reason based on a medicine instruction are self-constructed, fine adjustment (for example, fine adjustment by p-tuningv 2) is carried out on an original model (for example, chatGLM) by the three items, and after an optimized model is obtained, appropriate campt is optimized and iterated, so that the purposes of on-line generation authority and effective medicine recommendation reason are achieved. Therefore, the medicine recommendation reason is improved in the professional degree and the relevance.
In the embodiment of the application, the model fine adjustment and the promt are complemented, so that the internalization of medical knowledge is realized, and gradient-free optimization is used as a controllable generation means. The advantages are that: the accuracy (professional degree) is guaranteed, the overall direction of the recommendation reason generation is controlled by combining with the Prompt, the answer generation of the medicine recommendation reason is facilitated, the problem of insufficient professional degree of the inherent general LLM is solved pertinently, and therefore the accuracy, the professional degree and the satisfaction of the recommendation reason are improved.
Referring to fig. 10, a flowchart of another method for generating a medicine recommendation reason provided in an embodiment of the present application is shown, where the method for generating a medicine recommendation reason includes:
s1001: receiving query information of a target user, and acquiring a medicine list comprising at least one target medicine from a server side according to the query information;
s1002: recommending target medicines, and acquiring and displaying medicine recommendation reasons with the vertical domain medicine knowledge attributes obtained by guiding a medicine recommendation reason optimization model based on prompt information from a server, wherein the medicine recommendation reason optimization model is obtained by carrying out parameter adjustment on each layer of a medicine recommendation reason original model based on a vertical domain medicine data set, and the vertical domain medicine data set consists of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information.
In one implementation manner, the acquiring, from the server, the drug list including at least one target drug according to the query information includes:
the query information is sent to the server side, so that the server side carries out intention recognition based on the query information and carries out at least one round of doctor-patient session based on an intention recognition result;
And sending doctor-patient session information to the server side so that the server side can determine a disease abstract, search medicines based on the disease abstract and determine a medicine list comprising at least one target medicine.
For details of implementation, reference is made to the foregoing drawings and related description, which are not repeated here.
Referring to fig. 11, a schematic structural diagram of a medicine recommendation reason generating device according to an embodiment of the present application is shown. The medicine recommendation reason generating device is used for a server and comprises:
the original model training unit 1101 is configured to pre-train a large language model based on massive medical data, and obtain an original model of medicine recommendation reason;
the data set construction unit 1102 is configured to determine a vertical domain medicine data set that is formed by one or more of doctor-patient multi-session information, medicine list information corresponding to a doctor-patient session, and personalized medicine recommendation reason information;
a model fine-tuning unit 1103, configured to perform parameter adjustment on each layer of the original model based on the vertical domain medical data set, so as to obtain a medicine recommendation reason optimization model with vertical domain medical knowledge attribute;
a medicine recommendation unit 1104 for making a target medicine recommendation;
the recommendation reason generating unit 1105 is configured to generate prompt information based on a prompt template when recommending the target drug, and guide the optimization model to output a drug recommendation reason having the domain medical knowledge attribute according to the prompt information.
In one implementation of the method, in one implementation,
the data set construction unit 1102 is further configured to obtain doctor-patient multi-round session information, where desensitization and/or filtering are performed based on open source medical data to obtain doctor-patient multi-round session information, or based on a large language model, a pseudo multi-round session information is generated according to a prompt guidance large language model, and rationality discrimination is performed on the pseudo multi-round session information to obtain doctor-patient multi-round session information.
In one implementation of the method, in one implementation,
the data set construction unit 1102 is further configured to match a local medicine map according to the doctor-patient session, and obtain medicine list information corresponding to the doctor-patient session, where the local medicine map is matched based on dictionary matching, tree matching, named entity recognition or entity relationship recognition.
In one implementation of the method, in one implementation,
the data set construction unit 1102 is further configured to generate personalized medicine recommendation reason information based on the doctor-patient multi-round session information and medicine list information corresponding to the doctor-patient session, and in combination with the medicine specifications and/or the large language model context knowledge in the list.
In one implementation of the method, in one implementation,
the model fine-tuning unit 1103 is specifically configured to insert a hint adapter into each layer of the original model, and update and optimize parameters of the hint adapter based on the vertical domain medical dataset, so as to adjust the original model.
In one implementation, the method further comprises:
the model evaluation unit 1106 is configured to evaluate at least one dimension of the optimization model, where the dimensions include a correctness dimension, an integrity dimension, a fluency dimension, a richness dimension, and a format dimension, and use the evaluated optimization model for the recommendation reason generating unit 1105 to generate the recommendation reason of the target drug.
In one implementation of the method, in one implementation,
the medicine recommendation unit 1104 is specifically configured to receive query information of a target user; performing intention recognition based on the query information, and performing at least one round of doctor-patient session based on the intention recognition result; and determining a condition summary based on the doctor-patient session information, and searching for a drug based on the condition summary, determining a drug list including at least one target drug.
In one implementation of the method, in one implementation,
the recommendation reason generating unit 1105 is specifically configured to pre-construct a prompt template, and set a doctor-patient session content field, a medicine list field, and a medicine description field in the prompt template; and inserting doctor-patient session information of the target user into the doctor-patient session content field, inserting at least one target medicine into the medicine list field, introducing medicine descriptions of the target medicines into the medicine description field, and generating the prompt information.
In one implementation of the method, in one implementation,
the recommendation reason generating unit 1105 is specifically configured to guide the direction and the content of the recommendation reason of the target medicine output by the optimization model based on the doctor-patient session information, the target medicine, and the medicine description of the target medicine of the prompt information, so that the recommendation reason of the target medicine with the vertical domain medicine knowledge attribute is output by the optimization model.
Referring to fig. 12, a schematic diagram of another medicine recommendation reason generating apparatus according to an embodiment of the present application is shown. The medicine recommendation reason generating device, a user client side, comprises:
a query information interaction unit 1201, configured to receive query information of a target user, and acquire a drug list including at least one target drug from a server according to the query information;
a medicine recommending unit 1202 for recommending the target medicine,
the recommendation reason display unit 1203 is configured to obtain and display, from the server, a medicine recommendation reason with the vertical domain medicine knowledge attribute obtained by guiding a medicine recommendation reason optimization model based on prompt information, where the medicine recommendation reason optimization model is obtained by performing parameter adjustment on each layer of a medicine recommendation reason original model based on a vertical domain medicine data set, and the vertical domain medicine data set is composed of one or more of doctor-patient multi-session information, medicine list information corresponding to a doctor-patient session, and personalized medicine recommendation reason information.
In one implementation of the method, in one implementation,
the query information interaction unit 1201 is specifically configured to send the query information to the server, so that the server performs intent recognition based on the query information, performs at least one round of doctor-patient session based on the intent recognition result, and sends doctor-patient session information to the server, so that the server determines a disease abstract, searches for a drug based on the disease abstract, and determines a drug list including at least one target drug.
Embodiments of the present application also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
pre-training a large language model based on massive medical data to obtain a medicine recommendation reason original model;
determining a vertical domain medicine data set consisting of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information, and carrying out parameter adjustment on each layer of the original model based on the vertical domain medicine data set to obtain a medicine recommendation reason optimization model with vertical domain medicine knowledge attributes;
When the target medicine is recommended, generating prompt information based on a prompt template, and guiding the optimization model to output medicine recommendation reasons with the vertical domain medicine knowledge attribute according to the prompt information;
or,
receiving query information of a target user, and acquiring a medicine list comprising at least one target medicine from a server side according to the query information;
recommending the target medicine, and acquiring and displaying medicine recommendation reasons with the vertical domain medicine knowledge attribute obtained by guiding a medicine recommendation reason optimization model based on prompt information from the server, wherein the medicine recommendation reason optimization model is obtained by carrying out parameter adjustment on each layer of a medicine recommendation reason original model based on a vertical domain medicine data set, and the vertical domain medicine data set consists of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Embodiments of the present application also provide an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic device may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
pre-training a large language model based on massive medical data to obtain a medicine recommendation reason original model;
determining a vertical domain medicine data set consisting of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information, and carrying out parameter adjustment on each layer of the original model based on the vertical domain medicine data set to obtain a medicine recommendation reason optimization model with vertical domain medicine knowledge attributes;
when the target medicine is recommended, generating prompt information based on a prompt template, and guiding the optimization model to output medicine recommendation reasons with the vertical domain medicine knowledge attribute according to the prompt information;
Or,
receiving query information of a target user, and acquiring a medicine list comprising at least one target medicine from a server side according to the query information;
recommending the target medicine, and acquiring and displaying medicine recommendation reasons with the vertical domain medicine knowledge attribute obtained by guiding a medicine recommendation reason optimization model based on prompt information from the server, wherein the medicine recommendation reason optimization model is obtained by carrying out parameter adjustment on each layer of a medicine recommendation reason original model based on a vertical domain medicine data set, and the vertical domain medicine data set consists of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (24)

1. The medicine recommendation reason generating method is characterized by comprising the following steps of:
pre-training a large language model based on massive medical data to obtain a medicine recommendation reason original model;
determining a vertical domain medicine data set consisting of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information, and carrying out parameter adjustment on each layer of the original model based on the vertical domain medicine data set to obtain a medicine recommendation reason optimization model with vertical domain medicine knowledge attributes;
and when the target medicine is recommended, generating prompt information based on a prompt template, and guiding the optimization model to output medicine recommendation reasons with the vertical domain medicine knowledge attribute according to the prompt information.
2. The method as recited in claim 1, further comprising:
and acquiring doctor-patient multi-round session information, wherein desensitization and/or filtering treatment is performed based on open source medical data to obtain doctor-patient multi-round session information, or a large language model is guided according to prompts to generate pseudo multi-round session information based on the large language model, and rationality judgment is performed on the pseudo multi-round session information to obtain doctor-patient multi-round session information.
3. The method as recited in claim 1, further comprising:
and acquiring medicine list information corresponding to the doctor-patient session, wherein the medicine list information corresponding to the doctor-patient session is acquired by matching the doctor-patient session with a local medicine map based on dictionary matching, tree matching, named entity recognition or entity relationship recognition modes.
4. The method as recited in claim 1, further comprising:
and acquiring personalized medicine recommendation reason information, wherein the personalized medicine recommendation reason information is generated based on the doctor-patient multi-round session information and medicine list information corresponding to the doctor-patient session and by combining the medicine specifications and/or the large language model context knowledge in the list.
5. The method of any one of claims 1-4, wherein the parameter adjustment of each layer of the raw model based on the vertical domain medical dataset comprises:
inserting a hint adapter at each layer of the original model;
based on the vertical domain medical dataset, updating and optimizing parameters of the prompt adapter to adjust the original model.
6. The method of any one of claims 1-4, further comprising, after said deriving a drug recommendation reason optimization model:
Evaluating at least one dimension of the optimization model, wherein the dimension comprises a correctness dimension, an integrity dimension, a fluency dimension, a richness dimension and a format dimension;
and using the optimized model through evaluation to generate recommended reasons of the target medicine.
7. The method of any one of claims 1-4, wherein the making of the target drug recommendation comprises:
receiving query information of a target user;
performing intention recognition based on the query information, and performing at least one round of doctor-patient session based on the intention recognition result;
based on the doctor-patient session information, a medical condition summary is determined, and based on the medical condition summary, a drug list including at least one target drug is determined.
8. The method of any of claims 1-4, wherein generating hint information based on a hint template comprises:
a prompt template is constructed in advance, and a doctor-patient session content field, a medicine list field and a medicine description field are set in the prompt template;
and inserting doctor-patient session information of the target user into the doctor-patient session content field, inserting at least one target medicine into the medicine list field, introducing medicine description of the target medicine into the medicine description field, and generating the prompt information.
9. The method of claim 8, wherein the guiding the optimization model to output recommended reasons for the target drug with the vertical domain medical knowledge attribute according to the hint information comprises:
and guiding the optimization model to output the direction and the content of the recommended reason of the target medicine based on the doctor-patient session information, the target medicine and the medicine description of the target medicine of the prompt information, so that the optimization model outputs the recommended reason of the target medicine with the vertical domain medicine knowledge attribute.
10. A medicine recommendation reason generating method is characterized in that a user client side comprises the following steps:
receiving query information of a target user, and acquiring a medicine list comprising at least one target medicine from a server side according to the query information;
recommending the target medicine, and acquiring and displaying medicine recommendation reasons with the vertical domain medicine knowledge attribute obtained by guiding a medicine recommendation reason optimization model based on prompt information from the server, wherein the medicine recommendation reason optimization model is obtained by carrying out parameter adjustment on each layer of a medicine recommendation reason original model based on a vertical domain medicine data set, and the vertical domain medicine data set consists of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient sessions and personalized medicine recommendation reason information.
11. The method of claim 10, wherein the obtaining, with the query information, a drug list including at least one target drug from a server, comprises:
the query information is sent to the server side, so that the server side carries out intention recognition based on the query information and carries out at least one round of doctor-patient session based on an intention recognition result;
and sending doctor-patient session information to the server side so that the server side can determine a disease abstract, search medicines based on the disease abstract and determine a medicine list comprising at least one target medicine.
12. The utility model provides a medicine recommendation reason generation device which is characterized in that is used for the server, includes:
the original model training unit is used for pre-training the large language model based on massive medical data to obtain a medicine recommendation reason original model;
the data set construction unit is used for determining a vertical domain medicine data set consisting of one or more of doctor-patient multi-session information, medicine list information corresponding to doctor-patient session and personalized medicine recommendation reason information;
the model fine-tuning unit is used for carrying out parameter adjustment on each layer of the original model based on the vertical domain medicine data set to carry out fine tuning so as to obtain a medicine recommendation reason optimization model with vertical domain medicine knowledge attributes;
The medicine recommending unit is used for recommending target medicines;
and the recommendation reason generating unit is used for generating prompt information based on a prompt template when recommending the target medicine, and guiding the optimization model to output medicine recommendation reasons with the vertical domain medicine knowledge attribute according to the prompt information.
13. The apparatus of claim 12, wherein the device comprises a plurality of sensors,
the data set construction unit is further configured to: and acquiring doctor-patient multi-round session information, wherein desensitization and/or filtering treatment is performed based on open source medical data to obtain doctor-patient multi-round session information, or a large language model is guided according to prompts to generate pseudo multi-round session information based on the large language model, and rationality judgment is performed on the pseudo multi-round session information to obtain doctor-patient multi-round session information.
14. The apparatus of claim 12, wherein the device comprises a plurality of sensors,
the data set construction unit is further configured to: and matching the local medicine map according to the doctor-patient session to obtain medicine list information corresponding to the doctor-patient session, wherein the local medicine map is matched based on dictionary matching, tree matching, named entity recognition or entity relationship recognition modes.
15. The apparatus of claim 12, wherein the device comprises a plurality of sensors,
The data set construction unit is further configured to: based on the doctor-patient multi-turn session information and the medicine list information corresponding to the doctor-patient session, and combining the medicine specifications and/or the large language model context knowledge in the list, generating personalized medicine recommendation reason information.
16. The device according to any one of claims 12-15, wherein,
the model fine-tuning unit is specifically configured to insert a hint adapter into each layer of the original model, and update and optimize parameters of the hint adapter based on the vertical domain medical dataset, so as to adjust the original model.
17. The apparatus according to any one of claims 12-15, further comprising:
the model evaluation unit is used for evaluating at least one dimension of the optimized model, wherein the dimension comprises a correctness dimension, an integrity dimension, a fluency dimension, a richness dimension and a format dimension, and the evaluated optimized model is used for the recommendation reason generation unit to generate the recommendation reason of the target medicine.
18. The device according to any one of claims 12-15, wherein,
the medicine recommending unit is specifically used for receiving query information of a target user; performing intention recognition based on the query information, and performing at least one round of doctor-patient session based on the intention recognition result; and determining a condition summary based on the doctor-patient session information, and searching for a drug based on the condition summary, determining a drug list including at least one target drug.
19. The device according to any one of claims 12-15, wherein,
the recommendation reason generating unit is specifically used for pre-constructing a prompt template, and setting a doctor-patient session content field, a medicine list field and a medicine description field in the prompt template; and inserting doctor-patient session information of the target user into the doctor-patient session content field, inserting at least one target medicine into the medicine list field, introducing medicine descriptions of the target medicines into the medicine description field, and generating the prompt information.
20. The apparatus of claim 19, wherein the device comprises a plurality of sensors,
the recommendation reason generating unit is specifically configured to guide the direction and the content of the recommendation reason of the target medicine output by the optimization model based on the doctor-patient session information, the target medicine and the medicine description of the target medicine of the prompt information, so that the recommendation reason of the target medicine with the vertical domain medicine knowledge attribute is output by the optimization model.
21. A medicine recommendation reason generation device is characterized in that a user client side comprises:
the query information interaction unit is used for receiving query information of a target user and acquiring a medicine list comprising at least one target medicine from a server according to the query information;
A medicine recommending unit for recommending the target medicine,
the recommendation reason display unit is used for acquiring and displaying the medicine recommendation reason with the vertical domain medicine knowledge attribute obtained by guiding the medicine recommendation reason optimization model based on the prompt information from the server, wherein the medicine recommendation reason optimization model is obtained by carrying out parameter adjustment on each layer of the medicine recommendation reason original model based on a vertical domain medicine data set, and the vertical domain medicine data set consists of one or more items of doctor-patient multi-session information, medicine list information corresponding to doctor-patient session and personalized medicine recommendation reason information.
22. The apparatus of claim 21, wherein the device comprises a plurality of sensors,
the query information interaction unit is specifically configured to send the query information to the server, so that the server performs intent recognition based on the query information, performs at least one round of doctor-patient session based on an intent recognition result, and sends doctor-patient session information to the server, so that the server determines a disease abstract, searches for a drug based on the disease abstract, and determines a drug list including at least one target drug.
23. A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of claims 1 to 11 when run.
24. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of claims 1 to 11.
CN202311489484.6A 2023-11-10 2023-11-10 Medicine recommendation reason generation method, device, medium and equipment Pending CN117252664A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311489484.6A CN117252664A (en) 2023-11-10 2023-11-10 Medicine recommendation reason generation method, device, medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311489484.6A CN117252664A (en) 2023-11-10 2023-11-10 Medicine recommendation reason generation method, device, medium and equipment

Publications (1)

Publication Number Publication Date
CN117252664A true CN117252664A (en) 2023-12-19

Family

ID=89126623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311489484.6A Pending CN117252664A (en) 2023-11-10 2023-11-10 Medicine recommendation reason generation method, device, medium and equipment

Country Status (1)

Country Link
CN (1) CN117252664A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109102855A (en) * 2018-07-03 2018-12-28 北京康夫子科技有限公司 Drug recommended method
CN109658208A (en) * 2019-01-15 2019-04-19 京东方科技集团股份有限公司 Recommended method, device, medium and the electronic equipment of drug
CN111192654A (en) * 2019-12-30 2020-05-22 北京左医健康技术有限公司 Medicine taking guidance query method and device based on knowledge graph
CN111191020A (en) * 2019-12-27 2020-05-22 江苏省人民医院(南京医科大学第一附属医院) Prescription recommendation method and system based on machine learning and knowledge graph
CN111260448A (en) * 2020-02-13 2020-06-09 平安科技(深圳)有限公司 Artificial intelligence-based medicine recommendation method and related equipment
CN114048331A (en) * 2021-12-01 2022-02-15 浙江师范大学 Knowledge graph recommendation method and system based on improved KGAT model
CN114765075A (en) * 2021-01-13 2022-07-19 京东方科技集团股份有限公司 Medicine recommendation method, device and system, electronic equipment and storage medium
CN116452263A (en) * 2022-01-05 2023-07-18 腾讯科技(深圳)有限公司 Information recommendation method, device, equipment, storage medium and program product
CN116720004A (en) * 2023-08-09 2023-09-08 腾讯科技(深圳)有限公司 Recommendation reason generation method, device, equipment and storage medium
CN116821308A (en) * 2023-08-22 2023-09-29 浙江口碑网络技术有限公司 Generation method, training method and device of model and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109102855A (en) * 2018-07-03 2018-12-28 北京康夫子科技有限公司 Drug recommended method
CN109658208A (en) * 2019-01-15 2019-04-19 京东方科技集团股份有限公司 Recommended method, device, medium and the electronic equipment of drug
WO2020147758A1 (en) * 2019-01-15 2020-07-23 京东方科技集团股份有限公司 Drug recommendation method and apparatus, medium, and electronic device
CN111656384A (en) * 2019-01-15 2020-09-11 京东方科技集团股份有限公司 Medicine recommendation method, device, medium and electronic equipment
CN111191020A (en) * 2019-12-27 2020-05-22 江苏省人民医院(南京医科大学第一附属医院) Prescription recommendation method and system based on machine learning and knowledge graph
CN111192654A (en) * 2019-12-30 2020-05-22 北京左医健康技术有限公司 Medicine taking guidance query method and device based on knowledge graph
CN111260448A (en) * 2020-02-13 2020-06-09 平安科技(深圳)有限公司 Artificial intelligence-based medicine recommendation method and related equipment
CN114765075A (en) * 2021-01-13 2022-07-19 京东方科技集团股份有限公司 Medicine recommendation method, device and system, electronic equipment and storage medium
CN114048331A (en) * 2021-12-01 2022-02-15 浙江师范大学 Knowledge graph recommendation method and system based on improved KGAT model
CN116452263A (en) * 2022-01-05 2023-07-18 腾讯科技(深圳)有限公司 Information recommendation method, device, equipment, storage medium and program product
CN116720004A (en) * 2023-08-09 2023-09-08 腾讯科技(深圳)有限公司 Recommendation reason generation method, device, equipment and storage medium
CN116821308A (en) * 2023-08-22 2023-09-29 浙江口碑网络技术有限公司 Generation method, training method and device of model and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张璐;陈春;范小朋;刘人恺;须成忠;: "基于隐性反馈与交叉推荐的癫痫药物推荐系统", 集成技术, no. 05 *
陈敏: "《认知计算导论》", 31 May 2017, 武汉:华中科技大学出版社, pages: 143 *

Similar Documents

Publication Publication Date Title
Luo et al. A critical review of state‐of‐the‐art chatbot designs and applications
Charmaz et al. Grounded theory methods for qualitative psychology
CN111125309A (en) Natural language processing method and device, computing equipment and storage medium
Barbour et al. Evaluating and synthesizing qualitative research: the need to develop a distinctive approach
Friedman et al. Concept theory and semiotics in knowledge organization
CN110289068A (en) Drug recommended method and equipment
CN110612525A (en) Enabling thesaurus analysis by using an alternating utterance tree
WO2019217722A1 (en) Constructing imaginary discourse trees to improve answering convergent questions
CN105723405A (en) Guided article authorship
CN112667799B (en) Medical question-answering system construction method based on language model and entity matching
CN112307215A (en) Data processing method, device and computer readable storage medium
CN111279404B (en) Language fluent system
Barbagallo et al. ELSE: an ontology-based system integrating semantic search and e-learning technologies
US11914965B2 (en) Formulating questions using differences between sets of syntactic trees and differences between sets of semantic trees
EP3901875A1 (en) Topic modelling of short medical inquiries
CN116956934A (en) Task processing method, device, equipment and storage medium
CN116501851A (en) Answer text sending method, answer text generating method, answer text sending device, answer text generating equipment and answer text medium
CN117252664A (en) Medicine recommendation reason generation method, device, medium and equipment
CN115757720A (en) Project information searching method, device, equipment and medium based on knowledge graph
US20230177502A1 (en) System & method to detect fraudulent or abusive behavior as part of medical record and medication management
CN114464328A (en) Test information retrieval method and device, clinical test recommendation method and terminal
CN114902230A (en) Improved utterance parsing
Li EFL teaching based on big data analytics in mobile AAC system
KR102599370B1 (en) Customized content providing system ans method for providing real-time collaborative editing services based on operational conversion
Herschell et al. Epistemological Implications of a ‘Convergent Parallel Mixed Methods’ Research Design

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination