Drug recommendation method, training model method, device, electronic device and storage medium

By constructing a drug interaction model and drug recommendation model, combined with the interaction relationship between drugs, the problem that existing systems cannot effectively consider drug interactions is solved, and the safety and accuracy of drug recommendations are improved.

CN115116578BActive Publication Date: 2025-03-28腾讯医疗健康(深圳)有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210612978.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-31
Publication Date
2025-03-28
Estimated Expiration
2042-05-31

AI Technical Summary

Technical Problem

Existing drug recommendation systems are unable to effectively consider drug interactions, resulting in the possible recommendation of inappropriate drug combinations and failing to meet the increasingly complex drug needs of patients.

Method used

By constructing a drug interaction model, a drug characterization vector is generated based on the interaction relationship between drugs, and combining the drug recommendation model, it is determined whether to recommend a drug to the user to avoid inappropriate drug combinations.

Benefits of technology

It improves the safety and accuracy of drug recommendations, avoids inappropriate drug combinations, and meets the patients' complex drug needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115116578B_ABST
    Figure CN115116578B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a drug recommendation method, a training model method, an apparatus, an electronic device and a storage medium, which relate to the field of intelligent medical care of artificial intelligence. The drug recommendation method includes: determining each user who takes a first drug according to the user's drug taking situation; using a drug interaction model to obtain a first characterization vector of the first drug; the drug interaction model is obtained according to a graph network constructed based on the drug interaction relationship; using a drug recommendation model, according to the original features of each user who takes the first drug, the first characterization vector and the original features of the first user, determining whether to recommend the first drug to the first user; the drug recommendation model is obtained by training a machine learning model based on the actual taking situation of the first drug sample by the user sample. The embodiments of the present application can make drug recommendations based on drug interactions, thereby recommending safer and more suitable drugs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and more specifically, to a drug recommendation method, a training model method, an apparatus, a device, and a storage medium. Background Art

[0002] At present, many advanced technologies have been applied to the development of drug recommendation systems to recommend appropriate drugs for different patients. Most of these methods rely on text information in the patient's electronic health record and make drug recommendations based on the medication history of a large number of patients. However, considering only the patient's electronic health record and historical medication situation cannot meet the increasingly complex medication needs of patients. Summary of the invention

[0003] The embodiments of the present application provide a drug recommendation method, a training model method, an apparatus, an electronic device, and a storage medium, which can make drug recommendations based on drug interactions, thereby recommending safer and more appropriate drugs.

[0004] In a first aspect, the present application provides a method for drug recommendation, comprising:

[0005] Determine each user who takes the first drug according to the drug taking situation of the user;

[0006] Using a drug interaction model, obtaining a first characterization vector of the first drug; wherein the drug interaction model is obtained based on a graph network constructed according to the interaction relationship between drugs;

[0007] Determining whether to recommend the first drug to the first user using a drug recommendation model according to original features of each user who takes the first drug, the first representation vector, and the original features of the first user;

[0008] The drug recommendation model is obtained by training a machine learning model based on a characterization vector of a first drug sample and actual usage of the first drug sample by user samples, and the characterization vector of the first drug sample is obtained based on the drug interaction model.

[0009] In a second aspect, an embodiment of the present application provides a method for training a drug recommendation model, comprising:

[0010] Acquire a first training sample set, where the first training sample set includes actual taking conditions of a first drug sample by a user sample;

[0011] Using the drug interaction model, a representation vector of the first drug sample is obtained; wherein the drug interaction model is obtained based on a graph network constructed according to the interaction relationship between drugs;

[0012] Inputting the original features of the user sample and the representation vector of the first drug sample into the drug recommendation model to obtain a recommendation score for recommending the first drug sample to the user sample;

[0013] The parameters of the drug recommendation model are updated according to the recommendation score and the actual taking situation of the first drug sample by the user sample.

[0014] In a third aspect, the present application provides a method for training a drug interaction model, comprising:

[0015] Constructing a graph network according to the drug-drug interaction relationship, wherein the nodes of the graph network belong to the drug set, and the edges of the graph network belong to the drug-drug interaction set;

[0016] Acquire a second training sample set, wherein the second training sample set includes the real action relationship of at least two second drug samples in the graph network;

[0017] Inputting the original features of the at least two second drug samples and the original features of each drug related to each second drug sample in the at least two second drug samples into the drug interaction model to obtain the scores of the edges between the at least two second drug samples;

[0018] The parameters of the drug interaction model are updated according to the scores of the edges between the at least two second drug samples and the actual action relationship between the at least two second drug samples.

[0019] In a fourth aspect, an embodiment of the present application provides a device for recommending medicines, including:

[0020] a determination unit, configured to determine each user who has taken the first drug according to the drug taking status of the user;

[0021] A drug interaction model, used to obtain a first characterization vector of the first drug; wherein the drug interaction model is obtained based on a graph network constructed based on the interaction relationship between drugs;

[0022] a drug recommendation model, used for determining whether to recommend the first drug to the first user based on original features of each user who takes the first drug, the first representation vector, and the original features of the first user;

[0023] The drug recommendation model is obtained by training a machine learning model based on a characterization vector of a first drug sample and actual usage of the first drug sample by user samples, and the characterization vector of the first drug sample is obtained based on the drug interaction model.

[0024] In a fifth aspect, an embodiment of the present application provides a device for training a drug recommendation model, comprising:

[0025] An acquisition unit, configured to acquire a first training sample set, wherein the first training sample set includes actual taking conditions of a first drug sample by a user sample;

[0026] A drug interaction model, used to obtain a characterization vector of the first drug sample; wherein the drug interaction model is obtained based on a graph network constructed based on the interaction relationship between drugs;

[0027] A drug recommendation model, used for inputting the original features of the user sample and the representation vector of the first drug sample into the drug recommendation model to obtain a recommendation score for recommending the first drug sample to the user sample;

[0028] A training unit is used to update the parameters of the drug recommendation model according to the recommendation score and the actual taking situation of the first drug sample by the user sample.

[0029] In a sixth aspect, an embodiment of the present application provides a device for training a drug interaction model, comprising:

[0030] A construction unit, configured to construct a graph network according to the drug-drug interaction relationship, wherein the nodes of the graph network belong to the drug set, and the edges of the graph network belong to the drug-drug interaction set;

[0031] an acquisition unit, configured to acquire a second training sample set, wherein the second training sample set includes a real action relationship between at least two second drug samples in the graph network;

[0032] a drug interaction model, for inputting the original features of the at least two second drug samples and the original features of each drug related to each second drug sample in the at least two second drug samples, and obtaining the scores of the edges between the at least two second drug samples;

[0033] The training unit is used to update the parameters of the drug interaction model according to the scores of the edges between the at least two second drug samples and the real action relationship between the at least two second drug samples.

[0034] In a seventh aspect, an embodiment of the present application provides an electronic device, including:

[0035] a processor adapted to implement computer instructions; and,

[0036] A memory stores computer instructions, wherein the computer instructions are suitable for being loaded by a processor and executing the method of any one of the first to third aspects above.

[0037] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are read and executed by a processor of a computer device, the computer device executes the method of any one of the first to third aspects above.

[0038] In a ninth aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of any one of the first to third aspects above.

[0039] Based on the above technical solution, the embodiment of the present application obtains the first characterization vector of the first drug through the drug interaction model, and the drug recommendation model can determine whether to recommend the first drug to the first user based on the first characterization vector, the original features of the user who takes the first drug, and the original features of the first user. Since the first characterization vector can characterize the interaction relationship between the first drug and other drugs, and the drug recommendation model introduces the interaction between drugs, the embodiment of the present application can help avoid the inclusion of inappropriate drug combinations in the drugs recommended to users, thereby improving the safety of drug recommendations. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A schematic diagram of a system architecture involved in an embodiment of the present application;

[0041] Figure 2 A schematic flow chart of a method for training a model provided in an embodiment of the present application;

[0042] Figure 3 is a schematic diagram of a drug recommendation process according to an embodiment of the present application;

[0043] Figure 4 A schematic flow chart of another method for training a model provided in an embodiment of the present application;

[0044] Figure 5 A schematic flow chart of another method for training a model provided in an embodiment of the present application;

[0045] Figure 6 A schematic flow chart of a method for drug recommendation provided in an embodiment of the present application;

[0046] Figure 7 is a schematic block diagram of a drug recommendation device provided in an embodiment of the present application;

[0047] Figure 8is a schematic block diagram of a device for training a model provided in an embodiment of the present application;

[0048] Fig. 9 is a schematic block diagram of another device for training a model provided in an embodiment of the present application;

[0049] Fig.10 It is a schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0051] It should be understood that in the embodiment of the present application, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B based only on A, and B can also be determined based on A and / or other information.

[0052] In the description of the present application, unless otherwise specified, "at least one" means one or more, and "plurality" means two or more than two. In addition, "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0053] It should also be understood that the first, second, etc. descriptions appearing in the embodiments of the present application are only used for illustration and distinction of the description objects, without any distinction of order, nor do they indicate any special limitation on the number of devices in the embodiments of the present application, and cannot constitute any limitation on the embodiments of the present application.

