A Traditional Chinese Medicine Prescription Recommendation Method Based on Knowledge Graph

By constructing a traditional Chinese medicine knowledge graph and combining deep learning technology, the problems of low knowledge utilization, insufficient personalized considerations and poor treatment of medicinal materials in traditional Chinese medicine prescription recommendations are solved, and a more scientific and personalized traditional Chinese medicine prescription recommendations are achieved.

CN116680412BActive Publication Date: 2025-05-27HENAN UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310690324.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-12
Publication Date
2025-05-27
Estimated Expiration
2043-06-12

AI Technical Summary

Technical Problem

The existing TCM prescription recommendations cannot effectively utilize loose, unstructured TCM knowledge, lack personalized considerations for patients, and the medicinal materials are not well-balanced.

Method used

The TCM prescription recommendation method based on knowledge graph is adopted, and the TCM knowledge graph is constructed by collecting and preprocessing TCM data, using the ComplEx model for representation learning and graph embedding, combined with the graph convolution neural network and attention mechanism, and comprehensively considering the patient's multiple factors for prescription recommendation.

Benefits of technology

It improves the utilization rate of traditional Chinese medicine knowledge, enhances personalized considerations for patients, improves the treatment effect of medicinal materials, provides more reliable recommendations of traditional Chinese medicine prescriptions, and assists in the clinical diagnosis and treatment decisions of traditional Chinese medicine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure QLYQS_1
    Figure QLYQS_1
  • Figure QLYQS_2
    Figure QLYQS_2
  • Figure QLYQS_3
    Figure QLYQS_3
Patent Text Reader

Abstract

A traditional Chinese medicine prescription recommendation method based on a knowledge graph applies knowledge graph embedding models, multi-head attention mechanisms, graph convolutions, etc. to combine graph features with a recommendation system, comprehensively consider the patient's situation, and conduct traditional Chinese medicine prescription recommendations. Taking the text description of traditional Chinese medicine medical records as the research object, integrating the information of the traditional Chinese medicine knowledge graph, absorbing the clinical experience of famous and veteran traditional Chinese medicine doctors in prescribing the right medicine, fully considering multiple personalized factors such as the properties of traditional Chinese medicine, efficacy, condition, and the patient's constitution. It is based on the holistic principle of traditional Chinese medicine and the idea of syndrome differentiation and treatment. According to the different symptoms and conditions of patients, it induces syndromes and selects different combinations of medicinal materials. It proposes a traditional Chinese medicine prescription recommendation method that integrates the knowledge graph, considers the complex relationship between personal physical signs, symptoms, and drugs, analyzes local rules specifically in combination with each prescription, recommends more reliable prescription medicinal materials for doctors and patients, and provides auxiliary decision-making support for traditional Chinese medicine clinical diagnosis and treatment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of traditional Chinese medicine prescription recommendation, and particularly to a traditional Chinese medicine prescription recommendation method based on a knowledge graph. Background Art

[0002] Traditional Chinese medicine is a medical theory system originating from ancient China, which has been practiced and summarized over thousands of years. It is a precious wealth and wisdom crystallization of the Chinese nation. In recent years, the Chinese government has attached great importance to the development and inheritance of traditional Chinese medicine, actively taken measures to promote the spread and application of traditional Chinese medicine at home and abroad, and further promoted the inheritance, opening up and innovative development of traditional Chinese medicine. As a unique medical system, traditional Chinese medicine uses various methods such as observation, auscultation and olfaction, interrogation, and pulse-taking to obtain disease information, and then implements syndrome differentiation and treatment. In the clinical practice of traditional Chinese medicine, it is necessary to be based on a scientific dialectical basis, select appropriate prescriptions according to the individual characteristics of patients and follow the rules of medicinal material combination. The efficacy of traditional Chinese medicine prescriptions is not a simple superposition of the effects of single drugs, but through the comprehensive action of drugs to achieve the balance of yin and yang in the human body, so as to cure diseases.

