A drug adverse reaction prediction system and method based on knowledge graph
Through a system based on knowledge graph, a multi-drug adverse reaction database is constructed and a machine learning algorithm is used to solve the problem of difficult to predict the combination of multiple drugs in the existing technology, and the prediction of potential adverse reactions and combination of multiple drugs is achieved. The determination of conflicts has improved the efficiency of inquiry of adverse drug reactions and the safety of drug use.
Patent Information
- Application Number
- CN202210281522.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-03-21
AI Technical Summary
The prior art is difficult to predict potential adverse reactions of multiple drugs combined with drugs, and can only query known data, but cannot predict unknown reactions, which increases the difficulty of predicting adverse reactions of drugs.
Using a knowledge graph-based system, including database module, knowledge graph module and prediction module, to build a multi-drug adverse reaction database, draw a knowledge graph, use machine learning and deep learning algorithms to predict potential adverse reactions, and determine the number of multiple drugs. conflict.
The prediction of potential adverse drug reactions and the determination of conflicts in combination with multiple drugs have been achieved, the efficiency of querying adverse drug reactions has been improved, users have been reminded to use drugs for safety, and avoid the harm of combined multi-drug use.
Smart Images

Figure CN114743692B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent medical technology, and in particular to a knowledge graph-based drug adverse reaction prediction system and method. Background Art
[0002] Adverse drug reactions (ADRs) are unexpected and sometimes dangerous effects of drugs, and are one of the main causes of morbidity and mortality in patients during medical treatment. Adverse drug reactions mainly include allergic reactions, sequelae, idiosyncratic reactions, dependence, superinfection, carcinogenicity, and mutation. In addition, anti-infective drugs may also contain side effects caused by drug quality problems and improper use. These side effects may occur when the drug itself contains impurities or is not used.
[0003] Therefore, it is necessary to predict the adverse reactions of drugs so that users can be informed of adverse reactions in a timely manner and assist doctors in medication operations. Traditional research methods for predicting adverse drug reactions mostly use binary predictions, which can only predict the adverse reactions of a single drug. However, in reality, multiple drugs are often taken together, that is, multi-drug combination. There is a high probability of interactions or conflict reactions between multiple drugs, which further increases the probability of adverse drug reactions and increases the difficulty of predicting adverse drug reactions. In addition, most existing technologies can only query and obtain currently known adverse reaction data, but cannot predict potential unknown adverse reactions of drugs. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a drug adverse reaction prediction system and method based on knowledge graph, so as to predict the potential adverse reactions of drugs and determine the conflicting reactions of multiple drugs.
[0005] The object of the present invention can be achieved by the following technical solutions: a drug adverse reaction prediction system based on knowledge graph, comprising a database module, a knowledge graph module and a prediction module, wherein the database module is connected to the knowledge graph module, the knowledge graph module is interactively connected to the prediction module, and the database module is used to construct a database containing multiple drug names and corresponding adverse reaction data;
[0006] The knowledge graph module is used to query the adverse reactions of the drug to be tested from the database and draw the corresponding knowledge graph; and to determine whether there is an adverse reaction conflict between multiple drugs to be tested and draw the corresponding knowledge graph;
[0007] The prediction module is used to predict potential adverse reactions of the drug to be tested.
[0008] Furthermore, the database module includes a data input unit and a data cleaning unit connected in sequence, the data input unit is used to receive a drug adverse reaction data set, and the data cleaning unit is used to clean and deduplicate the drug adverse reaction data set to construct a database.
[0009] Furthermore, the adverse drug reaction data set includes multiple drug names and adverse reaction data corresponding to the drugs.
[0010] Furthermore, the knowledge graph module includes a data reading unit, a knowledge graph construction unit, and a data query unit connected in sequence, the data reading unit is connected to the database module, the data query unit is interactively connected to the prediction module, and the data reading unit is used to obtain the database from the database module;
[0011] The data query unit is used to query the adverse reaction data of the drug to be tested from the acquired database, determine whether there is an adverse reaction conflict between multiple drugs to be tested, and receive the prediction result data output by the prediction module;
[0012] The knowledge graph construction unit is used to draw an adverse reaction graph of a drug to be tested and to draw conflicting adverse reaction graphs between multiple drugs to be tested.
[0013] Furthermore, the knowledge graph module is also provided with a visualization unit, and the visualization unit is used to display the adverse reaction graph to the user.
[0014] Further, the prediction module includes a data preprocessing unit, an encoder unit, a decoder unit and an output unit, wherein the data preprocessing unit, the encoder unit and the decoder unit are connected in sequence, the data preprocessing unit is connected to the data reading unit, the decoder unit is connected to the data query unit, the output unit is connected to the data query unit, and the data preprocessing unit is used to preprocess the data in the acquired database;
[0015] The encoder unit and the decoder unit are used to learn the relationship between adverse drug reactions;
[0016] The output unit is used to combine the adverse reaction map of the drug to be tested and the relationship between the adverse reactions of the drug to obtain the potential adverse reaction prediction result of the drug to be tested.
[0017] Furthermore, the encoder unit and the decoder unit are respectively provided with LSTM (Long Short-Term Memory) sub-units, and the decoder unit is also provided with an attention sub-unit.
[0018] A method for predicting adverse drug reactions based on knowledge graph includes the following steps:
[0019] S1. Inputting the drug adverse reaction data set into the database module to construct a database containing multiple drug names and corresponding adverse reaction data;
[0020] S2. The knowledge graph module receives a single name of a drug to be tested, and then executes step S3;
[0021] When the knowledge graph module receives multiple names of drugs to be tested, step S4 is executed;
[0022] S3. According to the name of the drug to be tested, the knowledge graph module queries the adverse reaction data of the drug to be tested from the database and draws it into an adverse reaction graph;
[0023] The prediction module obtains data from the database through the knowledge graph module, pre-processes the obtained data, and then uses machine learning to obtain the relationship between adverse drug reactions;
[0024] The prediction module combines the adverse reaction map of the drug to be tested and the adverse reaction relationship of the drug to predict the potential adverse reaction results of the drug to be tested;
[0025] S4. According to the names of multiple drugs to be tested, the knowledge graph module respectively queries the adverse reaction data of multiple drugs to be tested from the database, and determines whether there is an adverse reaction conflict between the multiple drugs to be tested. If it is determined to be yes, a conflict adverse reaction graph between the multiple drugs to be tested is drawn; otherwise, adverse reaction graphs of the multiple drugs to be tested are drawn;
[0026] The prediction module obtains data from the database through the knowledge graph module, pre-processes the obtained data, and then uses machine learning to obtain the relationship between adverse drug reactions;
[0027] The prediction module combines multiple adverse reaction maps of the tested drugs and the adverse reaction relationships of the drugs to predict the potential adverse reaction results of the multiple tested drugs.
[0028] Furthermore, the knowledge graph module specifically creates an environment through the Neo4j graph database, and then finally draws a knowledge graph of adverse drug reactions through Py2Neo.
[0029] Furthermore, the prediction module is specifically based on the Attention mechanism of deep learning, and according to the Encoder-decoder framework, combined with the LSTM model to learn the relationship between adverse drug reactions.
[0030] Compared with the prior art, the present invention sets a knowledge graph module and uses the knowledge graph module to obtain the constructed database from the database module, so that the adverse reaction data of the drug to be tested can be queried and an intuitive knowledge graph can be generated. The adverse reaction conflicts between multiple drugs to be tested can be judged, and the same adverse reactions of multiple drugs can be displayed through the knowledge graph to effectively avoid the possible hazards of multi-drug combination.
[0031] The present invention sets a prediction module, uses the prediction module to obtain a constructed database from a database module through a knowledge graph module, and adopts a machine learning method to obtain the relationship between adverse drug reactions. Combined with the adverse reaction graph generated by the knowledge graph module, it can predict potential undiscovered adverse reactions of drugs and further remind users to use drugs safely. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a schematic diagram of the system structure of the present invention.
[0033] Explanation of the marks in the figure: 1. Database module; 2. Knowledge graph module; 3. Prediction module; 4. Data input unit; 5. Data cleaning unit; 6. Data reading unit; 7. Knowledge graph construction unit; 8. Data query unit; 9. Visualization unit; 10. Data preprocessing unit; 11. LSTM subunit; 12. Encoder unit; 13. Attention subunit; 14. Decoder unit; 15. Output unit. DETAILED DESCRIPTION
[0034] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0035] Example
[0036] like Figure 1 As shown, a drug adverse reaction prediction system based on knowledge graph includes a database module 1, a knowledge graph module 2 and a prediction module 3, wherein the database module 1 is connected to the knowledge graph module 2, and the knowledge graph module 2 is interactively connected to the prediction module 3, and the database module 1 is used to construct a database containing multiple drug names and corresponding adverse reaction data;
[0037] The knowledge graph module 2 is used to query the adverse reactions of the tested drugs from the database and draw the corresponding knowledge graph; and to determine whether there is an adverse reaction conflict between multiple tested drugs and draw the corresponding knowledge graph;
[0038] The prediction module 3 is used to predict the potential adverse reactions of the drug to be tested.
[0039] Among them, the database module 1 includes a data input unit 4 and a data cleaning unit 5 connected in sequence, the data input unit 4 is used to receive a drug adverse reaction data set (including multiple drug names and adverse reaction data corresponding to the drugs), and the data cleaning unit 5 is used to clean and deduplicate the drug adverse reaction data set to construct a database.
[0040] The knowledge graph module 2 includes a data reading unit 6, a knowledge graph construction unit 7, and a data query unit 8 which are connected in sequence. The data reading unit 6 is connected to the database module 1, and the data query unit 8 is interactively connected to the prediction module 3. The data reading unit 6 is used to obtain a database from the database module 1;
[0041] The data query unit 8 is used to query the adverse reaction data of the drug to be tested from the acquired database, determine whether there is an adverse reaction conflict between multiple drugs to be tested, and receive the prediction result data output by the prediction module 3;
[0042] The knowledge graph construction unit 7 is used to draw adverse reaction graphs of the drug to be tested and to draw adverse reaction graphs that conflict between multiple drugs to be tested;
[0043] In addition, the knowledge graph module 2 is also provided with a visualization unit 9, and the visualization unit 9 is used to display the adverse reaction graph to the user.
[0044] The prediction module 3 includes a data preprocessing unit 10, an encoder unit 12, a decoder unit 14 and an output unit 15. The data preprocessing unit 10, the encoder unit 12 and the decoder unit 14 are connected in sequence. The data preprocessing unit 10 is connected to the data reading unit 6, the decoder unit 14 is connected to the data query unit 8, and the output unit 15 is connected to the data query unit 8. The data preprocessing unit 10 is used to preprocess the data in the acquired database;
[0045] The encoder unit 12 and the decoder unit 14 are used to learn the relationship between adverse drug reactions;
[0046] The output unit 15 is used to combine the adverse reaction map of the drug to be tested and the relationship between the adverse reactions of the drugs to obtain the potential adverse reaction prediction result of the drug to be tested.
[0047] In this embodiment, the encoder unit 12 and the decoder unit 14 are respectively provided with an LSTM sub-unit 11, and the decoder unit 14 is also provided with an attention sub-unit 13.
[0048] The above system is applied in practice to realize a knowledge graph-based drug adverse reaction prediction method, which includes the following steps:
[0049] S1. Inputting the drug adverse reaction data set into the database module to construct a database containing multiple drug names and corresponding adverse reaction data;
[0050] S2. The knowledge graph module receives a single name of a drug to be tested, and then executes step S3;
[0051] When the knowledge graph module receives multiple names of drugs to be tested, step S4 is executed;
[0052] S3. According to the name of the drug to be tested, the knowledge graph module queries the adverse reaction data of the drug to be tested from the database and draws it into an adverse reaction graph;
[0053] The prediction module obtains data from the database through the knowledge graph module, pre-processes the obtained data, and then uses machine learning to obtain the relationship between adverse drug reactions;
[0054] The prediction module combines the adverse reaction map of the drug to be tested and the adverse reaction relationship of the drug to predict the potential adverse reaction results of the drug to be tested;
[0055] S4. According to the names of multiple drugs to be tested, the knowledge graph module respectively queries the adverse reaction data of multiple drugs to be tested from the database, and determines whether there is an adverse reaction conflict between the multiple drugs to be tested. If it is determined to be yes, a conflict adverse reaction graph between the multiple drugs to be tested is drawn; otherwise, adverse reaction graphs of the multiple drugs to be tested are drawn;
[0056] The prediction module obtains data from the database through the knowledge graph module, pre-processes the obtained data, and then uses machine learning to obtain the relationship between adverse drug reactions;
[0057] The prediction module combines multiple adverse reaction maps of the tested drugs and the adverse reaction relationships of the drugs to predict the potential adverse reaction results of the multiple tested drugs.
[0058] In this embodiment, considering that the language selected by the system should be readable by both operators and processors, Neo4j is used to build the knowledge base. The use of Neo4j ensures the applicability of the knowledge base construction with other underlying control systems. In addition, by implementing the built-in semantic reasoning function, Py2Neo can realize the construction of the knowledge graph on the Python platform, and the Tensorflow framework can ensure the implementation and operation of the prediction algorithm.
[0059] Therefore, the knowledge graph module creates an environment through the Neo4j graph database, and then finally draws the adverse drug reaction knowledge graph through Py2Neo; the prediction module is based on the Attention mechanism of deep learning, and according to the Encoder-decoder framework, combined with the LSTM model to learn the relationship between adverse drug reactions.
[0060] In summary, the following functions can be achieved by adopting this technical solution:
[0061] (1) Query function: query the corresponding adverse reactions based on the input drug name;
[0062] (2) Drawing function: Draw corresponding knowledge graphs based on drugs and their adverse reactions and display the graphs visually on the web page;
[0063] (3) Display attribute function: After drawing the graph, when clicking each node, the corresponding attributes of each node can be displayed;
[0064] (4) Conflict judgment function: Enter multiple drug names and if there is a conflict in adverse reactions, the user will be reminded.
[0065] (5) Adverse reaction prediction function: predict potential adverse reactions based on the existing adverse reactions of the drug.
[0066] When constructing the database in this embodiment, the data set used is in Excel format and contains the drug name and the adverse reaction data of the drug. The specific application process of this embodiment is as follows:
[0067] a) Read the drug labels in the data set, and clean and remove duplicates from the data set;
[0068] b) reading the cleaned data in step a) to build a database;
[0069] c) reading the database constructed in step b), inputting the drug name, and searching for adverse reactions of the drug according to the input drug name;
[0070] d) based on the drugs and adverse reaction data queried in step c), draw a corresponding knowledge graph and visualize the knowledge graph;
[0071] e) According to the knowledge graph drawn in step d), click on the node, and the corresponding attributes will be displayed for each node;
[0072] f) reading the preprocessed data in step a), inputting two drug names, if the two drugs have the same adverse reaction, and determining that there is a conflict in adverse reactions between the two drugs, constructing a knowledge graph to visualize the conflicting adverse reactions;
[0073] g) based on the two drugs and adverse reactions queried in step e), draw a corresponding knowledge graph and display the visual graph on a web page;
[0074] h) reading the database constructed in step b), performing data preprocessing, and learning the relationship between adverse reactions according to the algorithm, and predicting the potential adverse reactions of the drug according to the drugs and adverse reactions queried in step c).
[0075] This technical solution first cleans the adverse reaction data set, and by reading the data and constructing a knowledge graph database and visualizing the knowledge graph, it effectively improves the efficiency of adverse drug reaction queries and is easy to operate. Based on the query of multiple drugs, it can remind users of the hazards of multi-drug combination use; and combined with deep learning algorithms, it predicts potential undetected adverse reactions of drugs, providing a preliminary warning for users' medication safety.
Claims
1. A drug adverse reaction prediction system based on knowledge graph, characterized in that: It includes a database module, a knowledge graph module and a prediction module, wherein the database module is connected to the knowledge graph module, the knowledge graph module is interactively connected to the prediction module, and the database module is used to construct a database containing multiple drug names and corresponding adverse reaction data; The knowledge graph module is used to query the adverse reactions of the drug to be tested from the database and draw the corresponding knowledge graph; and to determine whether there is an adverse reaction conflict between multiple drugs to be tested and draw the corresponding knowledge graph; The prediction module is used to predict potential adverse reactions of the drug to be tested; The knowledge graph module includes a data reading unit, a knowledge graph construction unit, and a data query unit connected in sequence, wherein the data reading unit is connected to the database module, the data query unit is interactively connected to the prediction module, and the data reading unit is used to obtain a database from the database module; The data query unit is used to query the adverse reaction data of the drug to be tested from the acquired database, determine whether there is an adverse reaction conflict between multiple drugs to be tested, and receive the prediction result data output by the prediction module; The knowledge graph construction unit is used to draw adverse reaction graphs of the drug to be tested and to draw adverse reaction graphs that conflict between multiple drugs to be tested; The prediction module includes a data preprocessing unit, an encoder unit, a decoder unit and an output unit, wherein the data preprocessing unit, the encoder unit and the decoder unit are connected in sequence, the data preprocessing unit is connected to the data reading unit, the decoder unit is connected to the data query unit, and the output unit is connected to the data query unit, and the data preprocessing unit is used to preprocess the data in the acquired database; The encoder unit and the decoder unit are used to learn the relationship between adverse drug reactions; The output unit is used to combine the adverse reaction map of the drug to be tested and the relationship between the adverse reactions of the drug to obtain the potential adverse reaction prediction result of the drug to be tested; The encoder unit and the decoder unit are respectively provided with LSTM subunits, and the decoder unit is further provided with an attention subunit; The knowledge graph module specifically creates an environment through the Neo4j graph database, and then finally draws a knowledge graph of adverse drug reactions through Py2Neo; The prediction module is specifically based on the Attention mechanism of deep learning, and according to the Encoder-decoder framework, combined with the LSTM model to learn the relationship between adverse drug reactions.
2. A drug adverse reaction prediction system based on knowledge graph according to claim 1, characterized in that: The database module includes a data input unit and a data cleaning unit which are connected in sequence, wherein the data input unit is used to receive a drug adverse reaction data set, and the data cleaning unit is used to clean and deduplicate the drug adverse reaction data set to construct a database.
3. A drug adverse reaction prediction system based on knowledge graph according to claim 2, characterized in that: The adverse drug reaction data set includes multiple drug names and adverse drug reaction data corresponding to the drugs.
4. A drug adverse reaction prediction system based on knowledge graph according to claim 1, characterized in that: The knowledge graph module is also provided with a visualization unit, and the visualization unit is used to display the adverse reaction graph to the user.
5. A method for predicting adverse drug reactions based on knowledge graph, characterized in that: The following steps are involved: S1. Inputting the drug adverse reaction data set into the database module to construct a database containing multiple drug names and corresponding adverse reaction data; S2. The knowledge graph module receives a single name of a drug to be tested, and then executes step S3; When the knowledge graph module receives multiple names of drugs to be tested, step S4 is executed; S3. According to the name of the drug to be tested, the knowledge graph module queries the adverse reaction data of the drug to be tested from the database and draws it into an adverse reaction graph; The prediction module obtains data from the database through the knowledge graph module, pre-processes the obtained data, and then uses machine learning to obtain the relationship between adverse drug reactions; The prediction module combines the adverse reaction map of the drug to be tested and the adverse reaction relationship of the drug to predict the potential adverse reaction results of the drug to be tested; S4. According to the names of multiple drugs to be tested, the knowledge graph module respectively queries the adverse reaction data of multiple drugs to be tested from the database, and determines whether there is an adverse reaction conflict between the multiple drugs to be tested. If it is determined to be yes, a conflict adverse reaction graph between the multiple drugs to be tested is drawn; otherwise, adverse reaction graphs of the multiple drugs to be tested are drawn; The prediction module obtains data from the database through the knowledge graph module, pre-processes the obtained data, and then uses machine learning to obtain the relationship between adverse drug reactions; The prediction module combines multiple adverse reaction maps of the tested drugs and the adverse reaction relationships of the drugs to predict the potential adverse reaction results of the tested drugs respectively; The knowledge graph module specifically creates an environment through the Neo4j graph database, and then finally draws a knowledge graph of adverse drug reactions through Py2Neo; The prediction module is specifically based on the Attention mechanism of deep learning, and according to the Encoder-decoder framework, combined with the LSTM model to learn the relationship between adverse drug reactions.