[0054] It should also be understood that the specific features, structures or characteristics related to the embodiments in the specification are included in at least one embodiment of the present application. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner.

[0055] In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or device.

[0056] The embodiments of the present application are applied to the field of artificial intelligence technology.

[0057] Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0058] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0059] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0060] Embodiments of the present application may involve natural language processing (NLP) technology in artificial intelligence technology. NLP is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology generally includes text processing, semantic understanding, machine translation, robot question answering, knowledge graphs and other technologies.

[0061] The embodiments of the present application may also involve machine learning (ML) in artificial intelligence technology. ML is a multi-disciplinary cross-discipline involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all fields of artificial intelligence. Machine learning and deep learning generally include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by teaching.

[0062] In addition, the solution provided in the embodiment of the present application may also involve model pre-training technology. Pre-training (pre-training) trains the model through a large number of unlabeled or weakly labeled samples to obtain a set of model parameters; the model is initialized using this set of parameters to achieve a "hot start" of the model, and then the parameters are fine-tuned on the existing model architecture according to the specific task to fit the label data provided by the task. Exemplarily, a drug interaction model can be obtained by pre-training a graph network constructed according to the drug interaction relationship, and the drug interaction model can be used to initialize the representation vector of the drug for downstream tasks.

[0063] The embodiments of the present application can be applied to the field of intelligent medical care of artificial intelligence. Specifically, the embodiments of the present application can be used in a drug recommendation system in the field of intelligent medical care.

[0064] Figure 1 A schematic diagram of a system architecture involved in an embodiment of the present application is shown in FIG. Figure 1 As shown, the system architecture may include a user device 101 , a data collection device 102 , a training device 103 , an execution device 104 , a database 105 and a content library 106 .

[0065] The data acquisition device 102 is used to read the training data from the content library 106 and store the read training data in the database 105. The training data involved in the embodiment of the present application includes the actual taking situation of the user sample for the drug sample. The training data involved in the embodiment of the present application may also include the interaction relationship between the drug samples.

[0066] The training device 103 trains the machine learning model based on the training data maintained in the database 105. Exemplarily, the machine learning model can be a drug recommendation model, and the trained drug recommendation model can effectively recommend drugs. The machine learning model can also be a drug interaction model, and the trained drug interaction model can characterize the drugs in combination with the interaction relationship between drugs. The machine learning model obtained by the training device 103 can be applied to different systems or devices.

[0067] In addition, refer to Figure 1 The execution device 104 is configured with an I / O interface 107 to exchange data with external devices. For example, the original features of the user sent by the user device 101 are received through the I / O interface. The calculation module 109 in the execution device 104 uses the trained machine learning model to process the input original features of the user, output the medicine recommended to the user, and send the corresponding results to the user device 101 through the I / O interface.

[0068] The user device 101 may include a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a mobile internet device (MID), or other terminal devices with a drug recommendation function.

[0069] The execution device 104 may be a server.

[0070] Exemplarily, the server may be a computing device such as a rack server, a blade server, a tower server or a cabinet server, etc. The server may be an independent test server or a test server cluster composed of multiple test servers.

[0071] The server may be one or more servers. When there are multiple servers, there are at least two servers for providing different services, and / or there are at least two servers for providing the same service, such as providing the same service in a load balancing manner, which is not limited in the embodiments of the present application.

[0072] The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server can also become a node of the blockchain.

[0073] In this embodiment, the execution device 104 is connected to the user device 101 through a network. The network can be a wireless or wired network such as an intranet, the Internet, the Global System of Mobilecommunication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, or a call network.

[0074] It should be noted that Figure 1 It is only a schematic diagram of a system architecture provided by an embodiment of the present application. The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. In some embodiments, the data acquisition device 102 and the user device 101, the training device 103 and the execution device 104 can be the same device. The database 105 can be distributed on one server or on multiple servers, and the content library 106 can be distributed on one server or on multiple servers.

[0075] Figure 1 The network architecture in the paper can be applied to the drug recommendation system to make appropriate drug recommendations for different patients. However, most existing drug recommendation systems rely on text information in the patient's electronic health record and make drug recommendations based on the medication history of a large number of patients. If only the patient's electronic health record and historical medication are considered without considering drug interactions, on the one hand, the drugs recommended to the patient may contain inappropriate drug combinations, and on the other hand, the recommendation effect may be poor for new patients without electronic health records. Therefore, the existing drug recommendation system can no longer meet the increasingly complex medication needs of patients.

[0076] For example, for the elderly, as they age, they will experience problems such as deterioration of physiological functions, increased risk of disease, and decreased drug clearance. In the process of treating various geriatric diseases, taking multiple drugs at the same time has become an important factor leading to increased risks of adverse drug events, hospitalization, and death in the elderly. This phenomenon is more significant during special periods, when clinical resources have become scarce, and the elderly may increase the risk of adverse reactions if they lack the guidance of professional doctors when taking medication. In addition, taking multiple drugs at the same time also increases the possibility of drug-drug interactions, including potential drug antagonism, which leads to an imbalance between the increasingly complex medication needs of the elderly and the possible interactions between multiple drugs.

[0077] In view of this, the embodiments of the present application provide a drug recommendation method, a training model method, an apparatus, an electronic device and a storage medium, which can make drug recommendations based on drug interactions, thereby helping to recommend safer and more appropriate drugs.

[0078] Specifically, the users who take the first drug can be determined according to the drug taking situation of the users, and the first characterization vector of the first drug can be obtained by using the drug interaction model. Then, the drug recommendation model is used to determine whether to recommend the first drug to the first user according to the original features of the users who take the first drug, the first characterization vector of the first drug, and the original features of the first user.

[0079] In the embodiment of the present application, the drug interaction model is obtained by constructing a graph network based on the drug interaction relationship. The drug interaction model can characterize the input drug based on the drug interaction relationship to obtain a drug characterization vector. In other words, the drug characterization vector output by the drug interaction model can characterize the interaction relationship between drugs.

[0080] Exemplarily, drug-drug interaction relationships may include synergistic and antagonistic effects between drugs. For example, indapamide and perindopril have synergistic effects, and taking them together is more effective for treating hypertension; while theophlline, which is used as a cardiac stimulant, and enalapril, which is used to treat hypertension, have antagonistic effects, and taking them together may cause autoimmune diabetes. Therefore, when constructing a drug recommendation system, it is very important to pay attention to the interactions between drugs.

[0081] In an embodiment of the present application, the drug recommendation model is obtained by training a machine learning model based on the characterization vector of the drug sample and the actual taking situation of the drug sample by the user sample, and the characterization vector of the drug sample is obtained based on the drug interaction model.

[0082] Specifically, the drug interaction model can be used to obtain a characterization vector of the drug sample, and then the drug recommendation model is trained based on the characterization vector of the drug sample, the original features of the user sample, and the actual use of the drug sample by the user sample to obtain a trained drug recommendation model. Therefore, in the embodiment of the present application, the trained drug recommendation model introduces the interaction between drugs.

[0083] Therefore, the embodiment of the present application obtains the first characterization vector of the first drug through the drug interaction model, and the drug recommendation model can determine whether to recommend the first drug to the first user based on the first characterization vector, the original features of the user who takes the first drug, and the original features of the first user. Since the first characterization vector can characterize the interaction relationship between the first drug and other drugs, and the drug recommendation model introduces the interaction between drugs, the embodiment of the present application can help avoid the inclusion of inappropriate drug combinations in the drugs recommended to the user, thereby improving the safety of drug recommendations.

[0084] Exemplarily, an inappropriate drug combination may refer to a drug combination having antagonistic effects.

[0085] In the embodiment of the present application, the user who needs to recommend medicine, such as the first user, can be an old user who already has an electronic health record, or a new user who does not have an electronic health record, without limitation. The user can refer to a patient or patient who needs to take medicine.

[0086] In some instances, the drug recommendation method provided in the embodiments of the present application can provide doctors with prescription references during clinical diagnosis, preventing doctors who lack clinical experience from prescribing drugs that produce antagonistic effects, and can also recommend to doctors combinations of drugs that have synergistic effects with each other.

[0087] Furthermore, the drug recommendation method of the embodiment of the present application can provide reliable advice for the elderly to purchase and take over-the-counter drugs when clinical resources are scarce.

[0088] In some instances, the drug interaction model provided in the embodiments of the present application can timely update newly discovered drug combinations with interactions and provide reliable drug recommendations to doctors and patients.

[0089] The main idea of ​​the drug recommendation method in the embodiment of the present application is to combine the drug recommendation model (Drug Recommendation Model, DR Model) with the drug-drug interaction model (DDI Model) to achieve more appropriate drug recommendations.