[0003] However, at present, the main syndromes and concurrent syndromes in traditional Chinese medicine diagnosis and treatment cannot be distinguished, the prescriptions are aimless, the drug compatibility is chaotic, the knowledge models for standard diagnosis and treatment have not been formed for classic works of traditional Chinese medicine and famous prescriptions and secret recipes, grass-roots doctors have insufficient experience, and the treatment methods and drug use are not objective enough due to human factors. At present, traditional Chinese medicine knowledge is distributed in numerous ancient books and documents, and its loose and unstructured characteristics make the utilization rate of traditional Chinese medicine knowledge low. In addition, traditional Chinese medicine emphasizes holism and needs to comprehensively consider various factors such as the patient's body, age, gender, medical history, etc., rather than simply treating a single symptom or disease. At present, some studies use attention neural networks to detect different drug groups in traditional Chinese medicine prescriptions, etc., but they lack consideration in terms of personalization. At the same time, since herbal medicines have certain side effects, the "sovereign, ministerial, adjuvant, and guiding" combination of medicinal material compatibility is required to balance the drug efficacy and prevent the mutual cancellation or generation of side effects between drugs. However, some current studies, such as using BRNN, etc. to learn the representations of herbal medicines, have poor treatment effects on medicinal material compatibility, etc. These problems limit the application and development of traditional Chinese medicine.

[0004] The application of the traditional Chinese medicine knowledge graph can greatly improve the dissemination of traditional Chinese medicine knowledge. By combining the traditional Chinese medicine knowledge graph with artificial intelligence algorithms, the complex semantic relationships of the traditional Chinese medicine theory system can be reorganized, and its potential correlation relationships can be found, thus making the traditional Chinese medicine theory more scientific and standardized. The intelligent auxiliary diagnosis and treatment system can use the traditional Chinese medicine knowledge graph to perform semantic reasoning on the medical record content, provide the most relevant diagnostic evidence and treatment plan for the doctor regarding the patient's condition, thereby improving the doctor's work efficiency, reducing misdiagnosis and missed diagnosis, providing personalized diagnosis and treatment plans for patients, and improving the treatment quality of patients. Therefore, traditional Chinese medicine assisted diagnosis and treatment plays a key role in the modernization of traditional Chinese medicine diagnosis and treatment. Integrating the information of the traditional Chinese medicine knowledge graph and constructing an intelligent traditional Chinese medicine assisted diagnosis and treatment decision-making system with the connotation of syndrome differentiation and treatment to provide auxiliary decision-making support for traditional Chinese medicine clinical diagnosis and treatment is the focus of promoting the development of traditional Chinese medicine diagnosis and treatment intelligence.

[0005] Currently, due to the huge and complex traditional Chinese medicine knowledge system, which is distributed in numerous ancient books and literature, the existing traditional Chinese medicine prescription recommendations cannot handle loose and unstructured knowledge well, resulting in low utilization rate of traditional Chinese medicine knowledge; traditional Chinese medicine emphasizes holism and needs to consider various aspects of the patient's body, age, gender, medical history, etc., rather than simply treating a single symptom or disease, but the current traditional Chinese medicine prescription recommendations lack consideration for patient individuality; at the same time, since traditional Chinese medicine has certain side effects, the balance of drug efficacy and prevention of mutual cancellation or side effects between drugs are achieved through "the monarch, minister, assistant, and guide" during the process of prescribing drugs, however, the current traditional Chinese medicine prescription recommendations do not handle the compatibility of medicinal materials well and have many problems. Summary of the Invention

[0006] To solve the problems of low utilization rate of knowledge in existing traditional Chinese medicine prescription recommendations, insufficient consideration for patient individuality, and poor handling effect of medicinal material compatibility, the present invention provides a traditional Chinese medicine prescription recommendation method based on a knowledge graph.

[0007] The technical solution adopted by the present invention to solve the above technical problems is: a traditional Chinese medicine prescription recommendation method based on a knowledge graph, comprising the following steps:

[0008] Step 1: Collect traditional Chinese medicine data and preprocess the data to remove duplicate data and standardize entity names;

[0009] Step 2: Perform named entity recognition and relationship extraction on the preprocessed traditional Chinese medicine data to obtain an entity set E and a relationship set R. Use the entity elements in the entity set E as nodes and the relationship elements in the relationship set R as the connections between nodes to construct a traditional Chinese medicine knowledge graph;

