Method and device for recommending traditional Chinese medicine based on graph algorithm
Through the traditional Chinese medicine recommendation method based on graph algorithm, the traditional Chinese medicine drug map is constructed and the node similarity is calculated, and the problem of inability to effectively provide prescriptions in the existing technology is solved, and accurate and personalized traditional Chinese medicine prescription recommendations are achieved.
Patent Information
- Application Number
- CN202411268420.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-09-11
AI Technical Summary
The existing technology cannot effectively combine the characteristics of traditional Chinese medicine and obtain actual Chinese medicine prescriptions for patients' symptoms. The traditional methods are easily affected by subjective factors, and there is a conflict between the relationship model of confusion in parameter settings and redundancy.
Using the traditional Chinese medicine recommendation method based on graph algorithm, a traditional Chinese medicine drug map is constructed by extracting the feature of traditional Chinese medicine prescription data and traditional Chinese medicine data, including traditional Chinese medicine nodes, disease nodes, medicinal nodes, medicinal nodes, efficacy nodes and symptom nodes, and the nodes are calculated. Similarity is used to determine the weight coefficient of the edges of the map and recommend prescriptions in response to the target patient's symptom information.
The data-based recommendation of traditional Chinese medicine drugs is realized, which reduces the influence of subjective factors, improves the accuracy and consistency of prescriptions, and can provide personalized prescriptions in combination with the characteristics of traditional Chinese medicine, solving the problems of redundancy and confusion in parameter settings in traditional methods.
Smart Images