[0090] Accordingly, the drug recommendation method provided in the embodiment of the present application may include a drug characterization stage and a drug recommendation stage. In the drug characterization stage, a first characterization vector of the first drug may be obtained based on the drug interaction model. In the drug recommendation stage, the first characterization vector of the first drug obtained in the drug characterization stage, as well as the original features of the user taking the first drug and the original features of the first user, may be input into the drug recommendation model to obtain a recommendation result of whether to recommend the first drug to the first user.

[0091] First, the drug characterization phase is described.

[0092] In the drug characterization stage, a drug interaction model can be established first. The drug interaction model can be obtained by training a machine learning model based on training samples of the real action relationship between drugs. The process of training the drug interaction model can be the pre-training process of the drug in the drug recommendation method provided in the embodiment of the present application.

[0093] Figure 2 The present invention provides a schematic flow chart of a method 200 for training a drug interaction model. The method 200 can be performed by any electronic device with data processing capabilities. For example, the electronic device can be implemented as a server or a terminal device. For example, the electronic device can be implemented as Figure 1 The training device 103 in the present application is not limited to this. Exemplarily, the drug interaction model can be used to perform vector representation of drugs based on the interactions between drugs.

[0094] like Figure 2 As shown, the method 200 for training a drug interaction model may include steps 210 to 240 .

[0095] 210, constructing a graph network according to the drug-drug interaction relationship, wherein the nodes of the graph network belong to the drug set, and the edges of the graph network belong to the drug-drug interaction set.

[0096] Among them, the drug set can be represented as V, the drug interaction set can be represented as E, and the graph network constructed according to the drug interaction relationship can be represented as G = (V, E).

[0097] In some embodiments, the drug-drug interaction set may include synergistic and antagonistic interactions between drugs. v and drug D u If there is a synergistic effect between vu =1, if drug D v and drug D u If there is an antagonistic effect between vu =-1. At the same time, the embodiment of the present application can also randomly sample several edges At this time, we can let e vu =0.

[0098] In some embodiments, the original features of the drugs in the drug set are obtained by one-hot encoding the drug ID. v The original features of ∈V are based on drug D v The ID is obtained by one-hot encoding, which can be obtained by using z v Exemplarily, the drug ID may be a drug number, or other symbols that can uniquely identify the drug.

[0099] In some embodiments, the graph network constructed based on the drug-drug interaction relationship may also be called a drug-drug interaction graph, which is not limited in this application.

[0100] See also Figure 3 , shows a specific example of the drug recommendation process provided by an embodiment of the present application. Among them, stage 1 is the drug characterization stage. In stage 1, drugs D1, D2, D3 and D4 are used as examples for illustration. Exemplarily, the drug-drug interaction matrix (Drug-Drug Interaction Matrix) corresponds to the drug-drug interaction label Y1, and both can be used to represent the drug-drug interaction relationship, where 1 represents the synergistic effect between drugs, and -1 represents the antagonistic effect between drugs. According to the drug-drug interaction matrix or the drug-drug interaction label Y1, a drug-drug interaction graph (Drug-Drug Interaction Graph) can be constructed, in which the solid line represents the synergistic effect between drugs, and the dotted line represents the antagonistic effect between drugs. All the edges in the drug-drug interaction graph represent the real action relationship between drugs.

[0101] 220, obtaining a training sample set, where the training sample set includes the actual action relationship of at least two drug samples in the graph network.

[0102] The at least two drug samples belong to a drug set, for example, they may be any two or more drugs in the drug set. The actual action relationship of the at least two drug samples may include, for example, synergistic effects, antagonistic effects, or no interaction between the at least two drug samples. v and drug D u For example, drug D v and drug D u The real interaction relationship can be e vu =1, e vu = -1 or e vu =0.

[0103] It should be noted that the training sample set may include a large number of training samples, each of which may be a real interaction relationship between two drugs, which is not limited in this application. As an example, the training sample set may include all edges in the drug-drug interaction graph.

[0104] 230 , inputting the original features of the at least two drug samples and the original features of each drug related to each drug sample in the at least two drug samples into the drug interaction model to obtain the scores of the edges between the at least two drug samples.

[0105] For example, the drug interaction model may be a Graph Isomorphism Network (GIN). That is, after constructing the drug interaction graph, GIN may be used as the drug interaction model to update the drug representation vector.

[0106] In some embodiments, the GIN may include multiple graph convolution layers, for example, t graph convolution layers, where t is a positive integer greater than 1. The input of the first graph convolution layer of the GIN is the original features of the drug sample and the original features of each drug that interacts with the drug sample. Exemplarily, the original features may be the original features of the drug in the drug-drug interaction graph, such as a feature vector obtained by one-hot encoding according to the drug number.

[0107] The updated hidden representation of the t-th graph convolutional layer of GIN is obtained by mapping the hidden representation of the drug sample output by the (t-1)-th graph convolutional layer of GIN and the hidden representation of each drug that interacts with the drug sample output by the (t-1)-th graph convolutional layer by the multilayer perceptron (MLP) in the t-th graph convolutional layer.

[0108] For example, the operation of the t-th graph convolutional layer of GIN is defined as follows:

[0109]

[0110] in, Indicates drug D v The hidden layer representation after being updated by the t-layer graph convolutional layer, represents the MLP model with parameter θ, ∈ (t) represents the learnable parameters in the graph convolution layer operation of the tth layer, Ν v Indicated with drug D v A collection of drugs that interact with each other. Indicates drug D u The hidden layer representation after updating the graph convolution layer of layer t, where the drug Du Belongs to drug set N v , which can be with drug D v Any drug interactions.

[0111] In some embodiments, the training samples include drug D u and drug D v As an example, in step 230, the drug D u The hidden layer representation after updating by the t-layer graph convolution layer and drug D v The hidden layer representation after updating by the t-layer graph convolution layer

[0112] Getting drug D u The hidden layer representation after updating by the t-layer graph convolution layer and drug D v The hidden layer representation after updating by the t-layer graph convolution layer Afterwards, we can represent the hidden layer and hidden layer representation Get Drug D u and drug D v The fraction of edges between .

[0113] As a possible way to achieve this, drug D u and drug D v The score of the edge between drugs can be calculated based on the drug D u The hidden layer representation and drug D v The hidden layer representation The inner product operation is performed between them. The specific formula is as follows:

[0114]

[0115] in, Indicates drug D u and drug D v The fraction of edges between T Represents a transpose operation.

[0116] Based on a similar method, all training samples in the training sample set can be obtained, such as the scores of edges between each pair of drugs.

[0117] 240 , updating the parameters of the drug interaction model according to the scores of the edges between the at least two drug samples and the actual action relationship between the at least two drug samples.

[0118] In some embodiments, the drug interaction model can be regarded as a link regression model on a graph, and the corresponding loss function can be obtained by a mean square error operation. Exemplarily, the loss #1 between the score of the edge between at least two drug samples and the true action relationship of the at least two drug samples can be determined according to the following formula:

[0119]

[0120] in, Indicates loss #1, E train Represents all the edges in the drug-drug interaction graph involved in the training process, including the original edge set E and the negatively sampled edges.

[0121] Then, the parameters of the drug interaction model can be updated according to the loss #1. For example, the parameters θ, ∈ in formula (1) can be updated. (t) to update.

[0122] Continue to see Figure 3 After completing the training of the drug interaction model (DDI Model), the learned Embeddings with Link Label Prediction are obtained, which can update the drug representation vector. The drug interaction model can also be called the drug interaction knowledge graph.

[0123] Therefore, in the embodiment of the present application, by using the real action relationship of at least two drug samples in the graph network, the original features of the at least two drug samples, and the original features of each drug related to each drug sample in the at least two drug samples, the drug interaction model is trained to obtain a trained drug interaction model. The drug representation vector obtained by the drug interaction model in the embodiment of the present application can characterize the interaction relationship between drugs.

[0124] In the drug characterization stage, after the drug interaction model is established, a suitable characterization vector of the drug can be obtained according to the drug interaction model. In the embodiment of the present application, when it is necessary to predict whether to recommend a first drug to a first user, a first characterization vector of the first drug can be obtained according to the drug interaction model. After obtaining the first characterization vector of the first drug, the drug recommendation stage can be entered.

[0125] Below, the drug recommendation stage is described.

[0126] In the drug recommendation stage, a drug recommendation model can be established first. The drug recommendation model can be obtained by training a machine learning model based on training samples of actual drug taking conditions of user samples.

[0127] Figure 4 The present invention provides a schematic flow chart of a method 400 for training a drug recommendation model. The method 400 can be executed by any electronic device with data processing capabilities. For example, the electronic device can be implemented as a server or a terminal device. For example, the electronic device can be implemented as Figure 1 The training device 103 in the present application is not limited to this. Exemplarily, the drug recommendation model can be used to recommend a suitable drug to the first user based on the drug interaction model.

[0128] like Figure 4 As shown, the method 400 for training a drug recommendation model may include steps 410 to 440 .

[0129] 410 , obtaining a first training sample set, where the first training sample set includes actual taking conditions of drug samples by user samples.