[0010] Step 3: Use the ComplEx model for representation learning of the traditional Chinese medicine knowledge graph. Select all symptom nodes and all traditional Chinese medicine nodes in the traditional Chinese medicine knowledge graph, and select the age information nodes, gender information nodes, efficacy information nodes, medicinal property information nodes, syndrome information nodes, and treatment principle information nodes that have relationship connections with the symptom nodes or traditional Chinese medicine nodes. Represent the selected nodes as complex vectors respectively, and then calculate the symptom node vector representation s' that integrates other information and the traditional Chinese medicine node vector representation h' that integrates other information:

[0011] ;

[0012] In the above formula, s is the symptom node vector representation, h is the traditional Chinese medicine node vector representation, a is the age vector representation, W a is the age weight matrix, g is the gender vector representation, W g is the gender weight matrix, tr is the treatment principle vector representation, W tr is the treatment principle weight matrix, ef is the efficacy vector representation, W ef is the efficacy weight matrix, p is the medicinal property vector representation, W pr is the medicinal property weight matrix, sy is the syndrome vector representation, W sy is the syndrome weight matrix;

[0013] Then, perform tensor-based knowledge graph embedding on the symptom node vector representation s' that integrates other information and the traditional Chinese medicine node vector representation h' that integrates other information through the embedding layer of the ComplEx model, map the symptom node vector representation s' that integrates other information to a low-dimensional vector space, and obtain the symptom node vector representation e' s after using the graph embedding model, and map the traditional Chinese medicine node vector representation h' that integrates other information to a low-dimensional vector space, and obtain the traditional Chinese medicine node vector representation e' h ;

[0014] Then, train the ComplEx model through the scoring function P(e' s , r, e' h ) and generate a recommended training set;

[0015] Represent the symptom node vector representation e' s after using the graph embedding model and the traditional Chinese medicine node vector representation after using the graph embedding model respectively as:

[0016] ;

