Traditional Chinese medicine recommendation method based on knowledge-driven and residual attention network
Through the method based on knowledge-driven and residual attention network, the problem of difficult matching of young Chinese medicine practitioners in formulating prescriptions is solved, more accurate and efficient Chinese medicine recommendations are achieved, and clinical formulas are assisted, and the learning ability of the model is improved.
Patent Information
- Application Number
- CN202411775987.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-12-05
AI Technical Summary
Due to lack of experience, it is difficult for young Chinese medicine practitioners to accurately and efficiently form prescriptions, especially when facing complex cases.
Using the traditional Chinese medicine recommendation method based on knowledge-driven and residual attention network, we focus on the different effects of traditional Chinese medicine on symptoms through the graph attention neural network, use the residual network structure to enhance the entity characteristics, integrate the semantic information of symptom and external knowledge of traditional Chinese medicine, build a multi-dimensional traditional Chinese medicine attribute evaluation model and symptom feature extraction model, and recommend appropriate traditional Chinese medicine.
It has achieved more accurate and efficient Chinese medicine recommendations, assisted doctors in clinical formulations, alleviated the problem of data sparseness in Chinese medicine recommendations, and improved the model's learning ability to treat the differences in efficacy.
Smart Images

Figure CN119517319A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of recommendation algorithms based on graph representation, and in particular to a method for recommending traditional Chinese medicine based on knowledge-driven and residual attention network. Background Art
[0002] Traditional Chinese medicine provides a unique medical theory system. It has long played an important role in China's medical care and has gradually been widely used around the world. Prescriptions are an important means of treatment in traditional Chinese medicine. Traditional Chinese medicine practitioners usually prescribe medicines and formulate prescriptions based on their rich clinical experience and theoretical knowledge. However, this relies on the doctor's accumulated experience and requires traditional Chinese medicine practitioners to have deep professional knowledge and rich clinical practice. However, many newly employed young doctors often find it difficult to formulate prescriptions accurately and efficiently when faced with complex cases due to their lack of experience.
[0003] The vast amount of medical records and prescriptions left by doctors of all dynasties contain medical thoughts and experience in diagnosis and treatment, and there is a lot of knowledge worth learning from and applying. With the development of artificial intelligence, a large number of studies have used it to standardize and mine prescription data. Among them, deep learning is a feature learning technology with superior performance. It maps the original data into a higher-level and more abstract vector representation through a nonlinear model, learns complex relationships through enough mappings to solve practical problems, and has good generalization ability. It can be seen that using deep learning technology to analyze clinical cases and prescription data of traditional Chinese medicine and mine its inherent prescription and compatibility rules is an effective way to inherit and develop traditional Chinese medicine. Graph Attention Network (GAT), as one of the representative methods in deep learning, can effectively capture network structure information. Due to its good performance and interpretability, it has been widely used in many recommendation systems. Therefore, the effectiveness of applying GAT to recommendation systems has been proven in practice, which provides new possibilities for realizing intelligent Chinese medicine recommendations and assisting doctors in prescribing personalized prescriptions.
[0004] The present invention extracts prescription data based on the contents in prescription classics and authoritative websites, constructs a multi-dimensional Chinese medicine attribute evaluation model and a symptom feature extraction model to perform initial feature encoding on prescriptions, Chinese medicines and symptoms respectively, constructs a Chinese medicine prescription entity heterogeneous graph and a symptom-symptom graph and a Chinese medicine-Chinese medicine graph based on the symptoms contained in the prescriptions and the co-occurrence relationship of Chinese medicines, and learns the low-dimensional vector representation of the symptoms, Chinese medicines and prescription nodes in the graph through the GAT network representation learning method. By integrating external knowledge such as Chinese medicine, prescription-symptom relationship, etc., a Chinese medicine recommendation model integrating entity attribute features is constructed, which deeply interprets the ideas of Chinese medicine syndrome differentiation and treatment and prescription compatibility. Summary of the invention
[0005] The technical problem to be solved by the present invention is to propose a novel method for recommending traditional Chinese medicine, which uses a graph attention neural network to focus on the different effects of traditional Chinese medicine on symptoms, uses a residual network structure to enhance entity features, and integrates symptom semantic information and external knowledge of traditional Chinese medicine. It is used to recommend appropriate traditional Chinese medicine according to the patient's symptoms and assist doctors in clinical prescription. In order to solve the above problems, its technical solution is as follows:
[0006] The present invention provides a method for recommending traditional Chinese medicine based on knowledge-driven and residual attention network, the method comprising the following steps:
[0007] S1, data collection and cleaning module: obtain prescription text data, perform standardization process on the symptoms and Chinese medicine terms therein, including unification of synonyms and removal of duplicates, etc., and then divide the processed data set into training set, validation set and test set; "wherein" refers to the prescription text data.
[0008] S2, entity pre-training module: Use the Word2vec training model to extract symptom semantic features, so as to extract the features of symptom entities in prescriptions and obtain the overall contextual semantic representation. In addition, a knowledge graph of Chinese medicine attributes is constructed, and the natural attribute features of Chinese medicine are incorporated into the recommendation model as external knowledge;
[0009] S3, multi-graph construction and entity feature learning module: According to the co-occurrence relationship between symptoms and traditional Chinese medicine, the "symptom-traditional Chinese medicine" heterogeneous graph (SHHG), "symptom-symptom" isomorphic graph (SSIG) and "traditional Chinese medicine-traditional Chinese medicine" isomorphic graph (HHIG) are constructed respectively. The symptom features, traditional Chinese medicine features and their interaction features are extracted from SHHG, SSIG and HHIG respectively using the graph attention neural network, and the entity features are enhanced using the residual structure;
[0010] S4, feature fusion and Chinese medicine recommendation module: The symptom features and Chinese medicine features extracted from the three sub-graphs are fused separately to obtain the final Chinese medicine features and symptom features. MLP is used to express the syndrome features, and finally a suitable Chinese medicine set is recommended based on the given symptom set.
[0011] Furthermore, the prescription text data includes the prescription name, major function category, prescription composition, function and main indications, etc., and the Chinese medicine terminology includes the Chinese medicine name, nature and flavor, meridians and toxicity information. The nature and flavor include cold, hot, warm, good, neutral, sour, bitter, sweet, pungent and salty. The meridians include lung, pericardium, heart, large intestine, triple burner, small intestine, stomach, gallbladder, bladder, spleen, liver and kidney.
[0012] Furthermore, in S1, the collected prescription data are standardized and cleaned, including:
[0013] S101, standardization of Chinese medicine terminology, using the 2020 version of the Pharmacopoeia of the People's Republic of China as the standard to replace the original and synonymous names of Chinese medicines in prescription data. No processing will be done for those without synonyms. For those with one original and one synonymous name, the original name will be directly replaced. For confusing drug names, the original name will be replaced after identification based on the context (efficacy, main indications, etc.);
[0014] S102, symptom terminology standardization, uses the 2660 symptom terms collected in the "Standardization of Common Symptom Terminology in Traditional Chinese Medicine (2005 Edition)" as the standard to pre-process the symptoms appearing in the collected prescription data.
[0015] Furthermore, in S2, the TCM entity pre-training includes:
[0016] S201, pre-training of Chinese medicine attribute features, using 23-dimensional vectors to quantify the natural attributes of Chinese medicine. in Represents the attribute characteristics of the i-th Chinese medicine in the entire data set. In order to embed the four qi, five flavors and toxicity into the vector, a three-level intensity division is used: for example, the "cold" nature of Chinese medicine includes "slightly cold", "cold" and "very cold", and their intensity is represented by 0.5, 1 and 2 respectively. For the meridians, binary coding (0 or 1) is used to clearly identify whether the Chinese medicine has an effect on a specific organ.
[0017] S202, symptom semantic feature pre-training, in order to extract the features of symptom entities in the prescription and obtain the overall context semantic representation, the Word2vec training model is applied to symptom semantic feature extraction. in represents the i-th symptom word embedding pre-trained by Word2vec, and the dimension of each word vector is set to 100.
[0018] Furthermore, in S3, multi-graph construction and entity feature extraction include:
[0019] S301, constructing the “symptom-traditional Chinese medicine” heterogeneous graph (SHHG)G SH =(V SH ,E SH ), where V SH = {V s ,V h} represents the symptom and Chinese medicine nodes in SHHG. SH It consists of the edges between all symptoms and Chinese medicine nodes, including the potential relationship between symptoms and Chinese medicine. The following is the SHHG graph construction formula:
[0020]
[0021] Where I(s i ,hj ) represents whether there is an interaction between symptoms and Chinese medicine;
[0022] S302, construct the "symptom-symptom" isomorphism graph (SSIG) G SS =(V SS ,E SS ), V SS represents the set of all symptom nodes, E SS Represents the co-occurrence edge set between symptoms and symptoms. The construction formula is as follows:
[0023]
[0024] Where I(s i ,s j ) indicates whether there is a co-occurrence relationship between symptoms;
[0025] S303, constructing the “traditional Chinese medicine-traditional Chinese medicine” isomorphic graph (HHIG) G HH =(V HH ,E HH ), V HH represents the set of all TCM nodes in HHIG, E HH The edge set composed of co-occurrence edges between traditional Chinese medicines is constructed with the following formula:
[0026]
[0027] Where I(h i ,h j ) indicates whether there is a co-occurrence relationship between Chinese medicines;
[0028] S304, calculating the similarity coefficient between each node and its neighbors in the graphs SSIG, HHIG and SHHG, the specific calculation formula is as follows:
[0029]
[0030] Among them, a is a shared self-attention mechanism, which consists of a single-layer feedforward propagation network, W is a learnable weight parameter, || is a concatenation operation, Represents symptom nodes i The input features of Represents node s j For i the importance of
[0031] S305, use the softmax function to normalize the attention coefficient so that the attention coefficient is comparable for all nodes on the graph. The calculation process is as follows:
[0032]
[0033] in Represents node s i The set of neighbor nodes of
[0034] S306, use the multi-head attention mechanism to obtain the overall features of each node, the calculation formula is as follows:
[0035]
[0036] Where K is the number of heads used in the multi-head self-attention mechanism;
[0037] S307, using the residual structure to enhance the feature representation of each node in the graph, the specific calculation formula is as follows:
[0038]
[0039] Finally, all the symptom features learned in the graph SSIG are represented as The features of traditional Chinese medicine learned in HHIG are represented as In the graph SHHG, the interaction information between symptoms and traditional Chinese medicine is integrated as symptom features and Chinese medicine characteristics
[0040] Furthermore, feature fusion and Chinese medicine recommendation in S4 include:
[0041] S401, feature fusion, fusion of the node features extracted from the three graphs to obtain the symptom feature e' s and characteristics of traditional Chinese medicine h , the feature fusion process is represented as follows:
[0042]
[0043] S402, using a multi-layer perceptron (MLP) to infer the symptom set to obtain the patient's syndrome, the calculation process is as follows:
[0044]
[0045] Where [s_set] represents the one-hot encoding matrix of the symptom set contained in each prescription;
[0046] S403, Chinese medicine recommendation, after obtaining each group of symptom representations, the probability that all Chinese medicines can treat the symptom set can be calculated. The calculation formula is as follows:
[0047]
[0048] After obtaining the final prediction score for each group of symptoms, the model was optimized using the binary cross entropy loss function with a sigmoid activation function.
[0049] The beneficial effects of the Chinese medicine recommendation method provided by the present invention are:
[0050] 1. The traditional Chinese medicine recommendation method based on multi-graph residual attention neural network fusion symptom semantic knowledge provided by the present invention uses the Word2Vec model to learn the contextual semantic information of symptom terms, so as to better capture the semantic characteristics of symptoms in prescriptions.
[0051] 2. The present invention takes into account the properties of traditional Chinese medicine itself, quantifies the "four properties and five flavors" and meridian properties of traditional Chinese medicine itself, and inputs them into the model as initial features, thereby alleviating the data sparsity problem that is common in traditional Chinese medicine recommendations.
[0052] 3. Taking into account the different therapeutic effects of different traditional Chinese medicines on symptoms, the present invention uses graph attention neural networks to learn the relationship between traditional Chinese medicines and symptoms, and enhances entity features through residual structures, thereby improving the model's ability to learn differences in therapeutic effects.
[0053] 4. The present invention takes graph attention neural network and attention mechanism as core technologies, topologies the complex relationships between TCM entities into heterogeneous graphs, uses the natural properties and ingredient characteristics of TCM as external knowledge fusion, explores the medication rules in TCM prescriptions, studies intelligent TCM recommendation technology, and provides a basis for TCM clinical prescriptions. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0055] Figure 1 This is the overall flow chart of the traditional Chinese medicine recommendation method based on knowledge-driven and residual attention network of the present invention.
[0056] Figure 2 It is a case analysis diagram of the experimental results in the present invention. DETAILED DESCRIPTION
[0057] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention and to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, the specific implementation modes of the present invention are further described below in conjunction with the accompanying drawings.
[0058] It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention. In addition, the technical features involved in each embodiment of the present invention described below can be combined with each other as long as there is no conflict between them.
[0059] Please refer to Figure 1 and Figure 2 In this embodiment, a method for recommending traditional Chinese medicine based on multi-graph residual attention neural network and symptom semantic knowledge is provided, and the method comprises the following steps:
[0060] S1, data collection and cleaning module: obtain prescription text data, perform standardization process on symptoms and TCM terms, including unification of synonyms and removal of duplicates, and then divide the processed data set into training set, validation set and test set;
[0061] S2, entity pre-training module: Use the Word2vec training model to extract symptom semantic features, so as to extract the features of symptom entities in prescriptions and obtain the overall contextual semantic representation. In addition, a knowledge graph of Chinese medicine attributes is constructed, and the natural attribute features of Chinese medicine are incorporated into the recommendation model as external knowledge;
[0062] S3, multi-graph construction and entity feature learning module: According to the co-occurrence relationship between symptoms and traditional Chinese medicine, the "symptom-traditional Chinese medicine" heterogeneous graph (SHHG), "symptom-symptom" isomorphic graph (SSIG) and "traditional Chinese medicine-traditional Chinese medicine" isomorphic graph (HHIG) are constructed respectively. The symptom features, traditional Chinese medicine features and their interaction features are extracted from SHHG, SSIG and HHIG respectively using the graph attention neural network, and the entity features are enhanced using the residual structure;
[0063] S4, feature fusion and Chinese medicine recommendation module: The symptom features and Chinese medicine features extracted from the three sub-graphs are fused separately to obtain the final Chinese medicine features and symptom features. MLP is used to express the syndrome features, and finally a suitable Chinese medicine set is recommended based on the given symptom set.
[0064] Preferably, the prescription database includes prescription name, function category, prescription composition, function and main indications, etc., and the traditional Chinese medicine database includes traditional Chinese medicine name, nature and flavor, meridian and toxicity information. The nature and flavor include cold, hot, warm, good, neutral, sour, bitter, sweet, pungent and salty, and the meridian includes lung, pericardium, heart, large intestine, triple burner, small intestine, stomach, gallbladder, bladder, spleen, liver and kidney.
[0065] Among them, examples of collected prescription data are shown in Table 1, Chinese medicine data are shown in Table 2, and symptom term classification is shown in Table 3.
[0066] Table 1 Example of collected prescription data
[0067]
[0068]
[0069] Table 2 Example of Chinese medicine data
[0070]
[0071] Table 3 Example of symptom term classification
[0072] Symptom Examples Subcategory name Category Name Chills Chills Cold, heat, and sweating symptoms High fever Fever Cold, heat, and sweating symptoms Hot and cold Cold, heat and miscellaneous Cold, heat, and sweating symptoms Sweating profusely Sweating Cold, heat, and sweating symptoms
[0073] Preferably, in S1, the collected prescription data is standardized and cleaned, including:
[0074] S101, standardization of Chinese medicine terminology, using the 2020 version of the Pharmacopoeia of the People's Republic of China as the standard to replace the original and synonymous names of Chinese medicines in prescription data. No processing will be done for those without synonyms. For those with one original and one synonymous name, the original name will be directly replaced. For confusing drug names, the original name will be replaced after identification based on the context (efficacy, main indications, etc.);
[0075] S102, symptom terminology standardization, uses the 2660 symptom terms collected in the "Standardization of Common Symptom Terminology in Traditional Chinese Medicine (2005 Edition)" as the standard to pre-process the symptoms appearing in the collected prescription data.
[0076] Preferably, in S2, the TCM entity pre-training includes:
[0077] S201, pre-training of Chinese medicine attribute features, using 23-dimensional vectors to quantify the natural attributes of Chinese medicine. in Represents the attribute characteristics of the i-th Chinese medicine in the entire data set. In order to embed the four qi, five flavors and toxicity into the vector, a three-level intensity division is used: for example, the "cold" nature of Chinese medicine includes "slightly cold", "cold" and "very cold", and 0.5, 1 and 2 are used to represent their intensity respectively. For meridians, binary coding (0 or 1) is used to clearly identify whether the Chinese medicine has an effect on a specific viscera. Taking ginseng and hawthorn as examples (see Table 4), it is explained that the medicinal properties of Chinese medicine are represented as initial feature vectors.
[0078] Table 4 Examples of 23-dimensional quantification of traditional Chinese medicine
[0079]
[0080] S202, symptom semantic feature learning, in order to extract the features of symptom entities in the prescription and obtain the overall context semantic representation, the Word2vec training model is applied to the symptom semantic feature extraction. in represents the i-th symptom word embedding pre-trained by Word2vec, and the dimension of each word vector is set to 100.
[0081] Preferably, in S3, multi-graph construction and entity feature extraction include:
[0082] S301, constructing the “symptom-traditional Chinese medicine” heterogeneous graph (SHHG)G SH =(V SH ,E SH ), where V SH = {V s ,V h} represents the symptom and Chinese medicine nodes in SHHG. SH It consists of the edges between all symptoms and Chinese medicine nodes, including the potential relationship between symptoms and Chinese medicine. The following is the SHHG graph construction formula:
[0083]
[0084] Where I(s i ,h j ) represents whether there is an interaction between symptoms and Chinese medicine;
[0085] S302, construct the "symptom-symptom" isomorphism graph (SSIG) G SS =(V SS ,E SS ), V SS represents the set of all symptom nodes, E SS Represents the co-occurrence edge set between symptoms and symptoms. The construction formula is as follows:
[0086]
[0087] Where I(s i ,s j ) indicates whether there is a co-occurrence relationship between symptoms;
[0088] S303, constructing the “traditional Chinese medicine-traditional Chinese medicine” isomorphic graph (HHIG) G HH =(V HH ,E HH ), V HH represents the set of all TCM nodes in HHIG, E HH The edge set composed of co-occurrence edges between traditional Chinese medicines is constructed with the following formula:
[0089]
[0090] Where I(h i ,h j ) indicates whether there is a co-occurrence relationship between Chinese medicines;
[0091] S304, calculating the similarity coefficient between each node and its neighbors in the graphs SSIG, HHIG and SHHG, the specific calculation formula is as follows:
[0092]
[0093] Among them, a is a shared self-attention mechanism, which consists of a single-layer feedforward propagation network, W is a learnable weight parameter, || is a concatenation operation, Represents symptom nodes i The input features of Represents node s j For i the importance of
[0094] S305, use the softmax function to normalize the attention coefficient so that the attention coefficient is comparable for all nodes on the graph. The calculation process is as follows:
[0095]
[0096] in Represents node s i The set of neighbor nodes of
[0097] S306, use the multi-head attention mechanism to obtain the overall features of each node, the calculation formula is as follows:
[0098]
[0099] Where K is the number of heads used in the multi-head self-attention mechanism;
[0100] S307, using the residual structure to enhance the feature representation of each node in the graph, the specific calculation formula is as follows:
[0101]
[0102] Finally, all the symptom features learned in the graph SSIG are represented as The features of traditional Chinese medicine learned in HHIG are represented as In the graph SHHG, the interaction information between symptoms and traditional Chinese medicine is integrated as symptom features and Chinese medicine characteristics
[0103] Preferably, in S4, feature fusion and Chinese medicine recommendation include:
[0104] S401, feature fusion, fusion of the node features extracted from the three graphs to obtain the symptom feature e' s and characteristics of traditional Chinese medicine h , the feature fusion process is represented as follows:
[0105]
[0106] S402, using a multi-layer perceptron (MLP) to infer the symptom set to obtain the patient's syndrome, the calculation process is as follows:
[0107]
[0108] Where [s_set] represents the one-hot encoding matrix of the symptom set contained in each prescription;
[0109] S403, Chinese medicine recommendation, after obtaining each group of symptom representations, the probability that all Chinese medicines can treat the symptom set can be calculated. The calculation formula is as follows:
[0110]
[0111] After obtaining the final prediction score for each group of symptoms, the model was optimized using the binary cross entropy loss function with a sigmoid activation function.
[0112] In order to verify the effectiveness of the Chinese medicine recommendation method based on knowledge-driven and residual attention network, the present invention conducts experiments on data sets including: prescription data collected and cleaned from ancient Chinese medicine books, textbooks and several authoritative websites, including "Golden Chamber Synopsis", "Treatise on Febrile Diseases", "Fangjixue", Yaozhi.com (https: / / www.yaozh.com) and Encyclopedia of Traditional Chinese Medicine (http: / / www.tcmip.cn / ETCM). The specific division results of the data set are shown in Table 5.
[0113] Table 5 Dataset distribution table
[0114] Number of data symptom traditional Chinese medicine Training set Validation set Test Set 9,196 1,448 1,919 5,517 1,839 1,840
[0115] In the present invention, Precision@N, Recall@N and F1-score@N are used to verify the performance of the model, where N represents the number of recommended Chinese medicines. Since the number of Chinese medicines in a prescription is generally between 15 and 20, N is set to {5, 10, 20}. The specific calculation formula is shown below.
[0116]
[0117]
[0118] Precision@N represents the accuracy of predicting the first N Chinese medicines as the correct ones, where R N (sym) is the set of traditional Chinese medicines predicted based on a given set of symptoms, T(sym) is the correct set of traditional Chinese medicines for a given set of symptoms, Recall@N represents the probability of being able to predict traditional Chinese medicines, and F1-score@N is a comprehensive evaluation index.
[0119] The following models were used for comparison:
[0120] Matrix Factorization (MF): The associations between symptoms and TCMs are considered as association matrices, and the TCM treatment scores corresponding to each group of symptoms are calculated through matrix factorization.
[0121] Neural Graph Collaborative Filtering (NGCF): A recommendation model based on collaborative filtering, which obtains the characteristics of symptoms and Chinese medicines by propagating information on the "symptom-Chinese medicine" bipartite graph.
[0122] Light Graph Convolution (Light GCN): Linearly propagates the "symptom-TCM" interaction matrix to learn the characteristics of symptoms and TCM, and outputs the features learned by all network layers as the final entity features.
[0123] All experiments in this paper were run on a computer equipped with an Intel Core i7-10700 CPU and NVIDIA GeForce RTX3060.
[0124] Table 6. Results of Chinese medicine recommendation on the prescription dataset using different baseline models
[0125]
[0126] Table 6 shows the results of the TCM recommendation experiment of four baseline models on the dataset, among which TCMRec is the TCM recommendation model proposed in this paper. The experimental results show that TCMRec outperforms other baseline models in terms of evaluation indicators accuracy, recall rate and F1 value, and achieves the best TCM recommendation effect. Specifically, TCMRec's performance in F1-score@5, F1-score@10 and F1-score@20 is 56.67%, 46.25% and 32.61% higher than that of NGCF, which performs well. Although MF, NGCF and Light GCN capture the high-order correlation between symptoms and TCM by constructing the "symptom-TCM" interaction matrix and introducing convolutional layers, their performance in the prescription recommendation task is still unsatisfactory. Specifically, MF mainly decomposes the "symptom-TCM" interaction matrix and learns the potential low-dimensional feature representation. However, the MF method is linear in nature and it is difficult to effectively capture complex nonlinear interactions, especially when it involves high-order relationships between multiple symptoms and TCMs. As a graph neural network model, NGCF improves the traditional collaborative filtering method by performing message propagation on the "symptom-TCM" bipartite graph and aggregating node neighbor information layer by layer to learn richer features. However, NGCF still focuses mainly on the direct interaction between symptoms and TCMs, while ignoring the potential connections between symptoms. Light GCN focuses on acquiring the features of symptoms and TCMs through linear propagation, but this simplified graph convolution performs well in learning local interactions, but cannot effectively capture the complex global relationship between different symptoms and TCMs, ignoring deeper relationship networks. The reason why TCMRec performs well in the TCM recommendation task may be that it considers the strength of the association between different TCMs and symptoms, while integrating symptom semantic knowledge and TCM attribute knowledge.
[0127] In order to observe the effect of Chinese medicine recommended by TCMRec more intuitively, Figure 2 The experimental results of Precision@10 on a randomly selected data set are shown, where the Chinese medicines in the gray box are correctly recommended. The Chinese medicines recommended in the case have the effects of "regulating qi and promoting qi circulation" and "strengthening the spleen and removing dampness", and have certain therapeutic effects on the given symptom set. Some recommended Chinese medicines are not in the original correct values, but they have certain therapeutic effects. For example, Magnolia officinalis has the effect of "removing blood stasis" and is an important Chinese medicine for "dispersing knots and eliminating fullness", and is often used together with tangerine peel. By learning the interaction between symptoms and Chinese medicines, TCMRec can recommend a set of Chinese medicines for treatment based on the symptom set, which has a certain reference significance for clinicians to select medicines and formulate prescriptions.
[0128] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0129] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions and variations made to these embodiments without departing from the principles and spirit of the present invention are still within the scope of protection of the present invention.
Claims
1. A method for recommending traditional Chinese medicine based on knowledge-driven and residual attention network, characterized in that: The Chinese medicine recommendation method comprises the following steps: S1, data collection and cleaning module: obtain prescription text data, perform standardization process on the symptoms and Chinese medicine terms, and divide the data set after the standardization process into training set, validation set and test set; S2, entity pre-training module: Use the Word2vec training model to extract symptom semantic features, extract the features of symptom entities in prescriptions and obtain the overall contextual semantic representation, build a knowledge graph of Chinese medicine attributes, and integrate the natural attribute features of Chinese medicine as external knowledge into the recommendation model; S3, multi-graph construction and entity feature learning module: According to the co-occurrence relationship between symptoms and Chinese medicine, the "symptom-Chinese medicine" heterogeneous graph (SHHG), "symptom-symptom" isomorphic graph (SSIG) and "Chinese medicine-Chinese medicine" isomorphic graph (HHIG) are constructed respectively. The graph attention neural network is used to extract symptom features, Chinese medicine features and their interaction features from the "symptom-Chinese medicine" heterogeneous graph (SHHG), "symptom-symptom" isomorphic graph (SSIG) and "Chinese medicine-Chinese medicine" isomorphic graph (HHIG), and the residual structure is used to enhance the entity features; S4, feature fusion and Chinese medicine recommendation module: the symptom features and Chinese medicine features extracted from the "symptom-Chinese medicine" heterogeneous graph (SHHG), the "symptom-symptom" isomorphic graph (SSIG) and the "Chinese medicine-Chinese medicine" isomorphic graph (HHIG) are fused respectively to obtain the final symptom features and Chinese medicine features, and the syndrome features are expressed using MLP. Finally, a suitable Chinese medicine set is recommended based on the given symptom set.
2. The method for recommending traditional Chinese medicine according to claim 1, characterized in that: The prescription text data includes the prescription name, major function category, prescription composition, function and main indications. The Chinese medicine terminology includes the Chinese medicine name, nature and flavor, meridian and toxicity information. The nature and flavor include cold, hot, warm, good, neutral, sour, bitter, sweet, pungent and salty. The meridian includes lung, pericardium, heart, large intestine, triple burner, small intestine, stomach, gallbladder, bladder, spleen, liver and kidney.
3. The method for recommending traditional Chinese medicine according to claim 2, characterized in that: In step S1, the collected prescription data is standardized and cleaned, including: S101, standardization of Chinese medicine terminology, using the Pharmacopoeia of the People's Republic of China 2020 as the standard to replace the original and synonymous names of Chinese medicines in prescription data. No processing is done for those without synonyms. For those with one original and one synonymous name, the original name is directly replaced. For confusing drug names, the original name is replaced after identification based on the context, where the context refers to efficacy and main indications; S102, symptom terminology standardization, uses the 2660 symptom terms collected in the "Standardization of Common Symptom Terminology in Traditional Chinese Medicine (2005 Edition)" as the standard to pre-process the symptoms appearing in the collected prescription data.
4. The method for recommending traditional Chinese medicine according to claim 3, characterized in that: In step S2, the TCM entity pre-training includes: S201, pre-training of Chinese medicine attribute features, using 23-dimensional vectors to quantify the natural attributes of Chinese medicine, in, Represents the attribute characteristics of the i-th Chinese medicine in the entire data set; in order to embed the four properties, five flavors and toxicity into the vector, a three-level intensity division is used: for example, the "cold" property of Chinese medicine includes "slightly cold", "cold" and "very cold", and their intensities are represented by 0.5, 1 and 2 respectively; for meridians, binary coding is used, and 0 or 1 is used to clearly indicate whether the Chinese medicine has an effect on a specific viscera; S202, symptom semantic feature pre-training, in order to extract the features of symptom entities in the prescription and obtain the overall context semantic representation, the Word2vec training model is applied to symptom semantic feature extraction. in, represents the i-th symptom word embedding pre-trained by Word2vec, and the dimension of each word vector is set to 100.
5. The method for recommending traditional Chinese medicine according to claim 4, characterized in that: In step S3, multi-graph construction and entity feature extraction include: S301, constructing the "symptom-traditional Chinese medicine" heterogeneous graph (SHHG)G SH =(V SH ,E SH ), where V SH = {V s ,V h } represents the symptom and Chinese medicine nodes in SHHG, E SH It consists of the edges between all symptoms and Chinese medicine nodes, including the potential relationship between symptoms and Chinese medicine. The following is the SHHG graph construction formula: Among them, I(s i ,h j ) represents whether there is an interaction between symptoms and Chinese medicine; S302, construct the "symptom-symptom" isomorphism graph (SSIG) G SS =(V SS ,E SS ), V SS represents the set of all symptom nodes, E SS Represents the co-occurrence edge set between symptoms and symptoms. The construction formula is as follows: Among them, I(s i ,s j ) indicates whether there is a co-occurrence relationship between symptoms; S303, constructing the "traditional Chinese medicine-traditional Chinese medicine" isomorphic graph (HHIG) G HH =(V HH ,E HH ), V HH represents the set of all TCM nodes in HHIG, E HH The edge set composed of co-occurrence edges between traditional Chinese medicines is constructed with the following formula: Among them, I(h i ,h j ) indicates whether there is a co-occurrence relationship between Chinese medicines; S304, calculating the similarity coefficient between each node and its neighbors in the graphs SSIG, HHIG and SHHG, the specific calculation formula is as follows: Among them, a is a shared self-attention mechanism, which consists of a single-layer feedforward propagation network, W is a learnable weight parameter, || is a concatenation operation, Represents symptom nodes i The input features of Represents node s j For i the importance of S305, use the softmax function to normalize the attention coefficient so that the attention coefficient is comparable for all nodes on the graph. The calculation process is as follows: in, Represents node s i The set of neighbor nodes of S306, use the multi-head attention mechanism to obtain the overall features of each node, the calculation formula is as follows: Where K is the number of heads used in the multi-head self-attention mechanism; S307, using the residual structure to enhance the feature representation of each node in the graph, the specific calculation formula is as follows: S308, all symptom features learned in the graph SSIG are represented as The features of traditional Chinese medicine learned in HHIG are represented as In the graph SHHG, the interaction information between symptoms and traditional Chinese medicine is integrated as symptom features and Chinese medicine characteristics 6. The method for recommending traditional Chinese medicine according to claim 5, characterized in that: In step S4, feature fusion and Chinese medicine recommendation include: S401, feature fusion, fusion of the node features extracted from the three graphs to obtain the symptom feature e' s and characteristics of traditional Chinese medicine h , the feature fusion process is represented as follows: S402, using a multi-layer perceptron (MLP) to infer the symptom set to obtain the patient's syndrome, the calculation process is as follows: Where [s_set] represents the one-hot encoding matrix of the symptom set contained in each prescription; S403, Chinese medicine recommendation, after obtaining each group of symptom representations, the probability that all Chinese medicines can treat the symptom set can be calculated. The calculation formula is as follows: After obtaining the final prediction score for each group of symptoms, the model was optimized using the binary cross entropy loss function with a sigmoid activation function.
Citation Information
Patent Citations
Semantic similarity-based personalized traditional Chinese medicine diagnosis and treatment information and traditional Chinese medicine information intelligent matching method
CN110929511A
Drug and symptom relation network construction and concept mapping method and system
CN113779265A
Traditional Chinese medicine prescription recommendation method and system based on variational depth generation
CN119028533A
Cited By
Diagnosis and treatment data analysis method and device for chest pain patient
CN120048495A
Traditional Chinese medicine symptom association prediction method based on similarity and graph neural network
CN120183704A
Traditional Chinese medicine knowledge graph fusion system based on semantic alignment
CN120600343A
Traditional Chinese medicine classical famous prescription intelligent recommendation method based on knowledge graph technology
CN120690391A
An intelligent recommendation method for classical famous Chinese medicine formulae based on knowledge graph technology
CN120690391B