[0130] In some embodiments, the actual use of the drug sample by the user sample can be obtained from the bipartite graph between the user and the drug. For example, the user sample can belong to the user set in the bipartite graph between the user and the drug, and the drug sample can belong to the drug set in the bipartite graph between the user and the drug.

[0131] It should be noted that the bipartite graph between users and drugs is usually constructed based on the user's drug-taking situation in the training data. The bipartite graph may include a large number of known user drug-taking situations, such as all drugs currently taken by user #1, all drugs currently taken by user #2, all users currently taking drug #1, all users currently taking drug #2, etc.

[0132] See also Figure 3 , stage 2 is the drug recommendation stage. In stage 2, the drug set includes drugs D1, D2, D3 and D4, and the user set includes users S1, S2, S3 and S4. For example, the medication user matrix (Medication UserMatrix) corresponds to the user medication label Y2, and both can be used to represent the user's medication. For example, in Figure 3In the example, the known label Y2 includes {y1, y2, y3}, where y1 represents the taking of each drug D1, D2, D3 and D4 by user S1, which is (0, 1, 0, 0); y2 represents the taking of each drug D1, D2, D3 and D4 by user S2, which is (0, 0, 1, 0); y3 represents the taking of each drug D1, D2, D3 and D4 by user S3, which is (1, 0, 1, 0). The label Y2 includes the unknown label y4, that is, the taking of each drug D1, D2, D3 and D4 by user S4 is unknown. Among them, 1 represents that the user takes the drug, and 0 represents that the user does not take the drug.

[0133] Exemplarily, the first training sample set may include actual drug-taking situations of users corresponding to the known label Y2, that is, actual drug-taking situations of user samples S1, S2, and S3 for drug samples D1, D2, D3, and D4.

[0134] For further information, see Figure 3 , a bipartite graph between users and drugs can be constructed based on the drug user matrix or user drug label Y2, where the solid line between the user and the drug indicates that the user takes the drug, and the dotted line indicates that the user's use of the drug is unknown. At this time, the bipartite graph can be a bipartite graph for edge-level prediction, that is, predicting the use of each drug D1, D2, D3 and D4 by user S4, or it can be described as predicting the edge connection between user S4 and each drug D1, D2, D3 and D4.

[0135] In some embodiments, each user who has taken a drug sample and each drug taken by the user sample can be determined based on the user's drug-taking situation.

[0136] Exemplarily, each user who takes the drug sample and each drug taken by the user sample can be determined based on the bipartite graph between users and drugs.

[0137] Continue to see Figure 3 According to the bipartite graph between the user and the drug, it can be determined that the users who take drug sample D1 include user S3, the users who take drug sample D2 include user S1, the users who take drug sample D3 include users S2 and S3, the users who do not take drug sample D2, and the drugs taken by user sample S1 include drug D2, the drugs taken by user sample S2 include drug D3, and the drugs taken by user sample S3 include drugs D1 and D3.

[0138] 420, using the drug interaction model, obtaining a representation vector of the drug sample.

[0139] For example, see Figure 3 , the learned embedding vectors with connection label prediction obtained in stage 1 can be shared by embedding vector sharing to obtain the representation vectors of each drug sample D1, D2, D3 and D4.

[0140] 430 , input the original features of the user sample and the representation vector of the drug sample into the drug recommendation model to obtain a recommendation score for recommending the drug sample to the user sample.

[0141] For example, the original feature of the user may be determined based on at least one of the user's blood pressure, age, medical history, and psychological assessment data. The original features of different users are different.

[0142] In some embodiments, a drug recommendation model (DR Model) can be used to obtain a second representation vector of drug sample #1 based on the original features of each user taking drug sample #1, the representation vectors of each drug taken by user sample #1, and the first representation vector of drug sample #1, and obtain a recommendation score for recommending drug sample #1 to user sample #1 based on the second representation vector of drug sample #1.

[0143] In some embodiments, the drug recommendation model includes a fully connected network and a graph convolutional network.

[0144] As a possible implementation, see Figure 5 , the first characterization vector of the drug sample #1 can be updated according to steps 431 to 433 to obtain the second characterization vector of the drug sample #1.

[0145] 431. Using a fully connected network, the original features of each user who takes the drug sample #1, the representation vectors of each drug taken by the user sample #1, and the first representation vector of the drug sample #1 are mapped to the same feature dimension to obtain the initial hidden layer representation of each user who takes the drug sample #1, the initial hidden layer representation of each drug taken by the user sample #1, and the initial hidden layer representation of the drug sample #1.

[0146] Exemplarily, the drug recommendation model may use two fully connected networks (or fully connected neural networks) to map the original features of the user and the representation vector of the drug to the same feature dimension through feature transformation according to the following formulas (4) and (5):

[0147] h i =σ(W1x i +b1),i=1,2,…,m; (4)

[0148] h v =σ(W2xv +b2),v=1,2,…,|V|, (5)

[0149] Among them, h i and h v Represents user S respectively i and drug D v The initial hidden layer representation of m represents the number of users, x i and x v Represents user S respectively i and drug D v , σ(·) represents the activation function of the neural network, and W1, W2, b1, and b2 represent the learnable parameters of the fully connected network.

[0150] For example, user S i The original feature x i Can be used by user S i At least one of the blood pressure, age, medical history and psychological assessment data of the drug D v The original feature x v Drug D v The characterization vector can be the drug D obtained according to the drug interaction model obtained in the drug characterization stage. v The characterization vector, z v For example, when drug D v For drug sample #1, drug D v The original feature x v That is, the first characterization vector of the drug sample #1.

[0151] 432, input the initial hidden layer representation of each user who takes the drug sample #1 and the initial hidden layer representation of each drug taken by user sample #1 into the graph convolutional network to obtain an updated hidden layer representation of drug sample #1.

[0152] Exemplarily, the graph convolutional network may be a lightweight graph convolutional network (Light Graph Convolutional Network, LightGCN). That is, LightGCN may be used to update the initial hidden layer representation of drug sample #1 according to the initial hidden layer representations of each user who takes drug sample #1 and the initial hidden layer representations of each drug taken by user sample #1, thereby obtaining an updated hidden layer representation of drug sample #1.

[0153] Specifically, in LightGCN, the feature transformations and nonlinear activation functions commonly used in traditional neural network models are removed, and only simple weighted aggregation is used to update the features of the nodes.

[0154] In some embodiments, the graph convolution network may include multiple graph convolution layers, for example, may include t graph convolution layers, where t is a positive integer greater than 1. The input of the first graph convolution layer of the graph convolution network is the initial hidden layer representation of each user taking drug sample #1 obtained in step 431 and the initial hidden layer representation of each drug taken by user sample #1.

[0155] In some embodiments, the updated hidden representation of a drug in the t-th graph convolutional layer of the graph convolutional network is obtained based on the hidden representation output by each user who takes the drug in the (t-1)-th graph convolutional layer of the graph convolutional network, and the updated hidden representation of the user in the t-th graph convolutional layer is obtained based on the hidden representation output by each drug taken by the user in the (t-1)-th graph convolutional layer.

[0156] For example, the operation of the t-th graph convolutional layer in LightGCN is defined as follows:

[0157]

[0158]

[0159] in, and Represents user S respectively i and drug D v The hidden layer representation after updating the graph convolution layer at layer t (i.e. updating the hidden layer representation), N i Indicates user S i The collection of medicines taken, N v Indicates that you are taking medication D v A collection of users.

[0160] It can be understood that after the graph convolutional network is used to update the initial hidden representation of the drug, the updated hidden representation of the drug is obtained through the hidden representation of each user in the set of users who regularly take the drug. Further, the updated hidden representation of each user is obtained based on the hidden representation of the drug taken by each user, thereby realizing mutual representation between users and drugs, thereby enriching the hidden representations of users and drugs, and realizing the update of the initial hidden representation of users and the initial hidden representation of drugs.

[0161] Therefore, the updated hidden layer representation of drug sample #1 obtained in the embodiment of the present application includes the characteristics of each user in the user set who regularly takes drug sample #1, and the characteristics of each user in the user set can further include the characteristics of each drug in the drug set taken by the user.

[0162] 433. Obtain a second representation vector of the drug sample #1 according to the updated hidden layer representation of the drug sample #1 and the initial hidden layer representation of the drug sample #1.

[0163] In some embodiments, the hidden layer representations of drug sample #1 in each graph convolutional layer of the graph convolutional network can be weighted aggregated to obtain the aggregated updated hidden layer representation of the drug sample #1, and then the second representation vector of the drug sample #1 can be obtained based on the aggregated updated hidden layer representation and the initial hidden layer representation of the drug sample #1.

[0164] Exemplarily, after the graph convolution operation of the t-layer graph convolution network, the updated hidden layer representation of the drug sample #1 output by each graph convolution layer is weighted added, and the first representation vector of the drug sample #1 is added to obtain the second representation vector of the drug sample #1. The hyperparameter of each graph convolution layer may be the weight when the updated hidden layer representation of the drug sample #1 of each graph convolution layer is weightedly aggregated, which is used to indicate the importance of the hidden layer representation of the drug sample #1 of each graph convolution layer.