[0017] In the above formula, Re(e' s ) is the real part of e' s , and Re(e' h ) is the real part of e'h The real part of, Im(e' s ), is e' s The imaginary part of, Im(e' h ), is e' h The imaginary part;

[0018] The scoring function P(e' s , r, e' h ) has the formula:

[0019] ;

[0020] ;

[0021] In the above formula, r is the vector representation of the relationship between e' s and e' h , σ is the activation function, Re(r) is the real part of r, and Im(r) is the imaginary part of r;

[0022] Step 4. According to the coverage rate of KG entities in the recommended training set, freeze or fine-tune the entity embedding vectors learned by the ComplEx model through training:

[0023] ;

[0024] In the above formula, denotes freezing the entity embedding vector , denotes fine-tuning the entity embedding vector , and threshold is the decision threshold for entity coverage rate;

[0025] Step 5. Learn the self-characteristic information r s of the symptom node and the self-characteristic information r h of the traditional Chinese medicine node. The self-characteristic information r s of the symptom node is obtained through the vector representation of the symptom node in each layer of the graph convolutional neural network, and the self-characteristic information r h of the traditional Chinese medicine node is obtained through the vector representation of the traditional Chinese medicine node in each layer of the graph convolutional neural network;

[0026] For the symptom node s, the set of its one-hop neighbor traditional Chinese medicine nodes is N s , and the message of the k-th layer neighbor nodes is:

[0027] ;

[0028] The vector representation of the symptom node s in the k-th layer of the graph convolutional neural network is:

[0029] ;

[0030] In the above formula, is the number of adjacent nodes of the symptom node, is the weight matrix of the symptom node at the k-th layer, is the bias term, tanh is the activation function, and CONCAT is the vector concatenation operation. is the information passed from the traditional Chinese medicine node to the symptom node at the (k - 1)-th layer;

[0031] For the traditional Chinese medicine node h, the set of its one-hop neighbor symptom nodes is N h , and the message of the neighbor nodes at the k-th layer is:

[0032] ;

[0033] The vector representation of the traditional Chinese medicine node h at the k-th layer in the graph convolutional neural network is:

[0034] ;

[0035] In the above formula, is the number of adjacent nodes of the traditional Chinese medicine node, is the weight matrix of the traditional Chinese medicine node at the k-th layer, is the bias term, tanh is the activation function, and CONCAT is the vector concatenation operation. is the information passed from the symptom node to the traditional Chinese medicine node at the (k - 1)-th layer;

[0036] Step 6: Combine the graph spectrum features with the recommendation system using the attention mechanism. According to the vector representation e' s of the symptom node after using the graph embedding model s and the self-characteristic information r

[0037] ;

[0038] According to the vector representation e' h of the traditional Chinese medicine node after using the graph embedding model h and the self-characteristic information r

[0039] ;

[0040] are the parameter matrices learned from the three linear transformation layers in the multi-head attention layer respectively;

[0041] Then, calculate the attention matrix A s of the symptom node and the attention matrix A h:

[0042] , where d k is the dimension value;

[0043] Then, the fused representation vector e of the symptom nodes is obtained s * and the fused representation vector e of the traditional Chinese medicine nodes h * :

[0044] ;

[0045] Step 7. Construct a multi-hot vector x according to the set sc of symptom entities to be discriminated sc :

[0046] ;

[0047] According to the fused representation vector e of the symptom nodes s * the overall symptom matrix E is obtained s * :

[0048] ;

[0049] Then, using the multi-hot vector x sc as a mask, the overall symptom matrix E s * is extracted to obtain the discrimination syndrome matrix M sc :

[0050] ,

[0051] The multi-hot vector x is converted into a diagonal matrix through the diag function, and the non-zero rows in the discrimination syndrome matrix M sc correspond to the fused representation vectors e of the symptom nodes in the set sc of symptom entities sc s * ;

[0052] Then, an average pooling operation is performed on the discrimination syndrome matrix M sc for single induction to obtain a single representation vector e sc :

[0053] ;

[0054] The single representation vector e sc is input into a multi-layer perceptron for syndrome induction to obtain the final syndrome representation:

[0055] The expression of the multi-layer perceptron is:

[0056] ;

[0057] In the above formula, W L is the weight matrix of the L-th layer, b L is the bias term of the L-th layer, and ReLU is a non-linear activation function;

[0058] Take the output of the multi-layer perceptron as the final syndrome representation vector e z , that is, e z = h L ;

[0059] Step eight, according to the fused representation vector e h * of the traditional Chinese medicine nodes, obtain the overall traditional Chinese medicine matrix E H * :

[0060] ;

[0061] Then, according to the final discrimination vector e z and the overall traditional Chinese medicine matrix E H * obtain the predicted probability vector m(sc):

[0062] , where σ is an activation function;

[0063] For each candidate traditional Chinese medicine, calculate the binary cross-entropy loss between its predicted probability and the true label, and sum over all traditional Chinese medicines. Assuming there are H candidate traditional Chinese medicines, for the symptom entity set sc, obtain an H-dimensional predicted probability vector through m(sc), denoted as , and the model selects the top k traditional Chinese medicines with the highest probabilities in m(sc) as the traditional Chinese medicine prescriptions recommended for the symptom sc.

[0064] Preferably, in step one, structured data and unstructured data are collected simultaneously. The structured data includes traditional Chinese medicine dictionaries, databases, and ontologies, and the unstructured data includes traditional Chinese medicine literature, clinical records, and expert knowledge.

[0065] According to the above technical solution, the beneficial effects of the present invention are:

[0066] The present invention combines graph features with a recommendation system by applying knowledge graph embedding models, multi-head attention mechanisms, graph convolutions, etc., comprehensively considers the patient's situation, and makes traditional Chinese medicine prescription recommendations. Taking the text description of traditional Chinese medicine medical records as the research object, integrating the information of the traditional Chinese medicine knowledge graph, absorbing the clinical experience of famous traditional Chinese medicine doctors in prescribing the right medicine, and fully considering multiple personalized factors such as the properties of traditional Chinese medicine, efficacy, condition, and the patient's constitution. Based on the holistic principle and the idea of syndrome differentiation and treatment of traditional Chinese medicine, different combinations of medicinal materials are selected according to the different symptoms and conditions of the patient to summarize the syndromes, and a method for recommending traditional Chinese medicine prescriptions integrating the knowledge graph is proposed. Considering the complex relationship between personal signs, symptoms and drugs, and analyzing the local rules specifically for each prescription, more reliable prescription medicinal materials are recommended for doctors and patients, providing auxiliary decision-making support for traditional Chinese medicine clinical diagnosis and treatment. Detailed implementation manners

[0067] A method for recommending traditional Chinese medicine prescriptions based on a knowledge graph, comprising the following steps:

[0068] Step 1: Collect traditional Chinese medicine data and preprocess the data to remove duplicate data and standardize entity names. At the same time, collect structured data and unstructured data. The structured data includes traditional Chinese medicine dictionaries, databases, and ontologies, and the unstructured data includes traditional Chinese medicine literature, clinical records, and expert knowledge.

[0069] Step 2: Perform named entity recognition and relationship extraction on the preprocessed traditional Chinese medicine data to obtain an entity set E and a relationship set R. Use the entity elements in the entity set E as nodes and the relationship elements in the relationship set R as the connections between the nodes to construct a traditional Chinese medicine knowledge graph.

[0070] Step 3: Use the ComplEx model to perform representation learning on the traditional Chinese medicine knowledge graph. Select all symptom nodes and all traditional Chinese medicine nodes in the traditional Chinese medicine knowledge graph, and select age information nodes, gender information nodes, efficacy information nodes, property information nodes, syndrome information nodes, and treatment principle information nodes that have relationship connections with the symptom nodes or traditional Chinese medicine nodes. Represent the above selected nodes as complex vectors respectively, and then calculate the symptom node vector representation s' integrating other information and the traditional Chinese medicine node vector representation h' integrating other information:

[0071] ;

[0072] In the above formula, s is the symptom node vector representation, h is the traditional Chinese medicine node vector representation, a is the age vector representation, W a is the age weight matrix, g is the gender vector representation, W g is the gender weight matrix, tr is the treatment principle vector representation, W tr is the treatment principle weight matrix, ef is the efficacy vector representation, W efis the utility weight matrix, p is the vector representation of drug properties, and W pr is the drug property weight matrix, sy is the vector representation of syndromes, and W sy is the syndrome weight matrix.

[0073] Then, through the embedding layer of the ComplEx model, the symptom node vector representation s' fused with other information and the traditional Chinese medicine node vector representation h' fused with other information are subjected to tensor-based knowledge graph embedding. The symptom node vector representation s' fused with other information is mapped to a low-dimensional vector space to obtain the symptom node vector representation e' after using the graph embedding model s , and the traditional Chinese medicine node vector representation h' fused with other information is mapped to a low-dimensional vector space to obtain the traditional Chinese medicine node vector representation e' after using the graph embedding model h .

[0074] Then, through the scoring function P(e' s , r, e' h ) of the ComplEx model, the ComplEx model is trained and a recommended training set is generated.

[0075] The symptom node vector representation e' after using the graph embedding model s and the traditional Chinese medicine node vector representation after using the graph embedding model are respectively expressed as:

[0076] ;

[0077] In the above formula, Re(e' s ) is the real part of e' s , Re(e' h ) is the real part of e' h , Im(e' s ) is the imaginary part of e' s , and Im(e' h ) is the imaginary part of e' h .

[0078] The formula for the scoring function P(e' s , r, e' h ) is:

[0079] ;

[0080] ;

[0081] In the above formula, r is the vector representation of the relationship between e' s and e' h , σ is the activation function, Re(r) is the real part of r, and Im(r) is the imaginary part of r.

[0082] Step 4: Freeze or fine-tune the entity embedding vectors learned by the ComplEx model according to the coverage rate of KG entities in the recommended training set:

[0083] ;

[0084] In the above formula, denotes freezing the entity embedding vector , denotes fine-tuning the entity embedding vector , and threshold is the decision threshold for entity coverage rate.

[0085] Step 5: Learn the self-feature information of symptom nodes and the self-feature information of traditional Chinese medicine nodes through the graph convolutional neural network. The self-feature information of symptom nodes is obtained through the vector representation of symptom nodes in each layer of the graph convolutional neural network, and the self-feature information of traditional Chinese medicine nodes is obtained through the vector representation of traditional Chinese medicine nodes in each layer of the graph convolutional neural network.

[0086] For symptom node s, the set of its one-hop neighbor traditional Chinese medicine nodes is N s , and the message of the k-th layer neighbor nodes is:

[0087] ;

[0088] The vector representation of symptom node s in the k-th layer of the graph convolutional neural network is:

[0089] ;

[0090] In the above formula, is the number of adjacent nodes of the symptom node, is the weight matrix of the symptom node in the k-th layer, is the bias term, tanh is the activation function, CONCAT is the vector concatenation operation, is the information passed from the traditional Chinese medicine node in the (k - 1)-th layer to the symptom node.

[0091] For traditional Chinese medicine node h, the set of its one-hop neighbor symptom nodes is N h , and the message of the k-th layer neighbor nodes is:

[0092] ;

[0093] The vector representation of traditional Chinese medicine node h in the k-th layer of the graph convolutional neural network is:

[0094] ;

[0095] In the above formula, is the number of adjacent nodes of the traditional Chinese medicine node, is the weight matrix of the traditional Chinese medicine node at the k-th layer, is the bias term, tanh is the activation function, and CONCAT is the vector concatenation operation, is the information passed from the symptom node at the (k-1)-th layer to the traditional Chinese medicine node.

[0096] Step 6: Combine the graph features with the recommendation system using the attention mechanism. According to the symptom node vector representation e' s after using the graph embedding model and the self-characteristic information of the symptom node, obtain the Query matrix, Key matrix, and Value matrix of the symptom node:

[0097] ;

[0098] According to the traditional Chinese medicine node vector representation e' h after using the graph embedding model and the self-characteristic information r h of the traditional Chinese medicine node, obtain the Query matrix, Key matrix, and Value matrix of the traditional Chinese medicine node:

[0099] ;

[0100] are the parameter matrices learned from the three linear transformation layers in the multi-head attention layer respectively.

[0101] Then calculate the attention matrix A s of the symptom node and the attention matrix A h of the traditional Chinese medicine node through the softmax function:

[0102] , where d k is the dimension value.

[0103] Then obtain the fused representation vector e s * of the symptom node and the fused representation vector e h * of the traditional Chinese medicine node:

[0104] .

[0105] Step 7: Construct a multi-hot vector x sc according to the set of symptom entities sc to be discriminated:

[0106] ;

[0107] Obtain the overall symptom matrix E s * from the fused representation vector e s * of the symptom node:

[0108] 。

[0109] Then, use the multi-hot vector x sc as a mask to extract from the overall symptom matrix E s * to obtain the discriminant syndrome matrix M sc :

[0110] ,

[0111] Convert the multi-hot vector x sc into a diagonal matrix through the diag function, and make the non-zero rows in the discriminant syndrome matrix M sc correspond to the fused representation vectors e s * of the symptom nodes in the symptom entity set sc

[0112] Then, perform a single induction on the discriminant syndrome matrix M sc using average pooling operation to obtain a single representation vector e sc :

[0113] 。

[0114] Input the single representation vector e sc into a multi-layer perceptron for syndrome induction to obtain the final syndrome representation

[0115] The expression of the multi-layer perceptron is:

[0116] ;

[0117] In the above formula, W L is the weight matrix of the L-th layer, b L is the bias term of the L-th layer, and ReLU is a non-linear activation function;

[0118] Take the output of the multi-layer perceptron as the final syndrome representation vector e z , that is, e z = h L 。

[0119] Step Eight: Obtain the overall traditional Chinese medicine matrix E h * from the fused representation vectors e H * :

[0120] 。

[0121] Then, according to the final discriminant vector e z and the overall traditional Chinese medicine matrix E H* Obtain the predicted probability vector m(sc):

[0122] , where σ is the activation function.

[0123] For each candidate traditional Chinese medicine, calculate the binary cross-entropy loss between its predicted probability and the true label, and sum over all traditional Chinese medicines. Assuming there are H candidate traditional Chinese medicines, for the symptom entity set sc, a predicted probability vector of dimension H is obtained through m(sc), denoted as , and the model selects the top k traditional Chinese medicines with the highest probabilities in m(sc) as the traditional Chinese medicine prescriptions recommended for the symptom sc.

Claims

1. A traditional Chinese medicine prescription recommendation method based on a knowledge graph, characterized in that, it includes the following steps: Step 1: Collect traditional Chinese medicine data and preprocess the data to remove duplicate data and standardize entity names; Step 2: Perform named entity recognition and relationship extraction on the preprocessed traditional Chinese medicine data to obtain an entity set E and a relationship set R. Use the entity elements in the entity set E as nodes and the relationship elements in the relationship set R as the connections between nodes to construct a traditional Chinese medicine knowledge graph; Step 3: Use the ComplEx model to perform representation learning on the traditional Chinese medicine knowledge graph. Select all symptom nodes and all traditional Chinese medicine nodes in the traditional Chinese medicine knowledge graph, and select age information nodes, gender information nodes, utility information nodes, medicinal property information nodes, syndrome information nodes, and treatment principle information nodes that have relationship connections with the symptom nodes or traditional Chinese medicine nodes. Represent the selected nodes as complex vectors respectively, and then calculate the symptom node vector representation s' that fuses other information and the traditional Chinese medicine node vector representation h' that fuses other information: ; In the above formula, s is the vector representation of symptom nodes, h is the vector representation of traditional Chinese medicine nodes, a is the vector representation of age, and W a is the age weight matrix, g is the vector representation of gender, and W g is the gender weight matrix, tr is the vector representation of treatment principles, and W tr is the treatment principle weight matrix, ef is the vector representation of utility, and W ef is the utility weight matrix, p is the vector representation of drug properties, and W pr is the drug property weight matrix, sy is the vector representation of syndrome, and W sy is the syndrome weight matrix; Then, through the embedding layer of the ComplEx model, perform tensor-based knowledge graph embedding on the symptom node vector representation s' that integrates other information and the traditional Chinese medicine node vector representation h' that integrates other information, map the symptom node vector representation s' that integrates other information into a low-dimensional vector space, and obtain the symptom node vector representation e' after using the graph embedding model s , and map the traditional Chinese medicine node vector representation h' that integrates other information into a low-dimensional vector space to obtain the traditional Chinese medicine node vector representation e' after using the graph embedding model h ; Then, the scoring function \(P(e', s , r, e' h ) of the ComplEx model is used to train the ComplEx model and generate a recommended training set; The symptom node vector representation e' after using the graph embedding model s and the traditional Chinese medicine node vector representation after using the graph embedding model are respectively represented as: ; In the above formula, Re(e' s ) is the real part of e' s , Re(e' h ) is the real part of e' h , Im(e' s ) is the imaginary part of e' s , and Im(e' s ) is the imaginary part of e' h ; The scoring function P(e' s , r, e' h ) has the following formula: ; ; In the above formula, r is the relational vector representation between e' s and e' h , σ is the activation function, Re(r) is the real part of r, and Im(r) is the imaginary part of r; Step 4: According to the coverage rate of KG entities in the recommendation training set, freeze or fine-tune the entity embedding vectors learned by the ComplEx model through training: ; In the above formula, indicates freezing the entity embedding vector , indicates fine-tuning the entity embedding vector , and threshold is the determination threshold of the entity coverage rate; Step 5: Learn the self-characteristic information r of symptom nodes through a graph convolutional neural network s and the self-characteristic information r of traditional Chinese medicine nodes h , the self-characteristic information r of symptom nodes s is obtained through the vector representation of symptom nodes in each layer of the graph convolutional neural network, and the self-characteristic information r of traditional Chinese medicine nodes h is obtained through the vector representation of traditional Chinese medicine nodes in each layer of the graph convolutional neural network; For the symptom node s, the set of traditional Chinese medicine nodes among its one-hop neighbors is N s , and the message of the neighbor nodes at the k-th layer is as follows: ; The vector representation of the symptom node s at the k-th layer in the graph convolutional neural network is: ; In the above formula, is the number of adjacent nodes of the symptom node, is the weight matrix of the symptom node at the k-th layer, is the bias term, tanh is the activation function, and CONCAT is the vector concatenation operation, is the information passed from the herb node to the symptom node at the (k - 1)-th layer; For the traditional Chinese medicine node h, the set of its one-hop neighbor symptom nodes is N h , and the message of the neighbor nodes at the k-th layer is as follows: ; The vector representation of the traditional Chinese medicine node h at the k-th layer in the graph convolutional neural network is: ; In the above formula, is the number of adjacent nodes of the traditional Chinese medicine node, is the weight matrix of the traditional Chinese medicine node at the k-th layer, is the bias term, tanh is the activation function, and CONCAT is the vector concatenation operation, is the information passed from the symptom node of the (k - 1)-th layer to the traditional Chinese medicine node; Step 6: Combine the graph features with the recommendation system using the attention mechanism, and obtain the Query matrix, Key matrix, and Value matrix of the symptom nodes based on the symptom node vector representation e' after using the graph embedding model s and the self-feature information r of the symptom nodes s : ; According to the vector representation e' of traditional Chinese medicine nodes after using the graph embedding model h and the self-characteristic information r of traditional Chinese medicine nodes h obtain the Query matrix, Key matrix, and Value matrix of traditional Chinese medicine nodes: ; They are parameter matrices learned from three linear transformation layers in the multi-head attention layer respectively; Then, the attention matrix A of the symptom nodes is calculated through the softmax function s and the attention matrix A of the traditional Chinese medicine nodes h : , where d k is the dimension value; Then, the fused representation vector e of the symptom node is obtained s * and the fused representation vector e of the traditional Chinese medicine node h * : ; Step 7. Construct a multi-hot vector x according to the set of symptom entities sc to be identified sc : ; According to the fused representation vector e of the symptom nodes s * the overall symptom matrix E is obtained s * : ; Then, take the multi-hot vector x sc as a mask to extract from the overall symptom matrix E s * and obtain the syndrome differentiation matrix M sc : , Convert the multi-hot vector x through the diag function sc into a diagonal matrix, and make the non-zero rows in the discrimination syndrome matrix M sc correspond to the fused representation vector e of the symptom nodes in the symptom entity set sc s * ; Then, an average pooling operation is used to perform a single induction on the syndrome discrimination matrix M sc to obtain a single representation vector e sc : ; Input the single representation vector e sc into a multi-layer perceptron for syndrome induction to obtain the final syndrome representation: The expression of the multi-layer perceptron is: ; In the above formula, W L is the weight matrix of the L-th layer, b L is the bias term of the L-th layer, and ReLU is a non-linear activation function; Use the output of the multi-layer perceptron as the final syndrome representation vector e z , that is, e z = h L ; Step 8. Obtain the overall traditional Chinese medicine matrix E based on the fused representation vector e of the traditional Chinese medicine nodes h * H * :​ ; Then, based on the final discrimination vector e z and the overall traditional Chinese medicine matrix E H * the predicted probability vector m(sc) is obtained: , where σ is the activation function; For each candidate traditional Chinese medicine, calculate the binary cross-entropy loss between its predicted probability and the true label, and sum over all traditional Chinese medicines. Assuming there are H candidate traditional Chinese medicines, for the symptom entity set sc, obtain an H-dimensional predicted probability vector through m(sc), denoted as , and the model selects the top k traditional Chinese medicines with the highest probabilities in m(sc) as the traditional Chinese medicine prescriptions recommended for the symptom sc.

2. The traditional Chinese medicine prescription recommendation method based on a knowledge graph according to claim 1, characterized in that: In step 1, structured data and unstructured data are collected simultaneously. The structured data includes traditional Chinese medicine dictionaries, databases, and ontologies, and the unstructured data includes traditional Chinese medicine literature, clinical records, and expert knowledge.

Citation Information

Patent Citations

  • A tensor-based knowledge graph representation learning method and system

    CN109947948A

  • Personalized recommendation method based on knowledge graph convolution algorithm

    CN112488791A