Figure CN118800408B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of knowledge graph reasoning technology, and in particular to a method for recommending Chinese medicine based on graph algorithms. The present application also relates to a device for recommending Chinese medicine based on graph algorithms, a computing device, and a computer-readable storage medium. Background Art
[0002] Traditional Chinese medicine prescription recommendation methods are usually based on the doctor's experience and knowledge, which are easily affected by subjective factors and have certain limitations. Graph matching algorithm is an effective pattern matching method that can find similarities and associations in large-scale data sets.
[0003] However, in traditional Chinese medicine, there is usually a complex relationship between symptoms and diagnosis and treatment methods. The existing relationship models or relationship maps have inconsistent evaluation criteria, and there are redundant conclusions or conclusions that conflict with traditional compatibility theories. In addition, due to the confusion in parameter settings of the maps, it is impossible to combine the characteristics of traditional Chinese medicine itself and obtain actual traditional Chinese medicine prescriptions based on the patient's symptoms. Summary of the invention
[0004] In view of this, the present application provides a method for recommending TCM medication based on a graph algorithm to solve the technical defect in the prior art that it is not possible to combine the characteristics of TCM itself and obtain an actual TCM prescription for the patient's symptoms. The present application also provides a TCM medication recommendation device based on a graph algorithm, a computing device, and a computer-readable storage medium.
[0005] According to the first aspect of the present application, a method for recommending Chinese medicine based on a graph algorithm is provided, comprising:
[0006] S1, extracting features from the collected TCM prescription data and TCM data to obtain a first feature set corresponding to the TCM prescription data and a second feature set corresponding to the TCM data;
[0007] S2, based on the patient samples associated with the TCM prescription data, determining the dialectical result information of the patient samples, and performing feature extraction on the dialectical result information to obtain a third feature set;
[0008] S3, constructing a TCM medication graph according to the first feature set, the second feature set and the third feature set through preset graph nodes and graph edges, wherein the preset graph nodes include TCM nodes, disease nodes, medicinal property nodes, meridian nodes, efficacy nodes and symptom nodes, and the preset graph edges include treatment relationships, medicinal property associations, medicinal property associations, efficacy associations and symptom associations;
[0009] S4, calculating node similarity according to the first feature set, the second feature set and the third feature set, and determining a weight coefficient of the graph edge according to the node similarity;
[0010] S5, in response to the received symptom information of the target patient, obtaining a target prescription through the weight coefficient and the TCM medication map.
[0011] Optionally, before S1, the step further includes:
[0012] The TCM prescription data and the TCM data are deduplicated, and entity names are standardized.
[0013] Optionally, the S2 includes:
[0014] S21, determining the dialectical result information according to the condition description data and medical examination results contained in the patient sample;
[0015] S22, performing feature extraction on the dialectical result information by using a TextCNN algorithm to obtain the third feature set.
[0016] Optionally, the S3 includes:
[0017] S31, setting the graph edge between the traditional Chinese medicine node and the disease node as a treatment relationship;
[0018] S32, setting the graph edge between the traditional Chinese medicine node and the medicinal property node as a medicinal property association;
[0019] S33, setting the graph edge between the traditional Chinese medicine node and the meridian node as the meridian theory;
[0020] S34, setting the graph edge between the traditional Chinese medicine node and the efficacy node as efficacy association;
[0021] S35, setting the graph edge between the disease node and the symptom node as a symptom association;
[0022] S36, importing the features included in the first feature set, the second feature set and the third feature set into the corresponding graph nodes to obtain the TCM medication graph.
[0023] Optionally, step S4 includes:
[0024] By means of LINE network embedding learning, the similarity between the features corresponding to each graph node in the first feature set, the second feature set and the third feature set is calculated to obtain the node similarity;
[0025] According to the node similarity, the weight coefficient of the graph edge between the graph nodes is determined.
[0026] Optionally, step S5 includes:
[0027] receiving symptom information of the target patient;
[0028] Extracting features from the symptom information to obtain symptom features;
[0029] The target prescription corresponding to the symptom feature is queried through the weight coefficient and the TCM medication map.
[0030] Optionally, the querying the target prescription corresponding to the symptom feature by using the weight coefficient and the TCM medication atlas includes:
[0031] Query the symptom node corresponding to the symptom feature, record it as the target symptom node, query the disease node associated with the target symptom node, record it as the target disease node, query the traditional Chinese medicine node associated with the target disease node, record it as the target traditional Chinese medicine node;
[0032] Constructing a bipartite graph according to the target symptom node and the target traditional Chinese medicine node;
[0033] Determine the medicinal property association associated with the target Chinese medicine node, the meridian theory and the efficacy association, which are respectively recorded as target medicinal property association, target meridian theory and target efficacy association, and determine the symptom association associated with the target symptom node, which is recorded as target symptom association;
[0034] The target prescription is determined in the bipartite graph by the Hungarian algorithm according to the target medicinal property association, the target meridian theory, the weight coefficients of the target efficacy association and the target symptom association.
[0035] According to a second aspect of the present application, a device for recommending Chinese medicine based on a graph algorithm is provided, comprising:
[0036] A first feature extraction module is configured to perform feature extraction on the collected TCM prescription data and TCM data to obtain a first feature set corresponding to the TCM prescription data and a second feature set corresponding to the TCM data;
[0037] A second feature extraction module is configured to determine the dialectical result information of the patient sample based on the patient sample associated with the TCM prescription data, and perform feature extraction on the dialectical result information to obtain a third feature set;
[0038] A construction module is configured to construct a TCM medication map according to the first feature set, the second feature set and the third feature set through preset map nodes and map edges, wherein the preset map nodes include TCM nodes, disease nodes, medicinal property nodes, meridian nodes, efficacy nodes and symptom nodes, and the preset map edges include treatment relationships, medicinal property associations, medicinal property associations, efficacy associations and symptom associations;
[0039] A calculation module, configured to calculate node similarity according to the first feature set, the second feature set and the third feature set, and determine a weight coefficient of the graph edge according to the node similarity;
[0040] The recommendation module is configured to obtain a target prescription in response to the received symptom information of the target patient through the weight coefficient and the TCM medication map.
[0041] According to a third aspect of the present application, there is provided a computing device, including:
[0042] Memory and processor;
[0043] The memory is used to store computer-executable instructions, and the processor implements the steps of the method for recommending traditional Chinese medicine based on graph algorithm when executing the computer-executable instructions.
[0044] According to a fourth aspect of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the method for recommending traditional Chinese medicine based on a graph algorithm are implemented.
[0045] According to a fifth aspect of the present application, a chip is provided, which stores a computer program, and when the computer program is executed by the chip, the steps of the method for recommending traditional Chinese medicine based on a graph algorithm are implemented.
[0046] The TCM medication recommendation method based on graph algorithm provided in the present application comprises the following steps: S1, extracting features from the collected TCM prescription data and TCM data to obtain a first feature set corresponding to the TCM prescription data and a second feature set corresponding to the TCM data; S2, determining the dialectical result information of the patient samples associated with the TCM prescription data, and extracting features from the dialectical result information to obtain a third feature set; S3, constructing a TCM medication map according to the first feature set, the second feature set and the third feature set through preset graph nodes and graph edges, wherein the preset graph nodes include TCM nodes, disease nodes, medicinal property nodes, meridian nodes, efficacy nodes and symptom nodes, and the preset graph edges include treatment relationships, medicinal property associations, medicinal property associations, efficacy associations and symptom associations; S4, calculating node similarity according to the first feature set, the second feature set and the third feature set, and determining the weight coefficient of the graph edge according to the node similarity; S5, obtaining a target prescription in response to the received symptom information of the target patient through the weight coefficient and the TCM medication map. It realizes the establishment of graph association between syndrome types and symptoms of TCM dialectics and the therapeutic properties of traditional Chinese medicine, completes TCM prescription recommendations through graph matching algorithms, and assists doctors in prescribing medicines for patients. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 It is a flow chart of a method for recommending Chinese medicine based on a graph algorithm provided in one embodiment of the present application;
[0049] Figure 2 It is a schematic diagram of disease nodes and Chinese medicine nodes of a Chinese medicine recommendation method based on a graph algorithm provided in one embodiment of the present application;
[0050] Figure 3 It is a structural schematic diagram of a TCM medication recommendation device based on a graph algorithm provided in one embodiment of the present application;
[0051] Figure 4 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0052] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0053] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0054] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0055] First, the terms involved in one or more embodiments of the present invention are explained.
[0056] TextCNN: It is a text classification model based on convolutional neural network (CNN). It extracts features and classifies texts. It is widely used in tasks such as text classification, sentiment analysis, and spam filtering.
[0057] In the present application, a method for recommending TCM drugs based on graph algorithm is provided. The present application also relates to a TCM drug recommendation device based on graph algorithm, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0058] Figure 1 A flowchart of a method for recommending TCM medication based on a graph algorithm according to an embodiment of the present application is shown, which specifically includes the following steps:
[0059] S1, extracting features from the collected TCM prescription data and TCM data to obtain a first feature set corresponding to the TCM prescription data and a second feature set corresponding to the TCM data;
[0060] S2, based on the patient samples associated with the TCM prescription data, determining the dialectical result information of the patient samples, and performing feature extraction on the dialectical result information to obtain a third feature set;
[0061] S3, constructing a TCM medication graph according to the first feature set, the second feature set and the third feature set through preset graph nodes and graph edges, wherein the preset graph nodes include TCM nodes, disease nodes, medicinal property nodes, meridian nodes, efficacy nodes and symptom nodes, and the preset graph edges include treatment relationships, medicinal property associations, medicinal property associations, efficacy associations and symptom associations;
[0062] S4, calculating node similarity according to the first feature set, the second feature set and the third feature set, and determining a weight coefficient of the graph edge according to the node similarity;
[0063] S5, in response to the received symptom information of the target patient, obtaining a target prescription through the weight coefficient and the TCM medication map.
[0064] Among them, both TCM prescription data and TCM data can be understood as sample data, which are used to construct a TCM medication map, and can be obtained from historical databases. Patient samples are associated with TCM prescription data and can be understood as the patient's condition description or the patient's medical examination results. The TCM medication map contains graph vertices and graph edges connecting each graph vertex. The target patient can be understood as a patient who is currently receiving medical treatment and needs to receive a corresponding prescription based on his or her specific symptoms. The target prescription can be understood as a TCM prescription obtained based on the symptoms of the target patient.
[0065] In addition, syndrome can be understood as a summary of the patient's body's reaction to a certain stage of the disease development process, including the location, cause, nature and relationship between the lesion, reflecting the essence of the pathological changes at this stage, and the syndrome differentiation result can be understood as the data collected by the four examinations, through analysis and synthesis, to clarify the cause, nature, location of the disease, and the relationship between the evil and the righteous, and summarize and judge it as a syndrome of a certain nature. The symptom information of the target patient can be understood as data containing the current symptoms of the target patient, such as "headache", "sore neck", "nasal congestion", etc. The specific symptom information is determined by the actual usage scenario, and this embodiment does not limit it.
[0066] Based on this, by extracting features from the TCM prescription data, TCM data, and patient samples corresponding to the TCM prescription data in the historical data, we obtain the first feature set, the second feature set, and the third feature set. Through the features in the above feature sets, we construct a TCM medication map. The map node type definition in the TCM medication map can be understood as follows: the TCM node represents each type of TCM, which can include herbs, minerals, animal products, etc.; the disease node covers various diseases diagnosed by TCM, such as colds and excessive liver fire; the medicinal property node describes the four properties and five flavors of TCM (cold, hot, warm, cool; sour, bitter, sweet, pungent, and salty), connects the TCM nodes, and indicates the properties of TCM; the meridian node indicates that TCM acts on the meridian system of the human body, such as the heart meridian and the lung meridian, and the TCM nodes are connected to them; the efficacy node summarizes the main effects of TCM or treatment methods, such as clearing away heat and detoxifying, replenishing qi and nourishing blood, and connects the corresponding TCM nodes; the symptom node describes the disease manifestations in detail, such as cough and fever, which can be used as a basis for the refinement of the symptoms or auxiliary judgment, and is closely related to the symptom node.
[0067] According to the above feature set, the weight coefficients corresponding to each graph edge in the TCM medication graph are determined. When a new patient comes to see a doctor, the corresponding nodes in the TCM medication graph corresponding to the patient's symptoms are queried, and the TCM medication corresponding to the patient's symptoms is queried based on the weight coefficients of each graph edge to obtain the target prescription.
[0068] Furthermore, for the TCM prescription data and TCM data contained in the historical data, since these data have a large number of repetitions and the naming standard is not unique, they cannot be directly applied to feature extraction and the construction of TCM drug maps. Therefore, preprocessing is required before step S1. In this embodiment, the specific implementation method is as follows:
[0069] The TCM prescription data and the TCM data are deduplicated, and entity names are standardized.
[0070] Among them, the traditional Chinese medicine prescription data contains the results of the doctor's prescription during the patient's specific medical treatment process; the traditional Chinese medicine data contains information such as the medicinal properties, meridians, and efficacy of the traditional Chinese medicine.
[0071] Based on this, by deduplicating TCM prescription data and TCM data, the amount of data processing can be reduced and the data processing efficiency of related hardware equipment can be improved. For the deduplicated TCM prescription data and TCM data, the names of the entities in them also need to be standardized to ensure the consistency of the entity names. Unified entity names are conducive to data processing accuracy.
[0072] Furthermore, in step S2, based on the patient samples associated with the TCM prescription data, the dialectical result information of the patient samples is determined, and feature extraction is performed on the dialectical result information to obtain the third feature set. In this embodiment, the specific implementation method is as follows:
[0073] S21, determining the dialectical result information according to the condition description data and medical examination results contained in the patient sample;
[0074] S22, performing feature extraction on the dialectical result information by using a TextCNN algorithm to obtain the third feature set.
[0075] Among them, after determining the patient corresponding to the traditional Chinese medicine prescription data and the patient sample containing the patient's condition description data and medical examination results, the patient's condition is analyzed based on the condition description data and medical examination results to determine the dialectical result information corresponding to the patient.
[0076] Based on this, the TextCNN algorithm is used to extract features of the dialectical result information to obtain the third feature set. It should be noted that for the feature extraction process of TCM prescription data and Chinese medicine data, the prescription medication characteristics can be analyzed by embedding the drug-prescription-target network to obtain the first feature set and the second feature set.
[0077] Furthermore, in step S3, the process of constructing a TCM medication map according to the first feature set, the second feature set and the third feature set through the preset map nodes and map edges is specifically implemented as follows in this embodiment:
[0078] S31, setting the graph edge between the Chinese medicine node and the disease node as a treatment relationship; S32, setting the graph edge between the Chinese medicine node and the medicinal property node as a medicinal property association; S33, setting the graph edge between the Chinese medicine node and the meridian node as the meridian theory; S34, setting the graph edge between the Chinese medicine node and the efficacy node as an efficacy association; S35, setting the graph edge between the disease node and the symptom node as a symptom association; S36, importing the features contained in the first feature set, the second feature set and the third feature set into the corresponding graph nodes to obtain the TCM medication map.
[0079] Among them, after defining the TCM drug map, the map edges between nodes are defined. Specifically, the map edge of the treatment relationship points from the TCM node to the disease node, indicating that the TCM can treat the corresponding disease; the map edge of the medicinal property association connects the TCM node and the medicinal property node, reflecting the nature of the TCM; the map edge of the meridian theory is the edge from the TCM node to the meridian node, showing which meridians the TCM acts on; the map edge of the efficacy association is from the TCM node to the efficacy node, reflecting the specific therapeutic effect of the TCM; the map edge of the symptom association is from the disease node to the symptom node, expressing the relationship between the disease and the specific symptoms. After defining the map nodes and the map edges, the features contained in the first feature set, the second feature set and the third feature set are set according to the definition of the map nodes to obtain the TCM drug map.
[0080] Furthermore, in step S4, the node similarity is calculated according to the first feature set, the second feature set and the third feature set, and the weight coefficient of the graph edge is determined according to the node similarity. In this embodiment, the specific implementation method is as follows:
[0081] By means of LINE network embedding learning, the similarity between the features corresponding to each graph node in the first feature set, the second feature set and the third feature set is calculated to obtain the node similarity; and the weight coefficient of the graph edge between the graph nodes is determined according to the node similarity.
[0082] Among them, the process of calculating node similarity through LINE network embedding learning can use first-order LINE or second-order LINE. Taking second-order LINE as an example, the calculation formula of node similarity is as follows:
[0083] ,
[0084] in, and is the vertex of the graph, , is the subscript, Represents graph vertices The vertex of the graph When the context of Generate context The probability of the graph vertex With graph vertices The node similarity between To calculate the graph vertices Generate context hour, The expression, To calculate the graph vertices Generate context hour, The expression, For context The number of graph vertices represented, 1 to A positive integer between To calculate the graph vertices Generate context hour, The statement is that at this time = , for The function representation is: for According to the node similarity calculated in the above way, the weight coefficient of each graph edge is defined.
[0085] Furthermore, in step S5, in response to the received symptom information of the target patient, the target prescription is obtained through the weight coefficient and the TCM medication map. In this embodiment, the specific implementation method is as follows:
[0086] Receive the symptom information of the target patient; extract the features of the symptom information to obtain symptom features; and query the target prescription corresponding to the symptom features through the weight coefficient and the TCM medication atlas.
[0087] Among them, the process of feature extraction of the symptom information of the target patient is similar to the feature extraction method introduced above, and will not be repeated in this embodiment. After obtaining the corresponding symptom characteristics, the corresponding symptom nodes are queried in the traditional Chinese medicine map according to the symptom characteristics, and the corresponding traditional Chinese medicine nodes are queried according to the weight coefficients of each map edge. After all the traditional Chinese medicine nodes are obtained, the target prescription is determined.
[0088] Furthermore, the process of searching the target prescription corresponding to the symptom characteristics by using the weight coefficient and the TCM medication map is specifically implemented as follows in this embodiment:
[0089] Query the symptom node corresponding to the symptom feature, record it as the target symptom node, query the disease node associated with the target symptom node, record it as the target disease node, query the traditional Chinese medicine node associated with the target disease node, record it as the target traditional Chinese medicine node; construct a bipartite graph based on the target symptom node and the target traditional Chinese medicine node; determine the medicinal property association, the meridian theory and the efficacy association associated with the target traditional Chinese medicine node, record them as the target medicinal property association, the target meridian theory and the target efficacy association, respectively, and determine the symptom association associated with the target symptom node, record it as the target symptom association; determine the target prescription in the bipartite graph through the Hungarian algorithm based on the weight coefficients of the target medicinal property association, the target meridian theory, the target efficacy association and the target symptom association.
[0090] Among them, the corresponding symptom nodes are queried through symptom characteristics, and the corresponding disease nodes are determined based on the queried symptom nodes. Finally, the traditional Chinese medicine nodes are determined based on the queried disease nodes. However, not all of the queried traditional Chinese medicine nodes are included in the target prescription, and they need to be screened according to the corresponding weight coefficients.
[0091] Based on this, a bipartite graph is constructed for the target Chinese medicine nodes and target symptom nodes obtained by the query. In actual application scenarios, the target Chinese medicine nodes can be arranged in the left node set, and the target symptom nodes can be arranged in the right node set. It should be noted that the position distribution of the target Chinese medicine nodes and the target symptom nodes can be interchanged, that is, the target Chinese medicine nodes are arranged in the right node set, and the target symptom nodes are arranged in the left node set.
[0092] Afterwards, for each pair of connections between the target TCM node and the target symptom node, the weight of the graph edge can be defined according to the weight coefficients of the target medicinal property association, target efficacy association, target symptom association, and target meridian theory. The higher the weight, the more accurate the TCM is for the symptom and the better the effect. Specifically, the Hungarian algorithm is used to find the maximum match in the bipartite graph, that is, the best TCM recommendation plan.
[0093] For example, suppose there are the following Chinese medicine nodes and symptom nodes:
[0094] Chinese medicine nodes: Scutellaria baicalensis, cinnamon twig, and Chinese angelica;
[0095] Symptom nodes: headache, fever, cough.
[0096] If there are also the following connections and their corresponding weights:
[0097] Headache - Scutellaria baicalensis: weight is 8;
[0098] Headache-Cassia twig: weight is 6;
[0099] Headache-Danggui: weight is 5;
[0100] Fever-Scutellaria baicalensis: weight is 7;
[0101] Fever-Cinnamon twig: weight is 9;
[0102] Fever-Danggui: weight is 6;
[0103] Cough-Scutellaria baicalensis: weight is 5;
[0104] Cough-Guizhi: weight is 7;
[0105] Cough - Angelica: Weight is 8.
[0106] According to the above weights, the Hungarian algorithm is used to recommend the best Chinese medicine recommendation plan. Specifically, it is necessary to initialize first, that is, initialize the matching values of all edges to 0, and then find the augmenting path. Taking the target Chinese medicine node in the left node set of the bipartite graph as an example, starting from each unmatched left node, use DFS (depth-first search) or BFS (breadth-first search) to find the augmenting path until it cannot be found. Finally, according to the augmenting path found, update the match and get the target drug prescription.
[0107] It should be noted that if Figure 2 A schematic diagram of disease nodes and Chinese medicine nodes of a TCM medication recommendation method based on a graph algorithm is provided. In actual application scenarios, for a target patient, after consultation and medical examination, the doctor can determine the target patient's disease type based on the target patient's symptom information, that is, determine the target patient's disease information, and then extract features from the disease information to obtain the disease features, query the corresponding disease nodes, and then query the Chinese medicine nodes corresponding to the disease nodes through the TCM medication map and the weight coefficients of the map edges to obtain the target prescription.
[0108] Corresponding to the above method embodiment, the present application also provides an embodiment of a TCM medication recommendation device based on a graph algorithm. Figure 3 FIG. 1 shows a schematic diagram of a structure of a TCM medication recommendation device based on a graph algorithm provided by an embodiment of the present application. Figure 3 As shown, the device comprises:
[0109] The first feature extraction module 302 is configured to perform feature extraction on the collected TCM prescription data and TCM data to obtain a first feature set corresponding to the TCM prescription data and a second feature set corresponding to the TCM data;
[0110] The second feature extraction module 304 is configured to determine the dialectical result information of the patient sample based on the patient sample associated with the TCM prescription data, and perform feature extraction on the dialectical result information to obtain a third feature set;
[0111] The construction module 306 is configured to construct a TCM medication map according to the first feature set, the second feature set and the third feature set through preset map nodes and map edges, wherein the preset map nodes include TCM nodes, disease nodes, medicinal property nodes, meridian nodes, efficacy nodes and symptom nodes, and the preset map edges include treatment relationships, medicinal property associations, medicinal property associations, efficacy associations and symptom associations;
[0112] A calculation module 308 is configured to calculate node similarity according to the first feature set, the second feature set and the third feature set, and determine a weight coefficient of the graph edge according to the node similarity;
[0113] The recommendation module 310 is configured to obtain a target prescription in response to the received symptom information of the target patient through the weight coefficient and the TCM medication map.
[0114] In an optional embodiment, the TCM medication recommendation device based on graph algorithm further includes:
[0115] The preprocessing module is configured to deduplicate the TCM prescription data and the TCM data and standardize entity names.
[0116] In an optional embodiment, the second feature extraction module 304 is further configured to:
[0117] The dialectical result information is determined according to the condition description data and the medical examination results contained in the patient sample; and the features of the dialectical result information are extracted by using the TextCNN algorithm to obtain the third feature set.
[0118] In an optional embodiment, the construction module 306 is further configured to:
[0119] The graph edge between the Chinese medicine node and the disease node is set as a treatment relationship; the graph edge between the Chinese medicine node and the medicinal property node is set as a medicinal property association; the graph edge between the Chinese medicine node and the meridian node is set as the meridian theory; the graph edge between the Chinese medicine node and the efficacy node is set as the efficacy association; the graph edge between the disease node and the symptom node is set as the symptom association; the features contained in the first feature set, the second feature set and the third feature set are imported into the corresponding graph nodes to obtain the TCM medication map.
[0120] In an optional embodiment, the calculation module 308 is further configured to:
[0121] By means of LINE network embedding learning, the similarity between the features corresponding to each graph node in the first feature set, the second feature set and the third feature set is calculated to obtain the node similarity; and the weight coefficient of the graph edge between the graph nodes is determined according to the node similarity.
[0122] In an optional embodiment, the recommendation module 310 is further configured to:
[0123] Receive the symptom information of the target patient; extract the features of the symptom information to obtain symptom features; and query the target prescription corresponding to the symptom features through the weight coefficient and the TCM medication atlas.
[0124] In an optional embodiment, the recommendation module 310 is further configured to:
[0125] Query the symptom node corresponding to the symptom feature, record it as the target symptom node, query the disease node associated with the target symptom node, record it as the target disease node, query the traditional Chinese medicine node associated with the target disease node, record it as the target traditional Chinese medicine node; construct a bipartite graph based on the target symptom node and the target traditional Chinese medicine node; determine the medicinal property association, the meridian theory and the efficacy association associated with the target traditional Chinese medicine node, record them as the target medicinal property association, the target meridian theory and the target efficacy association, respectively, and determine the symptom association associated with the target symptom node, record it as the target symptom association; determine the target prescription in the bipartite graph through the Hungarian algorithm based on the weight coefficients of the target medicinal property association, the target meridian theory, the target efficacy association and the target symptom association.
[0126] The TCM medication recommendation device based on graph algorithm provided by the present application performs feature extraction on the collected TCM prescription data and TCM data to obtain a first feature set corresponding to the TCM prescription data and a second feature set corresponding to the TCM data; determines the dialectical result information of the patient sample based on the TCM prescription data, and performs feature extraction on the dialectical result information to obtain a third feature set: constructs a TCM medication map according to the first feature set, the second feature set and the third feature set through preset graph nodes and graph edges, wherein the preset graph nodes include TCM nodes, disease nodes, medicinal property nodes, meridian nodes, efficacy nodes and symptom nodes, and the preset graph edges include treatment relationships, medicinal property associations, medicinal property associations, efficacy associations and symptom associations; calculates node similarity according to the first feature set, the second feature set and the third feature set, and determines the weight coefficient of the graph edge according to the node similarity; obtains the target prescription in response to the received symptom information of the target patient through the weight coefficient and the TCM medication map. It realizes the establishment of graph association between syndrome types and symptoms of TCM dialectics and the therapeutic properties of traditional Chinese medicine, completes TCM prescription recommendations through graph matching algorithms, provides accurate TCM treatment suggestions, and assists doctors in prescribing medicines for patients.
[0127] The above is a schematic scheme of a TCM medication recommendation device based on a graph algorithm of this embodiment. It should be noted that the technical scheme of the TCM medication recommendation device based on a graph algorithm and the technical scheme of the TCM medication recommendation method based on a graph algorithm belong to the same concept. The details of the technical scheme of the TCM medication recommendation device based on a graph algorithm that are not described in detail can be found in the description of the technical scheme of the TCM medication recommendation method based on a graph algorithm. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through a computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0128] Figure 4 The block diagram of a computing device 400 according to an embodiment of the present application is shown. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.
[0129] The computing device 400 also includes an access device 440 that enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0130] In one embodiment of the present application, the above components of the computing device 400 and Figure 4 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 4 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0131] Computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 400 may also be a mobile or stationary server.
[0132] The processor 420 is used to execute computer executable instructions for each step of the method for recommending traditional Chinese medicine based on graph algorithm.
[0133] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned TCM drug recommendation method based on graph algorithm are of the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the above-mentioned TCM drug recommendation method based on graph algorithm.
[0134] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to execute each step of the graph algorithm-based TCM medication recommendation method.
[0135] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned TCM drug recommendation method based on graph algorithm belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned TCM drug recommendation method based on graph algorithm.
[0136] An embodiment of the present application further provides a chip storing a computer program, which, when executed by the chip, implements the steps of the method for recommending traditional Chinese medicine based on graph algorithm.
[0137] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0138] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0139] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0140] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0141] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A method for recommending traditional Chinese medicine based on graph algorithm, characterized in that: include: S1, extracting features from the collected TCM prescription data and TCM data to obtain a first feature set corresponding to the TCM prescription data and a second feature set corresponding to the TCM data; S2, based on the patient samples associated with the TCM prescription data, determining the dialectical result information of the patient samples, and performing feature extraction on the dialectical result information to obtain a third feature set; S3, constructing a TCM drug map according to the first feature set, the second feature set and the third feature set through preset map nodes and map edges, wherein the preset map nodes include TCM nodes, disease nodes, medicinal properties nodes, meridian nodes, efficacy nodes and symptom nodes, and the preset map edges include therapeutic relationships, medicinal property associations, meridian theories, efficacy associations and symptom associations. Specifically, S31, setting the map edge between the TCM node and the disease node as a therapeutic relationship; S32, setting the map edge between the TCM node and the medicinal property node as a medicinal property association; S33, setting the map edge between the TCM node and the meridian node as a meridian theory; S34, setting the map edge between the TCM node and the efficacy node as an efficacy association; S35, setting the map edge between the disease node and the symptom node as a symptom association; S36, importing the features included in the first feature set, the second feature set and the third feature set into the corresponding map nodes to obtain the TCM drug map; S4, calculating node similarity according to the first feature set, the second feature set and the third feature set, and determining a weight coefficient of the graph edge according to the node similarity; S5, in response to the received symptom information of the target patient, obtaining a target prescription through the weight coefficient and the TCM medication map.
2. The method according to claim 1, characterized in that: Before S1, it also includes: The TCM prescription data and the TCM data are deduplicated, and entity names are standardized.
3. The method according to claim 1, characterized in that The S2 includes: S21, determining the dialectical result information according to the condition description data and medical examination results contained in the patient sample; S22, performing feature extraction on the dialectical result information by using a TextCNN algorithm to obtain the third feature set.
4. The method according to claim 1, characterized in that: The S4 includes: By means of LINE network embedding learning, the similarity between the features corresponding to each graph node in the first feature set, the second feature set and the third feature set is calculated to obtain the node similarity; According to the node similarity, the weight coefficient of the graph edge between the graph nodes is determined.
5. The method according to claim 1, characterized in that The S5 includes: receiving symptom information of the target patient; Extracting features from the symptom information to obtain symptom features; The target prescription corresponding to the symptom feature is queried through the weight coefficient and the TCM medication map.
6. The method according to claim 5, characterized in that The querying the target prescription corresponding to the symptom feature by using the weight coefficient and the TCM medication map includes: Query the symptom node corresponding to the symptom feature, record it as the target symptom node, query the disease node associated with the target symptom node, record it as the target disease node, query the traditional Chinese medicine node associated with the target disease node, record it as the target traditional Chinese medicine node; Constructing a bipartite graph according to the target symptom node and the target traditional Chinese medicine node; Determine the medicinal property association associated with the target Chinese medicine node, the meridian theory and the efficacy association, which are respectively recorded as target medicinal property association, target meridian theory and target efficacy association, and determine the symptom association associated with the target symptom node, which is recorded as target symptom association; The target prescription is determined in the bipartite graph by the Hungarian algorithm according to the target medicinal property association, the target meridian theory, the weight coefficients of the target efficacy association and the target symptom association.
7. A device for recommending Chinese medicine based on graph algorithm, characterized in that: include: A first feature extraction module is configured to perform feature extraction on the collected TCM prescription data and TCM data to obtain a first feature set corresponding to the TCM prescription data and a second feature set corresponding to the TCM data; A second feature extraction module is configured to determine the dialectical result information of the patient sample based on the patient sample associated with the TCM prescription data, and perform feature extraction on the dialectical result information to obtain a third feature set; A construction module is configured to construct a TCM drug map according to the first feature set, the second feature set and the third feature set through preset map nodes and map edges, wherein the preset map nodes include TCM nodes, disease nodes, medicinal properties nodes, meridian nodes, efficacy nodes and symptom nodes, and the preset map edges include therapeutic relationships, medicinal property associations, meridian theories, efficacy associations and symptom associations. Specifically, the map edge between the TCM node and the disease node is set as a therapeutic relationship, the map edge between the TCM node and the medicinal property node is set as a medicinal property association, the map edge between the TCM node and the meridian node is set as a meridian theory, the map edge between the TCM node and the efficacy node is set as an efficacy association, and the map edge between the disease node and the symptom node is set as a symptom association. The features included in the first feature set, the second feature set and the third feature set are imported into the corresponding map nodes to obtain the TCM drug map; A calculation module, configured to calculate node similarity according to the first feature set, the second feature set and the third feature set, and determine a weight coefficient of the graph edge according to the node similarity; The recommendation module is configured to obtain a target prescription in response to the received symptom information of the target patient through the weight coefficient and the TCM medication map.
8. A computing device, characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the method for recommending traditional Chinese medicine based on graph algorithm as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by the processor, the steps of the method for recommending traditional Chinese medicine based on graph algorithm as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Prescription recommendation method and system based on machine learning and knowledge graph
CN111191020A
Traditional Chinese medicine dialectical treatment recommendation system and method based on graph neural network, and electronic equipment
CN113628726A
Traditional Chinese medicine individualized intelligent prescription recommendation system based on similar patient matching
CN117690549A
System and method for prescription monitoring and drug dispensation utilizing a distributed ledger
US20190206536A1
Data processing method and data processing apparatus
WO2023098291A1
Cited By
A traditional Chinese medicine prescription intelligent recommendation method for alleviating data sparsity and enhancing interpretability
CN122677197A