[0165] For example, the second characterization vector of drug sample #1 can be expressed as follows:

[0166]

[0167] Among them, h ′ v The second characterization vector representing drug sample #1, h v represents the initial hidden layer representation of drug sample #1, α t It is a hyperparameter that needs to be set by yourself, indicating the importance of the hidden layer representation of the drug at the tth layer.

[0168] After obtaining the second characterization vector of drug sample #1, a recommendation score for recommending drug sample #1 to user sample #1 may be obtained based on the original features of user sample #1 and the second characterization vector of drug sample #1.

[0169] In some embodiments, a fully connected network (such as the fully connected network in step 431) can be used to map the original features of user sample #1 to the same feature dimension as the second representation vector of drug sample #1 to obtain an initial hidden layer representation of user sample #1, and then determine a recommendation score for recommending drug sample #1 to user sample #1 based on the initial hidden layer representation of user sample #1 and the second representation vector of drug sample #1. For example, the recommendation score can be obtained based on the inner product of the initial hidden layer representation of user sample #1 and the second representation vector.

[0170] Specifically, to user S i Recommended Drugs D vThe recommendation score can be expressed as follows:

[0171]

[0172] in, Indicates that user S i Recommended Drugs D v The recommendation score, h i The representation obtained in formula (4) can be used, h ′ v The representation obtained in formula (8) can be used.

[0173] Continue to see Figure 3 Taking the user sample including users S1, S2, and S3, and the drug sample including drugs D1, D2, D3, and D4 as an example, in step 440, the original features of each user taking drugs D1, D2, D3, and D4, and the representation vectors of each drug taken by users S1, S2, and S3 can be input into the drug recommendation model to obtain the recommendation scores for recommending drugs D1, D2, D3, and D4 to users S1, S2, and S3 respectively.

[0174] 440 , updating the parameters of the drug recommendation model according to the recommendation score and the actual use of the drug sample by the user sample.

[0175] For example, the same number of negative samples as positive samples can be negatively sampled, and then loss #2 is determined based on the cross entropy loss. Here, the positive sample can be the original edge in the bipartite graph of user and drug. i , the drug samples include drug D v For example, loss #2 can be expressed as follows:

[0176]

[0177] in, represents loss #2, y iv Indicates user S i Drug D v The actual usage situation.

[0178] continue Figure 3 In the example in , when the user samples include users S1, S2, and S3, and the drug samples include drugs D1, D2, D3, and D4, the positive samples include four positive samples, namely, user S1 takes drug D2, user S2 takes drug D3, and user S3 takes drugs D1 and D2. At this time, four negative samples can be negatively sampled, such as user S1 does not take drug D1, user S2 does not take drugs D1 and D4, and user S3 does not take drug D3. Using these four positive samples and four negative samples, the above loss #2 can be obtained.

[0179] Then, the parameters of the drug recommendation model can be updated according to loss #2. Exemplarily, the parameters in formulas (4) and (5) including W1, W2, b1 and b2 can be updated. After completing the training of the drug recommendation model (DR Model), the drug recommendation model can be used to recommend drugs to users.

[0180] Therefore, in the embodiment of the present application, the characterization vector of the drug sample is obtained through the drug interaction model, and then the drug recommendation model is trained through the characterization vector of the drug sample, the original features of the user sample and the actual use of the drug sample by the user sample to obtain a trained drug recommendation model. The embodiment of the present application trains the drug recommendation model based on the characterization vector of the drug sample obtained by the drug interaction model, which can introduce the interaction between drugs into the drug recommendation model, thereby helping to avoid the drug recommendation model recommending inappropriate drug combinations to users and improve the safety of drug recommendations.

[0181] In the drug recommendation stage, after the drug recommendation model is trained, the original features of each user taking the first drug, the first characterization vector of the first drug and the original features of the first user can be input into the drug recommendation model to output a recommendation result of whether to recommend the first drug to the first user.

[0182] Figure 6 The schematic flow chart of a method 600 for recommending medicines provided in an embodiment of the present application is shown in FIG. The method 600 can be executed by any electronic device having data processing capability. For example, the electronic device can be implemented as a server or a terminal device. For another example, the electronic device can be implemented as Figure 1 The calculation module 109 in the present application is not limited to this. Exemplarily, the drug recommendation method can recommend suitable drugs to the user based on the drug interaction model and the drug recommendation model.

[0183] like Figure 6 As shown, the method 600 for drug recommendation may include steps 610 to 630 .

[0184] 610. Determine users who take the first drug based on the drug-taking status of the users.

[0185] Exemplarily, the users who take the first drug can be determined based on the bipartite graph between the users and the drugs. The first drug can belong to the drug set in the bipartite graph. Here, the users who take the first drug can be determined by obtaining users (excluding the first user) who have edge connections with the first drug in the bipartite graph between the users and the drugs.

[0186] In an embodiment of the present application, a user who needs to recommend a drug, such as a first user, may belong to a user set in a bipartite graph between users and drugs. The first user may be an old user who already has an electronic health record, or a new user who does not have an electronic health record, without limitation. An electronic health record (Electronic Health Record, EHR) can be an official personal health record that can be shared across multiple devices and institutions. For example, an electronic health record may include: age, height, weight, blood pressure, medical history, allergy history, list of medications taken, surgical information, psychological assessment, etc.

[0187] Exemplarily, when the first user is an old user who already has an electronic health record, the first user may have edge connections with other drugs except the first drug in the bipartite graph between users and drugs.

[0188] When the first user is a new user without an electronic health record, the first user may have no edge connection with any drug in the bipartite graph between users and drugs. Figure 3 , user S4 is a newly added user, and there is no edge connection between user S4 and all drugs (such as D1, D2, D3, D4) in the bipartite graph between users and drugs.

[0189] In some embodiments, the medicines taken by the first user may also be determined based on the user's medication status.

[0190] Exemplarily, when the first user and other drugs except the first drug in the bipartite graph between users and drugs have edge connections, the drugs taken by the first user can be determined based on the bipartite graph. Specifically, it can be implemented by obtaining drugs (excluding the first drug) that have edge connections with the first user in the bipartite graph between users and drugs.

[0191] It should be noted that the nodes of the bipartite graph between users and drugs include users and drugs, and users and the drugs they take are connected by edges. Therefore, the drug recommendation problem for users is an edge prediction problem on the bipartite graph. In the embodiment of the present application, the edge connection between the first user and the first drug is unknown. Therefore, predicting whether the first user takes the first drug is to predict whether the first user and the first drug are connected by an edge in the bipartite graph.

[0192] Specifically, the bipartite graph between users and drugs can be found in Figure 4 The description in will not be repeated here.

[0193] 620. Obtain a first characterization vector of the first drug using a drug interaction model; wherein the drug interaction model is obtained based on a graph network constructed based on drug interaction relationships.

[0194] In some embodiments, a drug interaction model may also be used to obtain a representation vector of each drug taken by the first user.

[0195] Specifically, the process of obtaining drug representation vectors in the drug interaction model can be found in Figure 2 The description in will not be repeated here.

[0196] 630 , using the drug recommendation model, determine whether to recommend the first drug to the first user based on the original features of each user who takes the first drug, the first characterization vector, and the original features of the first user.

[0197] The drug recommendation model is obtained by training a machine learning model based on the characterization vector of the first drug sample and the actual use of the first drug sample by the user sample, and the characterization vector of the first drug sample is obtained based on the above-mentioned drug interaction model. The trained drug recommendation model introduces the interaction between drugs.

[0198] Exemplarily, the drug recommendation model may obtain a recommendation score for recommending the first drug to the first user, and determine whether to recommend the first drug to the first user based on the recommendation score. For example, when the recommendation score is greater than or equal to a preset threshold, it may be determined that the first drug is recommended to the first user, and when the recommendation score is less than the preset threshold, it may be determined that the first drug is not recommended to the first user.

[0199] In some embodiments, the edge connection between the first user and the first drug in the bipartite graph between the user and the drug can be obtained based on whether the first user is predicted to take the first drug. Figure 3 Based on the drug recommendation method provided in the embodiment of the present application, the edge connection between user S4 and drugs D1, D2, D3, and D4 can be predicted.

[0200] Therefore, the embodiment of the present application obtains the first characterization vector of the first drug through the drug interaction model, and the drug recommendation model can determine whether to recommend the first drug to the first user based on the first characterization vector, the original features of the user who takes the first drug, and the original features of the first user. Since the first characterization vector can characterize the interaction relationship between the first drug and other drugs, and the drug recommendation model introduces the interaction between drugs, the embodiment of the present application can help avoid the inclusion of inappropriate drug combinations in the drugs recommended to the user, thereby improving the safety of drug recommendations.

[0201] Exemplarily, an inappropriate drug combination may refer to a drug combination having antagonistic effects.

[0202] For example, the drug recommendation model can obtain the recommendation score of each drug in the bipartite graph between the first user and the user and the drug, thereby obtaining a drug list recommended to the first user. The drug list does not contain inappropriate drug combinations, thereby improving the safety of drug recommendations.

[0203] For another example, the drug recommendation model can prevent the first drug recommended to the first user from forming an inappropriate drug combination with a drug currently being taken by the first user, thereby improving the safety of drug recommendations.

[0204] In some embodiments, when the drug interaction model is used to obtain the characterization vectors of each drug taken by the first user, a second characterization vector of the first drug can be obtained based on the original characteristics of each user taking the first drug, the first characterization vector, and the characterization vectors of each drug taken by the first user; then, based on the original characteristics of the first user and the second characterization vector, it is determined whether to recommend the first drug to the first user.

[0205] In some embodiments, the drug recommendation model includes a fully connected network and a graph convolutional network.

[0206] The second characterization vector of the first drug is obtained according to the original features of each user who takes the first drug, the first characterization vector, and the characterization vectors of each drug taken by the first user. This can be specifically implemented in the following manner:

[0207] Using a fully connected network, mapping the original features of each user who takes the first drug, the first representation vector, and the representation vector of each drug taken by the first user to the same feature dimension, to obtain an initial hidden layer representation of each user who takes the first drug, an initial hidden layer representation of the first drug, and an initial hidden layer representation of each drug taken by the first user;

[0208] Inputting the initial hidden layer representation of each user who takes the first drug and the initial hidden layer representation of each drug taken by the first user into a graph convolutional network to obtain an updated hidden layer representation of the first drug;

[0209] The second representation vector is obtained according to the updated hidden layer representation of the first drug and the initial hidden layer representation of the first drug.

[0210] In some embodiments, the updated hidden representation of the first drug in the t-th graph convolutional layer of the graph convolutional network is obtained based on the hidden representation output by each user who takes the first drug in the (t-1)-th graph convolutional layer of the graph convolutional network, and the updated hidden representation of the first user in the t-th graph convolutional layer is obtained based on the hidden representation output by each drug taken by the first user in the (t-1)-th graph convolutional layer, where t is a positive integer greater than 1.

[0211] The input of the first graph convolutional layer of the graph convolutional network is the initial hidden layer representation of each user who takes the first drug and the initial hidden layer representation of each drug taken by the first user.

[0212] In some embodiments, the hidden layer representations of the first drug in each graph convolutional layer of the graph convolutional network can be weighted aggregated to obtain an aggregated updated hidden layer representation of the first drug; and the second representation vector can be obtained based on the aggregated updated hidden layer representation and the initial hidden layer representation of the first drug.

[0213] In some embodiments, the hidden layer representations of the first drug in each graph convolution layer can be weighted aggregated according to the hyperparameters of each graph convolution layer to obtain the aggregated updated hidden layer representation, wherein the hyperparameters of each graph convolution layer represent the importance of the hidden layer representation of the first drug in each graph convolution layer.

[0214] Specifically, the process of obtaining the second representation vector of the first drug according to the original features of each user who takes the first drug, the first representation vector and the representation vectors of each drug taken by the first user is similar to the process of obtaining the second representation vector of drug sample #1, which can be seen in the above Figure 4 and Figure 5 The description is not repeated here.

[0215] Therefore, the embodiment of the present application obtains the second characterization vector based on the original features of each user taking the first drug, the first characterization vector, and the characterization vectors of each drug taken by the first user, so that the second characterization vector integrates the relevant knowledge of each user taking the first drug and each drug taken by the first user.

[0216] After the second characterization vector of the first drug is obtained, it can be determined whether to recommend the first drug to the first user according to the original features of the first user and the second characterization vector.

[0217] In some embodiments, a fully connected network can be used to map the original features of the first user to the same feature dimension as the second representation vector to obtain an initial hidden layer representation of the first user; and based on the initial hidden layer representation of the first user and the second representation vector, determine whether to recommend the first drug to the first user.

[0218] As a possible implementation method, a recommendation score for recommending the first drug to the first user can be obtained based on the initial hidden layer representation of the first user and the second representation vector of the first drug, and whether to recommend the first drug to the first user can be determined based on the recommendation score.

[0219] Specifically, the process of obtaining the recommendation score for recommending the first drug to the first user is similar to the process of obtaining the recommendation score for recommending drug sample #1 to user sample #1, which can be seen in Figure 4 The description in will not be repeated here.

[0220] Therefore, the drug recommendation model obtains the second characterization vector of the first drug based on the first characterization vector, the original features of the user taking the first drug, the original features of the first user, and the relevant knowledge of the drugs taken by the first user. Since the second characterization vector integrates the relevant knowledge of the users taking the first drug and the drugs taken by the first user, the recommendation result of recommending the first drug to the first user based on the second characterization vector is more accurate. Therefore, the embodiment of the present application can help avoid the inclusion of inappropriate drug combinations in the drugs recommended to users, thereby improving the safety of drug recommendations.

[0221] In some instances, the drug recommendation method provided in the embodiments of the present application can provide doctors with prescription references during clinical diagnosis, preventing doctors who lack clinical experience from prescribing drugs that produce antagonistic effects, and can also recommend to doctors combinations of drugs that have synergistic effects with each other.

[0222] Furthermore, the drug recommendation method of the embodiment of the present application can provide reliable advice for the elderly to purchase and take over-the-counter drugs when clinical resources are scarce.

[0223] In some instances, the drug interaction model provided in the embodiments of the present application can timely update newly discovered drug combinations with interactions and provide reliable drug recommendations to doctors and patients.

[0224] The specific implementation modes of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the above implementation modes. Within the technical concept of the present application, the technical solution of the present application can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the present application. For example, the various specific technical features described in the above specific implementation modes can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present application will not further explain various possible combinations. For another example, the various different implementation modes of the present application can also be arbitrarily combined, and as long as they do not violate the ideas of the present application, they should also be regarded as the contents disclosed in the present application.

[0225] It should also be understood that in the various method embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. It should be understood that these sequence numbers can be interchanged where appropriate, so that the embodiments of the present application described can be implemented in an order other than those shown or described.

[0226] The above describes the method embodiment of the present application in detail. Figures 7 to 10 , describe in detail the device embodiments of the present application.

[0227] Figure 7 FIG. 7 is a schematic block diagram of a drug recommendation device 700 according to an embodiment of the present application. Figure 7 As shown, the drug recommendation device 700 may include a determination unit 710 , a drug interaction model 720 , and a drug recommendation model 730 .

[0228] The determination unit 710 is used to determine each user who takes the first medicine according to the user's medication taking situation.

[0229] The drug interaction model 720 is used to obtain a first characterization vector of the first drug; wherein the drug interaction model is obtained based on a graph network constructed based on the interaction relationship between drugs.

[0230] The drug recommendation model 730 is used to determine whether to recommend the first drug to the first user based on the original features of each user who takes the first drug, the first characterization vector and the original features of the first user.

[0231] The drug recommendation model is obtained by training a machine learning model based on a characterization vector of a first drug sample and actual usage of the first drug sample by user samples, and the characterization vector of the first drug sample is obtained based on the drug interaction model.

[0232] In some embodiments, the determination unit 710 is further used to determine the medicines taken by the first user according to the medication status of the user.

[0233] The drug interaction model 720 is also used to obtain a representation vector of each drug taken by the first user.

[0234] The drug recommendation model 730 is specifically used for:

[0235] Obtaining a second representation vector of the first drug according to original features of each user who takes the first drug, the first representation vector, and the representation vectors of each drug taken by the first user;

[0236] Determine whether to recommend the first drug to the first user according to the original features of the first user and the second characterization vector.

[0237] In some embodiments, the drug recommendation model 730 includes a fully connected network and a graph convolutional network.

[0238] The drug recommendation model 730 is specifically used for:

[0239] Using a fully connected network, mapping the original features of each user who takes the first drug, the first representation vector, and the representation vector of each drug taken by the first user to the same feature dimension, to obtain an initial hidden layer representation of each user who takes the first drug, an initial hidden layer representation of the first drug, and an initial hidden layer representation of each drug taken by the first user;

[0240] Inputting the initial hidden layer representation of each user who takes the first drug and the initial hidden layer representation of each drug taken by the first user into a graph convolutional network to obtain an updated hidden layer representation of the first drug;

[0241] The second representation vector is obtained according to the updated hidden layer representation of the first drug and the initial hidden layer representation of the first drug.

[0242] In some embodiments, the updated hidden layer representation of the first drug in the t-th graph convolutional layer of the graph convolutional network is obtained based on the hidden layer representations output by each user who takes the first drug in the (t-1)-th graph convolutional layer of the graph convolutional network, and the updated hidden layer representation of the first user in the t-th graph convolutional layer is obtained based on the hidden layer representations output by each drug taken by the first user in the (t-1)-th graph convolutional layer, where t is a positive integer greater than 1;

[0243] The input of the first graph convolutional layer of the graph convolutional network is the initial hidden layer representation of each user taking the first drug and the initial hidden layer representation of each drug taken by the first user.

[0244] In some embodiments, the drug recommendation model 730 is specifically used to:

[0245] Performing weighted aggregation on the hidden layer representations of the first drug in each graph convolutional layer of the graph convolutional network to obtain an aggregated updated hidden layer representation of the first drug;

[0246] The second representation vector is obtained according to the aggregated updated hidden layer representation and the initial hidden layer representation of the first drug.

[0247] In some embodiments, the drug recommendation model 730 is specifically used to:

[0248] Using a fully connected network, mapping the original features of the first user to the same feature dimension as the second representation vector to obtain an initial hidden layer representation of the first user;

[0249] Determine whether to recommend the first drug to the first user according to the initial hidden layer representation of the first user and the second representation vector.

[0250] In some embodiments, the apparatus 700 further includes a first acquisition unit configured to acquire a first training sample set, wherein the first training sample set includes actual taking conditions of the first drug sample by the user sample.

[0251] The drug interaction model 720 is also used to obtain a characterization vector of the first drug sample;

[0252] The drug recommendation model 730 is further used to input the original features of the user sample and the representation vector of the first drug sample to obtain a recommendation score for recommending the first drug sample to the user sample;

[0253] The device 700 also includes a first training unit, which is used to update the parameters of the drug recommendation model according to the recommendation score and the actual taking situation of the first drug sample by the user sample.

[0254] In some embodiments, the nodes of the graph network belong to a drug set, and the edges of the graph network belong to a drug interaction set, wherein the drug interaction set includes synergy and antagonism between drugs.

[0255] In some embodiments, the original features of the drugs in the drug set are obtained by one-hot encoding the drug ID.

[0256] In some embodiments, the drug interaction model 720 includes a graph isomorphism network, wherein the updated hidden layer representation of the first drug in the t-th graph convolutional layer of the graph isomorphism network is obtained by mapping the hidden layer representation output by the first drug in the (t-1)-th graph convolutional layer of the graph isomorphism network and the hidden layer representation output by each drug that interacts with the first drug in the (t-1)-th graph convolutional layer, where t is a positive integer greater than 1;

[0257] The input of the first graph convolutional layer of the graph isomorphism network is the original features of the first drug and the original features of each drug that interacts with the first drug.

[0258] In some embodiments, the apparatus 700 further includes a second acquisition unit configured to acquire a second training sample set, wherein the second training sample set includes the actual action relationship between at least two second drug samples in the graph network.

[0259] The drug interaction model 720 is also used to input the original features of the at least two second drug samples and the original features of each drug related to each second drug sample in the at least two second drug samples to obtain the scores of the edges between the at least two second drug samples.

[0260] The apparatus 700 further includes a second training unit for updating the parameters of the drug interaction model according to the scores of the edges between the at least two second drug samples and the actual action relationship between the at least two second drug samples.

[0261] In some embodiments, the original characteristics of the first user are determined based on at least one of the first user's blood pressure, age, medical history, and psychological assessment data.

[0262] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, it will not be repeated here. Specifically, the device 700 for drug recommendation in this embodiment may correspond to the corresponding subject of the method 600 that executes the embodiment of the present application, and the aforementioned and other operations and / or functions of each module in the device 700 are respectively to implement the corresponding processes in the method 600 above, and for the sake of brevity, they will not be repeated here.

[0263] Figure 8 8 is a schematic block diagram of a training model apparatus 800 according to an embodiment of the present application. Figure 8 As shown, the device 800 for training the model may include an acquisition unit 810 , a drug interaction model 820 , a drug recommendation model 830 , and a training unit 840 .

[0264] The acquisition unit 810 is configured to acquire a first training sample set, where the first training sample set includes actual taking conditions of a first drug sample by a user sample.

[0265] The drug interaction model 820 is used to obtain the characterization vector of the first drug sample; wherein the drug interaction model is obtained based on a graph network constructed based on the interaction relationship between drugs.

[0266] The drug recommendation model 830 is used to input the original features of the user sample and the representation vector of the first drug sample into the drug recommendation model to obtain a recommendation score for recommending the first drug sample to the user sample.

[0267] The training unit 840 is used to update the parameters of the drug recommendation model according to the recommendation score and the actual taking situation of the first drug sample by the user sample.

[0268] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, it will not be repeated here. Specifically, the device 800 for training the model in this embodiment may correspond to the corresponding subject of the method 400 for executing the embodiment of the present application, and the aforementioned and other operations and / or functions of each module in the device 800 are respectively to implement the corresponding processes in the method 400 above, and for the sake of brevity, they will not be repeated here.

[0269] Fig. 9 is a schematic block diagram of a device 900 for training a model according to an embodiment of the present application. Fig. 9 As shown, the device 900 for training the model may include a construction unit 910 , an acquisition unit 920 , a drug interaction model 930 and a training unit 940 .

[0270] The construction unit 910 is used to construct a graph network according to the drug-drug interaction relationship, wherein the nodes of the graph network belong to the drug set, and the edges of the graph network belong to the drug-drug interaction set.

[0271] The acquisition unit 920 is used to acquire a second training sample set, where the second training sample set includes the actual action relationship between at least two second drug samples in the graph network.

[0272] The drug interaction model 930 is used to input the original features of the at least two second drug samples and the original features of each drug related to each second drug sample in the at least two second drug samples, and obtain the scores of the edges between the at least two second drug samples.

[0273] The training unit 940 is used to update the parameters of the drug interaction model according to the scores of the edges between the at least two second drug samples and the actual action relationship between the at least two second drug samples.

[0274] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, it will not be repeated here. Specifically, the device 900 for training the model in this embodiment may correspond to the corresponding subject of the method 200 for executing the embodiment of the present application, and the aforementioned and other operations and / or functions of each module in the device 900 are respectively to implement the corresponding processes in the method 200 above, and for the sake of brevity, they will not be repeated here.

[0275] The above describes the device and system of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0276] like Fig.10 It is a schematic block diagram of an electronic device 1000 provided in an embodiment of the present application.

[0277] like Fig.10 As shown, the electronic device 1000 may include:

[0278] The memory 1010 and the processor 1020, the memory 1010 is used to store the computer program and transmit the program code to the processor 1020. In other words, the processor 1020 can call and run the computer program from the memory 1010 to implement the method in the embodiment of the present application.

[0279] For example, the processor 1020 may be configured to execute the steps in the above method 200, 400, or 600 according to the instructions in the computer program.

[0280] In some embodiments of the present application, the processor 1020 may include but is not limited to:

[0281] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0282] In some embodiments of the present application, the memory 1010 includes but is not limited to:

[0283] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0284] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 1010 and executed by the processor 1020 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 1000.

[0285] Optional, such as Fig.10 As shown, the electronic device 1000 may further include:

[0286] The transceiver 1030 may be connected to the processor 1020 or the memory 1010 .

[0287] The processor 1020 may control the transceiver 1030 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 1030 may include a transmitter and a receiver. The transceiver 1030 may further include an antenna, and the number of antennas may be one or more.

[0288] It should be understood that the various components in the electronic device 1000 are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0289] According to one aspect of the present application, a communication device is provided, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, so that the encoder executes the method of the above method embodiment.

[0290] According to one aspect of the present application, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0291] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of the above method embodiment.

[0292] In other words, when implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0293] It is understandable that in the specific implementation of this application, user information and other related data may be involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0294] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0295] In the several embodiments provided in the present application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0296] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0297] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for drug recommendation, characterized in that: include: According to the drug taking situation of the user, determining each user who takes the first drug and each drug taken by the first user; Using a drug interaction model, obtaining a first characterization vector of the first drug and characterization vectors of each drug taken by the first user; wherein the drug interaction model is obtained based on a graph network constructed according to the interaction relationship between drugs; using a drug recommendation model, obtaining a second characterization vector of the first drug according to original features of each user who takes the first drug, the first characterization vector, and characterization vectors of each drug taken by the first user; and determining whether to recommend the first drug to the first user according to the original features of the first user and the second characterization vector; The drug recommendation model is obtained by training a machine learning model based on a characterization vector of a first drug sample and actual use of the first drug sample by a user sample, and the characterization vector of the first drug sample is obtained based on the drug interaction model; Wherein, the drug recommendation model includes a fully connected network and a graph convolutional network; The step of obtaining the second representation vector of the first drug according to the original features of each user who takes the first drug, the first representation vector and the representation vectors of each drug taken by the first user includes: Using a fully connected network, mapping the original features of each user who takes the first drug, the first representation vector, and the representation vector of each drug taken by the first user to the same feature dimension, to obtain an initial hidden layer representation of each user who takes the first drug, an initial hidden layer representation of the first drug, and an initial hidden layer representation of each drug taken by the first user; Inputting the initial hidden layer representation of each user who takes the first drug and the initial hidden layer representation of each drug taken by the first user into a graph convolutional network to obtain an updated hidden layer representation of the first drug; The second representation vector is obtained according to the updated hidden layer representation of the first drug and the initial hidden layer representation of the first drug.

2. The method according to claim 1, characterized in that The updated hidden layer representation of the first drug in the t-th graph convolutional layer of the graph convolutional network is obtained based on the hidden layer representations output by each user who takes the first drug in the (t-1)-th graph convolutional layer of the graph convolutional network, and the updated hidden layer representation of the first user in the t-th graph convolutional layer is obtained based on the hidden layer representations output by each drug taken by the first user in the (t-1)-th graph convolutional layer, where t is a positive integer greater than 1; The input of the first graph convolution layer of the graph convolution network is the initial hidden layer representation of each user taking the first drug and the initial hidden layer representation of each drug taken by the first user.

3. The method according to claim 1, characterized in that The step of obtaining the second representation vector according to the updated hidden layer representation of the first drug and the initial hidden layer representation of the first drug includes: Performing weighted aggregation on the hidden layer representations of the first drug in each graph convolutional layer of the graph convolutional network to obtain an aggregated updated hidden layer representation of the first drug; The second representation vector is obtained according to the aggregated updated hidden layer representation and the initial hidden layer representation of the first drug.

4. The method according to claim 1, characterized in that The determining, according to the original feature of the first user and the second characterization vector, whether to recommend the first drug to the first user comprises: Using a fully connected network, mapping the original features of the first user to the same feature dimension as the second representation vector to obtain an initial hidden layer representation of the first user; Determine whether to recommend the first drug to the first user according to the initial hidden layer representation of the first user and the second representation vector.

5. The method according to any one of claims 1 to 4, characterized in that: Also includes: Acquire a first training sample set, where the first training sample set includes actual taking conditions of the first drug sample by the user sample; Using the drug interaction model, obtaining a characterization vector of the first drug sample; Inputting the original features of the user sample and the representation vector of the first drug sample into the drug recommendation model to obtain a recommendation score for recommending the first drug sample to the user sample; The parameters of the drug recommendation model are updated according to the recommendation score and the actual taking situation of the first drug sample by the user sample.

6. The method according to any one of claims 1 to 4, characterized in that: The nodes of the graph network belong to a drug set, and the edges of the graph network belong to a drug interaction set, wherein the drug interaction set includes synergistic effects and antagonistic effects between drugs.

7. The method according to claim 6, characterized in that The original features of the drugs in the drug set are obtained by performing one-hot encoding on the drug IDs.

8. The method according to any one of claims 1 to 4, characterized in that: The drug interaction model includes a graph isomorphism network, wherein the updated hidden layer representation of the first drug in the t-th graph convolutional layer of the graph isomorphism network is obtained by mapping the hidden layer representation output by the first drug in the (t-1)-th graph convolutional layer of the graph isomorphism network and the hidden layer representation output by each drug that interacts with the first drug in the (t-1)-th graph convolutional layer, and t is a positive integer greater than 1; The input of the first graph convolutional layer of the graph isomorphism network is the original features of the first drug and the original features of each drug that interacts with the first drug.

9. The method according to any one of claims 1 to 4, characterized in that: Also includes: Acquire a second training sample set, wherein the second training sample set includes the real action relationship of at least two second drug samples in the graph network; Inputting the original features of the at least two second drug samples and the original features of each drug related to each second drug sample in the at least two second drug samples into the drug interaction model to obtain the scores of the edges between the at least two second drug samples; The parameters of the drug interaction model are updated according to the scores of the edges between the at least two second drug samples and the actual action relationship between the at least two second drug samples.

10. The method according to any one of claims 1 to 4, characterized in that: The original feature of the first user is determined based on at least one of the blood pressure, age, medical history and psychological assessment data of the first user.

11. A method for training a drug recommendation model, characterized in that: include: Acquire a first training sample set, where the first training sample set includes actual taking conditions of a first drug sample by a user sample; Using the drug interaction model, a first characterization vector of the first drug sample and characterization vectors of each drug taken by the user sample are obtained; wherein the drug interaction model is obtained based on a graph network constructed according to the interaction relationship between drugs; Inputting the original features of the user sample, the first characterization vector of the first drug sample, and the characterization vectors of each drug taken by the user sample into the drug recommendation model to obtain a second characterization vector of the first drug sample; and obtaining a recommendation score for recommending the first drug sample to the user sample based on the second characterization vector of the first drug sample; updating the parameters of the drug recommendation model according to the recommendation score and the actual taking situation of the first drug sample by the user sample; Among them, the drug recommendation model includes a fully connected network and a graph convolutional network; The original features of the user sample, the first characterization vector of the first drug sample, and the characterization vectors of each drug taken by the user sample are input into the drug recommendation model, and the second characterization vector of the first drug sample includes: Using a fully connected network, the original features of the user sample, the representation vectors of the drugs taken by the user sample, and the first representation vector of the first drug sample are mapped to the same feature dimension to obtain an initial hidden layer representation of each user who takes the first drug sample, an initial hidden layer representation of each drug taken by the user sample, and an initial hidden layer representation of the first drug sample; Inputting the initial hidden layer representation of each user who takes the first drug sample and the initial hidden layer representation of each drug taken by the user sample into the graph convolutional network to obtain an updated hidden layer representation of the first drug sample; A second representation vector of the first drug sample is obtained according to the updated hidden layer representation of the first drug sample and the initial hidden layer representation of the first drug sample.

12. A device for recommending medicines, characterized in that: include: a determination unit, configured to determine each user who takes the first drug and each drug taken by the first user according to the drug taking situation of the user; A drug interaction model, used to obtain a first characterization vector of the first drug and characterization vectors of each drug taken by the first user; wherein the drug interaction model is obtained based on a graph network constructed according to the interaction relationship between drugs; a drug recommendation model, configured to obtain a second characterization vector of the first drug according to original features of each user who takes the first drug, the first characterization vector, and characterization vectors of each drug taken by the first user; and determine whether to recommend the first drug to the first user according to the original features of the first user and the second characterization vector; The drug recommendation model is obtained by training a machine learning model based on a characterization vector of a first drug sample and actual use of the first drug sample by a user sample, and the characterization vector of the first drug sample is obtained based on the drug interaction model; Wherein, the drug recommendation model includes a fully connected network and a graph convolutional network; Wherein, the drug recommendation model is specifically used for: Using a fully connected network, mapping the original features of each user who takes the first drug, the first representation vector, and the representation vector of each drug taken by the first user to the same feature dimension, to obtain an initial hidden layer representation of each user who takes the first drug, an initial hidden layer representation of the first drug, and an initial hidden layer representation of each drug taken by the first user; Inputting the initial hidden layer representation of each user who takes the first drug and the initial hidden layer representation of each drug taken by the first user into a graph convolutional network to obtain an updated hidden layer representation of the first drug; The second representation vector is obtained according to the updated hidden layer representation of the first drug and the initial hidden layer representation of the first drug.

13. A device for training a drug recommendation model, characterized in that: include: An acquisition unit, configured to acquire a first training sample set, wherein the first training sample set includes actual taking conditions of a first drug sample by a user sample; A drug interaction model, used to obtain a first characterization vector of the first drug sample and a characterization vector of each drug taken by the user sample; wherein the drug interaction model is obtained based on a graph network constructed according to the interaction relationship between drugs; a drug recommendation model, configured to input the original features of the user sample, the first characterization vector of the first drug sample, and the characterization vectors of each drug taken by the user sample into the drug recommendation model to obtain a second characterization vector of the first drug sample; and obtain a recommendation score for recommending the first drug sample to the user sample based on the second characterization vector of the first drug sample; A training unit, configured to update the parameters of the drug recommendation model according to the recommendation score and the actual taking situation of the first drug sample by the user sample; Wherein, the drug recommendation model includes a fully connected network and a graph convolutional network; Wherein, the drug recommendation model is specifically used for: Using a fully connected network, the original features of the user sample, the representation vectors of the drugs taken by the user sample, and the first representation vector of the first drug sample are mapped to the same feature dimension to obtain an initial hidden layer representation of each user who takes the first drug sample, an initial hidden layer representation of each drug taken by the user sample, and an initial hidden layer representation of the first drug sample; Inputting the initial hidden layer representation of each user who takes the first drug sample and the initial hidden layer representation of each drug taken by the user sample into the graph convolutional network to obtain an updated hidden layer representation of the first drug sample; A second representation vector of the first drug sample is obtained according to the updated hidden layer representation of the first drug sample and the initial hidden layer representation of the first drug sample.

14. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores instructions, and when the processor executes the instructions, the processor executes the method according to any one of claims 1 to 11.

15. A computer storage medium, characterized in that Used to store a computer program, the computer program comprising instructions for executing the method according to any one of claims 1 to 11.

16. A computer program product, characterized in that The method comprises a computer program code, and when the computer program code is executed by an electronic device, the electronic device executes the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Drug package recommendation method and device, computer system and readable storage medium

    CN112802573A

  • Drug recommendation method and device, equipment and storage medium

    CN112951362A

  • Drug recommendation method and system for chronic obstructive pulmonary disease

    CN113889219A