Polygonatum odoratum formula medication recommendation method based on ancient literature
By constructing a pathological correlation graph and a medicinal material factor matrix, training a self-attention model, and selecting high-frequency prescriptions as recommendations for Polygonatum odoratum prescriptions, the problem of insufficient targeting and theoretical support in existing drug prescription recommendations is solved, and efficient and controllable Polygonatum odoratum prescription recommendations are achieved.
Patent Information
- Application Number
- CN202511224760.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-12-30
AI Technical Summary
Existing intelligent TCM diagnosis and treatment technologies fail to fully consider the relationship between prescriptions in ancient books and clinical prescriptions, resulting in insufficient targeting of drug prescriptions and lack of support from classical theories, making it impossible to effectively recommend highly targeted TCM prescriptions.
By acquiring the original text data of ancient books and clinical prescriptions, a prescription list and a medicinal material factor matrix are constructed. A pathological association graph is constructed using a graph algorithm, a self-attention model is trained, cluster centers are determined, and high-frequency prescriptions are selected as the recommended medication results for the Polygonatum odoratum prescription.
It improves the accuracy and intelligence of the Yuzhu prescription recommendation, and the output high-frequency prescription set is scientific, stable and traceable, with adaptive ability to data changes, and enhances the interpretability and controllability of the recommendation.
Smart Images

Figure CN121237328A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent medical technology, and more specifically, relates to a method for recommending prescriptions of Polygonatum odoratum based on ancient medical literature. Background Technology
[0002] In recent years, with the continuous development of artificial intelligence technology, the development of intelligent TCM diagnosis and treatment auxiliary systems has greatly promoted the intelligent development of TCM diagnosis and treatment decision-making and improved the efficiency of TCM inheritance and innovation. However, due to the inherent characteristics of TCM's "empirical" diagnosis and treatment, the complexity of its core theory of "syndrome differentiation and treatment," and the theory of Chinese herbal medicine compatibility, the development of intelligent TCM diagnosis and treatment technology has been slow. In the clinical diagnosis and treatment process of TCM, it is often necessary to prescribe two or more drugs simultaneously.
[0003] Currently, intelligent TCM diagnosis and treatment technologies can be divided into two categories: traditional TCM text mining technology and neural network-based prescription recommendation technology. Traditional TCM text mining technology typically employs machine learning techniques such as latent structure analysis, cluster analysis, decision trees, and association rules to extract implicit "syndrome differentiation and treatment" information from TCM prescription texts, or to analyze the core prescriptions within a set of prescriptions, thereby deriving the diagnostic and treatment decision information contained within the prescription text. Neural network-based prescription recommendation technology transforms TCM diagnosis and treatment techniques into prescription recommendations for a set of Chinese medicines based on a set of symptoms. This technology is currently divided into two categories: one is topic model-based prescription recommendation technology, which converts medical record texts into documents, treating symptoms and Chinese medicines within the medical record as words, and syndromes / pathogenesis as latent topics. LDA technology is then used to mine the latent topics and the co-occurrence relationships between symptoms and Chinese medicines, thereby achieving prescription recommendation.
[0004] However, the aforementioned existing technologies do not fully consider the citation relationships of the prescriptions in historical clinical prescriptions and ancient books, nor do they introduce prescription recommendations for targeted medicinal material factors, resulting in the need for further improvement in the specificity of the final recommended drug prescriptions and the support of classical theoretical texts. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention aims to resolve the aforementioned deficiencies and propose a method for recommending the use of Polygonatum odoratum formulas based on ancient medical texts.
[0006] The present invention adopts the following technical solution.
[0007] The first aspect of this invention discloses a method for recommending the use of Polygonatum odoratum in prescriptions based on ancient medical texts, the method comprising:
[0008] Obtain the original text data corresponding to ancient books and clinical prescriptions, and preprocess the original text data to construct a prescription list and a medicinal material factor matrix;
[0009] A pathological association graph of the target patient is constructed using a graph algorithm to characterize the correlation between the patient's pathological information and each prescription and herbal factor type in the prescription list and herbal factor matrix.
[0010] Prescriptions containing Solomon's Seal are used as positive sample data, and prescriptions without Solomon's Seal are used as negative sample data to train the self-attention model. Cluster centers are determined based on the pathological association graph and the herbal factor matrix.
[0011] Based on the cluster centers, high-frequency prescriptions with a clustering frequency exceeding a set threshold are selected, and these high-frequency prescriptions are output as recommended medication results for the Polygonatum odoratum formula.
[0012] Furthermore, the step of obtaining the original text data corresponding to ancient books and clinical prescriptions, and preprocessing the original text data to construct a prescription list and a medicinal material factor matrix, includes:
[0013] The patient's chief complaint and clinical symptoms, constitution diagnosis results, scores of the four diagnostic methods of traditional Chinese medicine, and modern medical indicators are obtained as prescription pathology information. The prescription list is constructed by combining the medicinal materials corresponding to the prescription pathology information.
[0014] The prescription list is used to statistically analyze the multiple medicinal factors contained in the medicinal components and the content ratio of each medicinal factor, and the medicinal factor matrix is constructed based on the multiple medicinal factors and the content ratio of each medicinal factor.
[0015] Furthermore, the construction of a pathological association graph of the target patient using a graph algorithm to characterize the correlation between the patient's pathological information and each prescription and medicinal factor type in the prescription list and medicinal factor matrix includes:
[0016] The patient's pathological information is segmented and part-of-speech tagged to obtain multiple strings. A pre-trained language model is then called to map the multiple strings into corresponding multiple vectors, and the cosine similarity between different vectors is calculated as the degree of correlation between different vectors.
[0017] Based on the multiple strings corresponding to the patient's pathological information and the prescription's pathological information, different tuples are constructed, and the values in the different tuples are compared to obtain the correlation between the prescription's pathological information and the patient's pathological information.
[0018] Furthermore, the pathological association diagram has multiple nodes, and different nodes are used to characterize the types of different medicinal material factors and different bonds in the tuple;
[0019] The step of constructing a pathological association graph of the target patient using a graph algorithm to characterize the correlation between the patient's pathological information and each prescription and medicinal factor type in the prescription list and medicinal factor matrix also includes:
[0020] The edges of each prescription in the prescription list are assigned a first weight coefficient according to the degree of correlation, and a second weight coefficient is set according to the frequency of each prescription being cited from ancient books.
[0021] The first weight coefficient and the second weight coefficient are weighted to construct a weight matrix corresponding to the prescription list according to the weighted weight coefficients.
[0022] Furthermore, the method also includes:
[0023] Obtain the string vector corresponding to any type of node in the pathological association diagram, and calculate the coupling degree between different types of nodes based on the string vector. The string vector is obtained by concatenating multiple word segmentation vectors of the same type.
[0024] The coupling degree is normalized, and a nonlinear activation function is called to perform feature mapping on the nodes in the pathological association graph based on the normalized coupling degree and the preset attention vector to obtain the mapped feature vector.
[0025] Furthermore, the self-attention model is trained using prescriptions containing Polygonatum odoratum as positive sample data and prescriptions not containing Polygonatum odoratum as negative sample data, and cluster centers are determined based on the pathological association graph and the herbal factor matrix, including:
[0026] The self-attention model is invoked to aggregate the mapped feature vectors based on a preset weight matrix to obtain an aggregated embedding matrix;
[0027] The aggregated embedding matrix is trained based on the positive and negative sample data, and a multilayer perceptron is invoked to predict the probability of each component in the Polygonatum odoratum formula corresponding to the patient's pathological information, thereby obtaining the prediction result.
[0028] Furthermore, the step of training the self-attention model using prescriptions containing Polygonatum odoratum as positive sample data and prescriptions not containing Polygonatum odoratum as negative sample data, and determining cluster centers based on the pathological association graph and the herbal factor matrix, also includes:
[0029] Based on the pathological association graph and the medicinal material matrix factor, each prescription is taken as a corresponding node, and the Euclidean distance between different nodes is calculated to determine other nodes whose Euclidean distance does not exceed the first threshold.
[0030] Based on other nodes whose Euclidean distance to each node does not exceed the first threshold, determine the frequency of the medicinal material factor corresponding to each node in the prescription list to construct a high-frequency index, and select multiple nodes whose high-frequency index is not lower than the second threshold.
[0031] The high-frequency index is composed of the frequency of all medicinal factors corresponding to each node appearing in the prescription list.
[0032] Furthermore, the step of selecting high-frequency prescriptions whose aggregation frequency exceeds a set threshold based on the cluster centers, and outputting the high-frequency prescriptions as the recommended medication results for the Polygonatum odoratum formula, includes:
[0033] A high-frequency prescription set is constructed based on multiple nodes whose high-frequency index is not lower than the second threshold, and the distance between other nodes and each node in the high-frequency prescription set is calculated to classify and determine the other nodes.
[0034] Based on the classification results of other nodes, the proportion of unclassified nodes and duplicated nodes is calculated, and the unclassified nodes and duplicated nodes are reclassified according to the proportion based on the preset prescription adjustment rules to obtain an adjusted high-frequency prescription set.
[0035] The second aspect of this invention discloses a prescription recommendation system based on ancient texts for Polygonatum odoratum formulas, used to implement the prescription recommendation method based on ancient texts for Polygonatum odoratum formulas described in the first aspect, the system comprising:
[0036] The data preprocessing module is used to acquire the original text data corresponding to ancient books and clinical prescriptions, and to preprocess the original text data to construct a prescription list and a medicinal material factor matrix.
[0037] The pathological association graph construction module is used to construct a pathological association graph of the target patient through graph algorithms to characterize the correlation between the patient's pathological information and each prescription and medicinal factor type in the prescription list and medicinal factor matrix;
[0038] The prescription clustering module is used to train the self-attention model by using prescriptions containing Solomon's Seal as positive sample data and prescriptions not containing Solomon's Seal as negative sample data, and to determine the cluster center based on the pathological association graph and the herbal factor matrix.
[0039] The prescription recommendation module is used to select high-frequency prescriptions whose aggregation frequency exceeds a set threshold based on the cluster centers, and output the high-frequency prescriptions as the recommended prescriptions for Polygonatum odoratum prescriptions.
[0040] A third aspect of the present invention discloses a terminal, including a processor and a storage medium;
[0041] The storage medium is used to store instructions;
[0042] The processor is configured to operate according to the instructions to perform the steps of the method described in the first aspect.
[0043] A fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.
[0044] The beneficial effects of the present invention are as follows: Compared with the prior art, the present invention has the following advantages:
[0045] (1) This invention obtains ancient books and clinical prescriptions, and preprocesses the ancient books and clinical prescriptions to construct a prescription list and medicinal material factor matrix for the ancient books and clinical prescriptions. Then, it constructs a pathological association graph of the target patient through graph algorithm to characterize the correlation between the patient's pathological information and each prescription and medicinal material factor type in the prescription list and medicinal material factor matrix. This allows the target patient to be connected to each prescription and drug type through the correlation, laying the foundation for the subsequent targeted recommendation of Polygonatum odoratum prescription.
[0046] (2) This invention trains a self-attention model using prescriptions containing Polygonatum odoratum as positive sample data and prescriptions without Polygonatum odoratum as negative sample data. Cluster centers are determined based on the pathological association graph and the herbal factor matrix. High-frequency prescriptions with aggregation frequencies exceeding a set threshold are then selected based on these cluster centers, and the high-frequency prescriptions are output as the recommended medication results for Polygonatum odoratum prescriptions. This achieves clustering of high-frequency Polygonatum odoratum prescriptions targeting the pathological information of the target patient. The self-attention model trained with positive and negative sample data improves the accuracy and intelligence of Polygonatum odoratum prescription recommendations. Furthermore, dynamic optimization of the high-frequency prescription set is achieved through three steps: initial center selection, node attribution determination, and adjustment of the high-frequency prescription set. This step not only improves the stability and accuracy of the recommendation results, avoiding misclassification and boundary ambiguity, but also enhances the interpretability and controllability of the recommendations and provides adaptive capabilities to data changes in practical applications. The final output high-frequency prescription set better represents commonly used clinical prescriptions, providing a scientific, stable, and traceable basis for recommending Polygonatum odoratum prescriptions. Attached Figure Description
[0047] Figure 1 This is a flowchart illustrating the method for recommending prescriptions based on ancient texts using Polygonatum odoratum, as provided by this invention. Figure 2 This is a schematic diagram of an ancient book provided by the present invention; Figure 3 This is a schematic diagram of the five-element radar information of traditional Chinese medicine provided by the present invention; Figure 4 This is a dendrogram of high-frequency drug clustering analysis of the Polygonatum odoratum formula provided by the present invention; Figure 5 This is a schematic diagram of the structure of the Polygonatum odoratum prescription recommendation system based on ancient literature provided by the present invention. Detailed Implementation
[0048] The present application will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention, and should not be construed as limiting the scope of protection of the present application.
[0049] Polygonatum odoratum is a traditional Chinese medicine with a long history. In the *Shennong Bencao Jing* (Shennong's Classic of Materia Medica), it was praised as a "superior" herb. Polygonatum odoratum has the effects of nourishing yin and clearing heat, benefiting the lungs and moistening dryness. Modern pharmacological studies have shown that it has pharmacological effects such as lowering blood sugar, anti-tumor, beauty and anti-aging, anti-fatigue, anti-inflammatory, and antibacterial properties. It is often used to treat kidney and spleen deficiency, inflammatory bacteria, and cardiovascular diseases. Polygonatum odoratum has wide applications in traditional Chinese medicine, and its multi-dimensional medicinal value has formed a relatively complete modern research system.
[0050] Source of Ancient Texts: Based on *Bianzheng Lu* (Record of Differential Diagnosis), published by China Traditional Chinese Medicine Press in 2020, prescriptions containing Polygonatum odoratum were extracted from the entire text. One person strictly screened the prescriptions according to the inclusion and exclusion criteria, while others reviewed them. Inclusion Criteria: Prescriptions containing Polygonatum odoratum were clearly recorded in *Bianzheng Lu*; the prescription information was complete and included accurate descriptions of the medicinal materials. Exclusion Criteria: ① Single-herb prescriptions; ② Prescriptions containing duplicate or unmodified herbs. Figure 2 As shown, the sources of ancient books include, but are not limited to: Shennong's Classic of Materia Medica, Poisonous Herbs, and Essentials of Medicinal Properties, etc.
[0051] Clinical prescription sources: Data on clinical prescriptions related to Polygonatum odoratum from January 1, 2005 to May 31, 2025, were integrated from the core collection databases of CNKI, Wanfang, VIP, and Web of Science (WOS). Three examples of Polygonatum odoratum prescriptions are given below.
[0052] Patient A, age 48; Clinical symptoms: fatigue, lethargy, dry mouth, and excessive thirst for the past month; blood glucose level was 11.1 mmol / L at a hospital. Currently experiencing thirst, dry throat, and general weakness. Tongue tip is red with a thin, dry coating, and pulse is wiry. Diagnosis: Diabetes mellitus. Syndrome differentiation: Qi and Yin deficiency. Treatment principle: Tonify Qi and nourish Yin. Prescription: Astragalus membranaceus 30g, Ophiopogon japonicus 15g, Codonopsis pilosula 15g, Polygonatum odoratum 20g, Dioscorea opposita 20g, pollen 15g, Cuscuta chinensis 15g, Anemarrhena asphodeloides 15g, Scrophularia ningpoensis 15g, Pueraria lobata 15g, Schisandra chinensis 10g, stir-fried chicken gizzard lining 10g. After taking the above prescription for 28 doses, blood glucose was controlled below 8 mmol / L. The patient was instructed to continue controlling their diet and have regular checkups.
[0053] Patient B, age 55; Clinical symptoms: Dizziness and dry throat 3 months ago, blood glucose level was 13.6 mmol / L. Dry throat was relieved after taking metformin enteric-coated tablets. Currently, weight has decreased by 10 catties, with no obvious symptoms, little urination, no thirst, slight dizziness, red tongue with little coating, and wiry pulse. Diagnosis: Diabetes mellitus. Syndrome differentiation: Qi and Yin deficiency. Treatment principle: Tonify Qi and nourish Yin. Prescription: Polygonatum odoratum 20g, raw yam 20g, Astragalus membranaceus 30g, Pueraria lobata 15g, pollen 15g, Anemarrhena asphodeloides 15g, Schisandra chinensis 10g, stir-fried chicken gizzard lining 10g, Scrophularia ningpoensis 15g, Rehmannia glutinosa 15g. After taking the above prescription for 21 doses, blood glucose was controlled at around 7.5 mmol / L, dizziness symptoms were significantly relieved, and tongue and pulse appearances improved. The patient was instructed to continue dietary control, appropriate exercise, and regular monitoring of blood glucose levels.
[0054] Patient C, age 29; Clinical symptoms: Cough lingering after a cold six months ago. Currently experiencing paroxysmal cough following a sore throat, sometimes accompanied by nausea and vomiting. Occasional stomach pain. Bowel movements and urination are normal. Tongue is red with a glossy coating, and pulse is thready and rapid. Diagnosis: Cough. Syndrome differentiation: Lung and stomach yin deficiency. Treatment principle: Nourish yin and moisten dryness. Prescription: Polygonatum odoratum 15g, Cynanchum paniculatum 10g, Citrus reticulata peel 10g, Platycodon grandiflorus 10g, Aster tataricus 10g, Stemona japonica 10g, Schizonepeta tenuifolia 10g, Atractylodes macrocephala 10g, Dioscorea opposita 15g, Glycyrrhiza uralensis 10g. After taking the above prescription for 5 doses, the cough was relieved.
[0055] Clinical case studies reveal that Polygonatum odoratum is frequently used for syndromes such as deficiency of both Qi and Yin, or deficiency of Yin in the lungs and stomach. When combined with Astragalus membranaceus, Dioscorea opposita, Anemarrhena asphodeloides, and Schisandra chinensis, it embodies the principles of tonifying Qi and nourishing Yin, and moistening dryness. In cases of early-stage diabetes mellitus, Polygonatum odoratum formulas can gradually improve symptoms such as excessive thirst, fatigue, and dry throat over several weeks to months of treatment, demonstrating a stabilizing effect on blood sugar control. In Yin-deficiency diseases such as chronic cough, it can also achieve clinical remission by nourishing the Yin of the lungs and stomach and relieving dryness and heat.
[0056] It should be noted that the mechanism of action of the Polygonatum odoratum formula is long-term and potential, tending to improve the internal environment, regulate fluid metabolism and immune function, thereby achieving a holistic intervention for chronic wasting diseases. Its efficacy is not a significant elimination of symptoms in the short term, but rather a process of long-term conditioning and gradual improvement of the body's condition.
[0057] Therefore, the purpose of this study is not simply to verify the clinical efficacy of the Polygonatum odoratum formula, but to establish a technical system for formula screening and evaluation based on the compatibility rules and complementary properties of the Polygonatum odoratum formula. The aim is to screen out the most valuable candidate formulas from a large number of ancient books and commonly used clinical formulas, so as to provide a scientific basis for subsequent pharmacological experiments and evidence-based medicine research.
[0058] like Figure 1 As shown, in one embodiment, a method for recommending the use of Polygonatum odoratum formulas based on ancient texts includes the following steps:
[0059] Step S110: Obtain the original text data corresponding to the ancient books and clinical prescriptions, and preprocess the original text data to construct a prescription list and a medicinal material factor matrix.
[0060] In some embodiments, the method for recommending Polygonatum odoratum prescriptions based on ancient literature provided by the present invention includes the following steps in step S110:
[0061] Step S111: Obtain the patient's chief complaint and clinical symptoms, constitution diagnosis results, TCM four diagnostic scale scores, and modern medical indicators as prescription pathology information. Combine the medicinal material components corresponding to the prescription pathology information to construct a prescription list.
[0062] Step S112: Calculate the multiple medicinal factors contained in the medicinal components and the content ratio of each medicinal factor from the prescription list, and construct a medicinal factor matrix based on the multiple medicinal factors and the content ratio of each medicinal factor.
[0063] In a specific embodiment, the present invention provides a method for recommending the use of Polygonatum odoratum formulas based on ancient literature, including steps 1 to 5:
[0064] Step 1: Based on ancient books and clinical prescriptions, construct a prescription list and a medicinal material factor matrix.
[0065] Specifically, firstly, the constructed prescription list is represented as: {P1, P2, ..., P...} i ,…,P n}
[0066] Among them, P i Let i represent the i-th prescription, and n be the number of prescriptions.
[0067] In this embodiment, each prescription carries its corresponding pathological information, including: chief complaint and clinical symptoms (such as cough frequency and fatigue level), TCM Five Qi Radar information, constitution differentiation results (such as Qi deficiency, damp-heat, Yin deficiency, etc.), TCM four diagnostic scale scores (tongue quality and tongue coating thickness scores; pulse tightness and rate), and modern medical indicators (such as serum albumin and C-reactive protein levels). In addition, the prescription also contains medicinal components such as Ophiopogon japonicus, Paeonia lactiflora, Poria cocos, Paeonia suffruticosa, Dioscorea opposita, and Atractylodes macrocephala.
[0068] For example, in Figure 3In this diagram, A1, A2, A3, A4, and A5 correspond to the five properties of cold, cool, hot, warm, and neutral, respectively. The five-dimensional space formed by these five points, when expanded into a radar chart, shows the solid-line area of its circumscribed polygon, which describes the comprehensive distribution of a specific Chinese herbal medicine in terms of its five properties. In other words, the shape and area of this area can intuitively reflect the strength of the herb's properties in terms of the five properties. For example, if the value of "cold" is large, the radar chart will extend further in the A1 direction, resulting in a higher proportion of the solid-line area in the cold direction. The value of each dimension (cold, cool, hot, warm, neutral) can be abstracted as vector coordinates. Assuming they are denoted as Q1, Q2, Q3, Q4, and Q5 respectively, the five properties of the herb can be represented as a vector group [Q1, Q2, Q3, Q4, Q5], representing the quantified values of cold, cool, hot, warm, and neutral, respectively.
[0069] Next, all medicinal factors are statistically analyzed from the prescription list, for example: for P i Its specific components (i.e., medicinal factors) are described as {p i1 ,p i2 ,…,p ij ,…,p im}. Where m represents the total number of all medicinal factors, p ij P represents i The content ratio of the j-th medicinal material factor.
[0070] It should be noted that p ij The value of P can be 0, indicating that the prescription P i The material does not contain the j-th component; the medicinal material factor matrix can be described as {p nm} indicates that its length is n and its height is m.
[0071] Step S120: Construct a pathological association graph of the target patient using a graph algorithm to characterize the correlation between the patient's pathological information and each prescription and herbal factor type in the prescription list and herbal factor matrix.
[0072] In some embodiments, the method for recommending Polygonatum odoratum prescriptions based on ancient literature provided by the present invention includes the following steps in step S120:
[0073] Step S121: The patient's pathological information is segmented and part-of-speech tagged to obtain multiple strings. A pre-trained language model is then called to map the multiple strings into corresponding multiple vectors, and the cosine similarity between different vectors is calculated as the correlation between different vectors.
[0074] Step S122: Construct different tuples based on multiple strings corresponding to patient pathology information and prescription pathology information, and compare the values in different tuples to obtain the correlation between prescription pathology information and patient pathology information.
[0075] In some embodiments, the method for recommending Polygonatum odoratum prescriptions based on ancient literature provided by the present invention has multiple nodes in the pathological correlation diagram. Different nodes are used to characterize the types of different medicinal material factors and different bonds in the tuple. Step S120 further includes the following steps:
[0076] Step S123: Assign a first weight coefficient to the edge of the node corresponding to each prescription in the prescription list according to the degree of relevance, and set a second weight coefficient according to the frequency of each prescription being cited from ancient books.
[0077] Step S124: Weight the first weight coefficient and the second weight coefficient to construct a weight matrix corresponding to the prescription list according to the weighted weight coefficients.
[0078] In some embodiments, the method for recommending Polygonatum odoratum prescriptions based on ancient literature provided by the present invention further includes the following steps:
[0079] Step S210: Obtain the string vector corresponding to any type of node in the pathological association diagram, and calculate the coupling degree between different types of nodes based on the string vector. The string vector is obtained by concatenating multiple word segmentation vectors of the same type.
[0080] Step S220: Normalize the coupling degree and call the nonlinear activation function to perform feature mapping on the nodes in the pathological association graph based on the normalized coupling degree and the preset attention vector to obtain the mapped feature vector.
[0081] In a specific embodiment, the present invention provides a method for recommending prescriptions of Polygonatum odoratum based on ancient literature, step 2: constructing a pathological association diagram.
[0082] Specifically, through word segmentation and part-of-speech tagging, a pre-trained language model (such as BERT or Word2Vec) is used to map each segmented string into a vector x. i The correlation (e.g., cosine similarity) between any two vectors (derived from the corresponding pathological information of the prescription and the target patient, respectively) is continuously calculated. The values in the tuples are compared sequentially to obtain the correlation between the pathological information of each prescription and the pathological information of the target patient. The correlation R is then calculated. ik This represents the correlation between the k-th value of the i-th prescription, where k = 1, 2, ..., K, and K is the number of keys, ultimately achieving the construction of the pathological correlation graph.
[0083] It should be noted that pathological information is actually a tuple composed of multiple strings, and the tuple is usually composed of key-value pairs. For example, the key can be a clinical symptom, then the value can be cough with phlegm or chest tightness and shortness of breath; the key can be the result of constitution differentiation, then the value can be qi deficiency, damp heat or yin deficiency.
[0084] In this embodiment, the type of node in the pathological association graph is the type of medicinal material factor and all the keys in the tuple. Therefore, any node can be a certain medicinal material factor, a certain clinical symptom, or a certain constitution diagnosis result, etc.
[0085] Next, based on each prescription in the prescription list, weights are assigned to the edges of the nodes. For example, if a prescription involves components a1 and a2; clinical symptoms b1; and constitution diagnosis results c1, then the weight w between nodes a1 and b1 is... ij The prescription's weighting coefficient should be added. Here, i and j represent the node numbers a1 and b1, respectively. From now on, we will use simplified representations such as node i and node j. The prescription's weighting coefficient indicates its popularity, representing the number of times it has been cited in ancient texts.
[0086] In constructing the weight matrix, the first step is to count the number of times each prescription is cited in ancient texts or its frequency of use in modern literature, and then assign prescription weights according to their frequency, with higher frequencies resulting in higher weights. Next, all key-value pairs in the pathological association graph are traversed, and the prescription weights are multiplied by the previously assigned weights. Finally, the weights resulting from multiplying all key-value pairs are weighted to complete the construction of the weight matrix.
[0087] In this embodiment, the string vector expression corresponding to node j of type k is:
[0088]
[0089] In the formula, the symbol "|" represents the vector concatenation operation, S k The term represents the number of word segments of the k-th type, and is a pre-set empirical constant. The significance of concatenation is to make each vector x... i The lengths are consistent to ensure alignment and facilitate subsequent calculation of coupling.
[0090] When calculating the coupling degree between nodes of different types k1 and k2, it is necessary to discuss different cases:
[0091] (1) If k1 and k2 both represent bonds, the coupling degree C between node i and node j is... ij =w ij .
[0092] (2) If k1 or k2 represents a component, the coupling degree between node i (representing a component) and node j (representing a bond) is:
[0093] C ij =cosine_sim(γ i ,γ j )
[0094] In the formula, γ i =[τ i1 ,τ i2 ,…,τ im ,…,τ iM ], M is the number of cluster centers, τ im γ represents the proportion of node i in the m-th cluster center. j The definition is similar.
[0095] In this embodiment, all of the above coupling degrees C ij It needs to be normalized to C′ ij =εC ij That is, for any i, j, the following holds:
[0096]
[0097] In the formula, ε is the normalization constant, and k i Let i represent the type of node i. Therefore, the above formula represents the summation of all nodes of that type.
[0098] In this embodiment, the feature mapping V of the k-th type of node k As shown in the following formula:
[0099]
[0100]
[0101] In the formula, C ij J represents the coupling degree between node j and node i. k J i Let j represent the number of nodes of type k and type i, respectively, where j = 1, 2, ..., J k ;ρ k is the preset attention vector for the k-th type, is the preset parameter for the graph algorithm; σ is the non-linear activation function.
[0102] In step S130, prescriptions containing Solomon's Seal are used as positive sample data, and prescriptions without Solomon's Seal are used as negative sample data to train the self-attention model, and cluster centers are determined based on the pathological association graph and the herbal factor matrix.
[0103] In some embodiments, the method for recommending Polygonatum odoratum prescriptions based on ancient literature provided by the present invention includes the following steps in step S130:
[0104] Step S131: The self-attention model is invoked to aggregate the mapped feature vectors based on a preset weight matrix to obtain an aggregated embedding matrix.
[0105] Step S132: The aggregated embedding matrix is trained based on positive and negative sample data, and a multilayer perceptron is called to predict the probability of each component in the Polygonatum odoratum formula corresponding to the patient's pathological information, so as to obtain the prediction result.
[0106] In some embodiments, the method for recommending Polygonatum odoratum prescriptions based on ancient literature provided by the present invention further includes the following steps in step S130:
[0107] Step S133: Based on the pathological association graph and the medicinal material matrix factor, each prescription is taken as a corresponding node, and the Euclidean distance between different nodes is calculated to determine other nodes whose Euclidean distance does not exceed the first threshold.
[0108] Step S134: Based on other nodes whose Euclidean distance to each node does not exceed the first threshold, determine the frequency of the medicinal material factor corresponding to each node in the prescription list to construct a high-frequency index, and select multiple nodes whose high-frequency index is not lower than the second threshold.
[0109] Among them, the high frequency index is composed of the frequency of all medicinal material factors corresponding to each node appearing in the prescription list.
[0110] In a specific embodiment, the present invention provides a method for recommending prescriptions based on ancient literature on Polygonatum odoratum, step 3, training of a self-attention model.
[0111] Specifically, considering that different types of variables have different embedding representations and thus different impacts on the final prediction results, in this example, we can aggregate all feature maps based on a self-attention model to obtain an aggregated embedding matrix U, as shown in the following equation:
[0112] Q k =W Q V k
[0113] E k =W E V k
[0114] A k =W A V k
[0115]
[0116] In the formula, W Q W E W A This is a preset weight matrix, which serves as the preset parameters for the graph algorithm, and its initial values are obtained through randomization; T represents the transpose of the matrix; Qk E k A k These represent the query vector, key vector, and value vector, respectively.
[0117] In this embodiment, the above-mentioned aggregated embedding matrix U is trained based on positive sample data and negative sample data to determine its preset parameters. The positive sample data consists of prescriptions containing Polygonatum odoratum in their components; the negative sample data consists of prescriptions that are close to the positive sample data but do not contain Polygonatum odoratum. Here, "close to the positive sample data" means that its components are similar to those of the prescriptions in the above prescription list.
[0118] After training, the multilayer perceptron (MLP) is used to predict the outcome Y of the target patient, as shown in the following formula:
[0119] Y = softmax(MLP(U))
[0120] In the formula, Y represents whether the component contains Solomon's seal, and Y is a binary vector, represented as vector [q1,q2,…,q]. i ,…,q n ], and satisfy q1,q2,…,q i ,…,q n =1, q1,q2,…,q i ,…,q n These represent the probabilities of each component.
[0121] The final result should be truncated, that is: if a certain q i If the value is less than a preset threshold (which is selected using an ROC curve to balance sensitivity and specificity), let q... i Set it directly to 0, then set the remaining non-zero q to 0. i Re-normalize to obtain the final Y′.
[0122] Step 4: Combine the correlation degree with the medicinal material factor matrix to determine the cluster center.
[0123] Specifically, first, treat each prescription as a node and calculate the Euclidean distance between nodes. For example, the Euclidean distance between node i and node j is |R|. i -R j |, with R i For example, R i =[R i1 ,…,R ik ,…,R iK ].
[0124] Then, select the minimum N Euclidean distances for each node, where N is chosen as the value of N. After removing duplicates from the N Euclidean distances of all nodes, sort them in ascending order, and initially select the Euclidean distance of the xth percentile as the first threshold.
[0125] It should be noted that the choice of the first threshold here needs to be based on the actual situation, and should not be set to 50%. Typically, the number of nodes marked as high-frequency prescriptions is around 5%, making the selection of the first threshold optimal. Therefore, if the number of nodes marked as high-frequency prescriptions is greater than 5%, the first threshold can be adjusted to the top 60% of the ranking; conversely, if the number of nodes marked as high-frequency prescriptions is less than 5%, the first threshold can be adjusted to the top 40% of the ranking.
[0126] In determining cluster centers, the frequency vector of each node is first determined: [f i1 ,f i2 ,…,f ij ,…,f im ], f ij As shown in the following formula:
[0127]
[0128] In the formula, f j This represents the frequency of the j-th medicinal material factor in the prescription list. Based on the frequency vector, the high-frequency index F can be obtained. i =|[f i1 ,f i2 ,…,f ij ,…,f im Then, the high-frequency indices of all nodes are sorted, and the top T nodes are selected and marked as high-frequency prescriptions.
[0129] Step S140: Select high-frequency prescriptions whose aggregation frequency exceeds a set threshold based on the cluster center, and output the high-frequency prescriptions as the recommended medication results for the Polygonatum odoratum formula.
[0130] In some embodiments, the method for recommending Polygonatum odoratum prescriptions based on ancient literature provided by the present invention includes the following steps in step S140:
[0131] Step S141: Construct a high-frequency prescription set based on multiple nodes with a high-frequency index not lower than the second threshold, and calculate the distance between other nodes and each node in the high-frequency prescription set to classify and determine other nodes.
[0132] Step S142: Based on the classification results of other nodes, the proportion of unclassified nodes and duplicated nodes is calculated, and the unclassified nodes and duplicated nodes are reclassified according to the proportion based on the preset prescription adjustment rules to obtain the adjusted high-frequency prescription set.
[0133] In a specific embodiment, the present invention provides a method for recommending prescriptions based on ancient literature, step 5: clustering update and adjustment of high-frequency prescription set.
[0134] Includes the following sub-steps:
[0135] Sub-step 5.1, initial center selection.
[0136] Specifically, all nodes are arranged from high to low according to their high frequency index, and the top m nodes (empirical value m≈4) are taken as the initial high frequency prescription (central node) set.
[0137] Sub-step 5.2: Node attribution determination and aggregation frequency update.
[0138] Specifically, for each node in the pathological association graph, the distance from each node to all high-frequency prescriptions is calculated, and the center corresponding to the minimum distance and the second minimum distance is found: if the minimum distance is greater than the "aggregation distance", the node is classified as "unclassified"; if the second minimum distance is less than or equal to the "aggregation distance", the node is classified as "repeatedly classified"; otherwise, the node is classified as "classified" and the "aggregation frequency" of its corresponding minimum distance center is incremented by 1.
[0139] The "aggregation distance" can be set to m times the first threshold; before each execution of sub-step 5.2, all aggregation frequencies should be set to 0. The lower the aggregation frequency, the more stable the binding between the center and other nodes.
[0140] Sub-step 5.3, adjustment of the high-frequency prescription set.
[0141] Specifically, the proportion of all "unclassified" and "duplicate-classified" nodes is calculated. If the sum of these proportions exceeds a preset threshold (e.g., 25%), the high-frequency prescription (central node) set needs to be dynamically updated until the proportion drops below the threshold. The dynamic update strategy is as follows:
[0142] (1) Adding a center strategy: Select the first node with the lowest current aggregation frequency from the non-center nodes in high frequency index order and add it to the center set. If the total proportion of "unclassified + duplicated classification" decreases after adding, you can continue to try adding.
[0143] (2) Elimination strategy: Remove the node with the highest aggregation frequency from the existing centers. If the total proportion of "unclassified + duplicated classification" decreases after elimination compared to the previous time, elimination can continue.
[0144] In this embodiment, the aggregation frequency of the removed center is retained and used for comparison with the frequencies of other centers in subsequent rounds. After adjustment, the process returns to sub-step 5.2 for re-determination until the aggregation frequency threshold is met. The aggregation frequency threshold is generally set to 25%. Each cluster center and the set of nodes bound by the shortest distance correspond to a sub-cluster. If a cluster center is removed, its aggregation frequency is retained and compared with the aggregation frequencies of other cluster centers in subsequent rounds.
[0145] It's easy to understand that the beneficial effect of step 5 lies in the dynamic optimization of the high-frequency prescription set through three stages: initial center selection, node affiliation determination, and adjustment of the high-frequency prescription set. This step not only improves the stability and accuracy of the recommendation results, avoiding misclassification and boundary ambiguity, but also enhances the interpretability and controllability of the recommendations, and possesses adaptive capabilities to data changes in practical applications. The final output high-frequency prescription set can better represent commonly used clinical prescriptions, providing a scientific, stable, and traceable basis for medication recommendations based on the Polygonatum odoratum formula.
[0146] Figure 4 The diagram shows a dendrogram of the high-frequency drug clustering analysis of the Polygonatum odoratum prescription. The vertical axis P1~P11 refer to: human body, fritillaria cirrhosa, prepared rehmannia root, Polygonatum odoratum, angelica sinensis, licorice, cornus officinalis, yam, peony bark, chrysanthemum, and schisandra chinensis, respectively; the horizontal axis represents the distance between high-frequency prescriptions.
[0147] The following describes the Solomon's Seal Formula Recommendation System based on ancient texts provided by this invention. The Solomon's Seal Formula Recommendation System described below can be referred to in correspondence with the Solomon's Seal Formula Recommendation Method described above.
[0148] like Figure 5 As shown in one embodiment, a prescription recommendation system based on ancient literature for Polygonatum odoratum includes a data preprocessing module, a pathological association graph construction module, a prescription clustering module, and a prescription recommendation module.
[0149] The data preprocessing module is used to obtain the original text data corresponding to ancient books and clinical prescriptions, and to preprocess the original text data to construct a prescription list and a medicinal material factor matrix.
[0150] The pathology association graph construction module is used to construct a pathology association graph of the target patient using graph algorithms, so as to characterize the correlation between the patient's pathology information and each prescription and medicinal factor type in the prescription list and medicinal factor matrix.
[0151] The prescription clustering module is used to train the self-attention model by using prescriptions containing Solomon's Seal as positive sample data and prescriptions not containing Solomon's Seal as negative sample data, and to determine the cluster centers based on the pathological association graph and the herbal factor matrix.
[0152] The prescription recommendation module is used to select high-frequency prescriptions whose aggregation frequency exceeds a set threshold based on the cluster center, and output the high-frequency prescriptions as the recommended prescriptions for Polygonatum odoratum.
[0153] The applicant of this invention has provided a detailed description of the embodiments of the invention in conjunction with the accompanying drawings. However, those skilled in the art should understand that the above embodiments are merely preferred embodiments of the invention. The detailed description is only intended to help readers better understand the spirit of the invention and is not intended to limit the scope of protection of the invention. On the contrary, any improvements or modifications made based on the inventive spirit of the invention should fall within the scope of protection of the invention.
Claims
1. A method for recommending a prescription based on a Polysphonia group formula in ancient literature, characterized in that, The method comprises: acquiring original text data corresponding to ancient books and clinical prescriptions, and preprocessing the original text data to construct a prescription list and a medicinal material factor matrix; constructing a pathological association graph of a target patient through a graph algorithm to represent the correlation between patient pathological information and each prescription and medicinal material factor type in the prescription list and the medicinal material factor matrix; training a self-attention model by taking prescriptions containing polygonatum as positive sample data and prescriptions not containing polygonatum as negative sample data, and determining a clustering center according to the pathological association graph and the medicinal material factor matrix; selecting high-frequency prescriptions with an aggregation frequency exceeding a set threshold according to the clustering center, and outputting the high-frequency prescriptions as polygonatum prescription recommendation results.
2. The method for recommending the use of Polygonatum odoratum in prescriptions based on ancient texts according to claim 1, characterized in that, The acquisition of the original text data corresponding to the ancient books and the clinical prescriptions, and the preprocessing of the original text data to construct the prescription list and the medicinal material factor matrix comprises: acquiring patient complaints, clinical symptoms, constitution dialectic results, traditional Chinese medicine four diagnostic scale scores and modern medical indicators as prescription pathological information, and constructing a prescription list in combination with medicinal material components corresponding to the prescription pathological information; counting a plurality of medicinal material factors contained in the medicinal material components and the content proportion of each medicinal material factor from the prescription list, and constructing the medicinal material factor matrix based on the plurality of medicinal material factors and the content proportion of each medicinal material factor.
3. The method for recommending the use of Polygonatum odoratum in prescriptions based on ancient texts according to claim 2, characterized in that, The construction of the pathological association graph of the target patient through the graph algorithm to represent the correlation between the patient pathological information and each prescription and medicinal material factor type in the prescription list and the medicinal material factor matrix comprises: performing word segmentation processing and part-of-speech tagging on the patient pathological information to obtain a plurality of strings, and calling a pre-trained language model to map the plurality of strings to corresponding vectors to calculate the cosine similarity between different vectors as the correlation between different vectors; constructing different tuples based on the plurality of strings corresponding to the patient pathological information and the prescription pathological information, and comparing the values in different tuples to obtain the correlation between the prescription pathological information and the patient pathological information. 4.The method of claim 3, wherein the method is characterized by, The pathological association graph has a plurality of nodes, and different nodes are respectively used to represent the types of different medicinal material factors and different keys in the tuples; The construction of the pathological association graph of the target patient through the graph algorithm to represent the correlation between the patient pathological information and each prescription and medicinal material factor type in the prescription list and the medicinal material factor matrix further comprises: assigning a corresponding first weight coefficient to the edge of the node corresponding to each prescription in the prescription list according to the size of the correlation, and setting a second weight coefficient according to the frequency of each prescription cited from the ancient books; weighting the first weight coefficient and the second weight coefficient to construct a weight matrix corresponding to the prescription list according to the weighted weight coefficients. 5.The method of claim 1, wherein the method is characterized by, The method further comprises: acquiring a string vector corresponding to any type of node in the pathological association graph, and calculating the coupling degree between different types of nodes based on the string vector, wherein the string vector is obtained by splicing a plurality of word segmentation vectors of the same type; The coupling degree is normalized, and a nonlinear activation function is called to perform feature mapping on the nodes in the pathological association graph based on the normalized coupling degree and the preset attention vector to obtain the mapped feature vector. 6.The method of claim 5, wherein the method is characterized by, The process involves training a self-attention model using prescriptions containing Polygonatum odoratum as positive sample data and prescriptions not containing Polygonatum odoratum as negative sample data, and determining cluster centers based on the pathological association graph and the herbal factor matrix, including: The self-attention model is invoked to aggregate the mapped feature vectors based on a preset weight matrix to obtain an aggregated embedding matrix; The aggregated embedding matrix is trained based on the positive and negative sample data, and a multilayer perceptron is invoked to predict the probability of each component in the Polygonatum odoratum formula corresponding to the patient's pathological information, thereby obtaining the prediction result.
7. The method according to claim 6, wherein the method is characterized by, The method of training a self-attention model using prescriptions containing Polygonatum odoratum as positive sample data and prescriptions not containing Polygonatum odoratum as negative sample data, and determining cluster centers based on the pathological association graph and the herbal factor matrix, further includes: Based on the pathological association graph and the medicinal material matrix factor, each prescription is taken as a corresponding node, and the Euclidean distance between different nodes is calculated to determine other nodes whose Euclidean distance does not exceed the first threshold. Based on other nodes whose Euclidean distance to each node does not exceed the first threshold, determine the frequency of the medicinal material factor corresponding to each node in the prescription list to construct a high-frequency index, and select multiple nodes whose high-frequency index is not lower than the second threshold. The high-frequency index is composed of the frequency of all medicinal factors corresponding to each node appearing in the prescription list. 8.The method of claim 7, wherein the method is characterized by, The step of selecting high-frequency prescriptions whose aggregation frequency exceeds a set threshold based on the cluster centers and outputting the high-frequency prescriptions as the recommended medication results for the Polygonatum odoratum formula includes: A high-frequency prescription set is constructed based on multiple nodes whose high-frequency index is not lower than the second threshold, and the distance between other nodes and each node in the high-frequency prescription set is calculated to classify and determine the other nodes. Based on the classification results of other nodes, the proportion of unclassified nodes and duplicated nodes is calculated, and the unclassified nodes and duplicated nodes are reclassified according to the proportion based on the preset prescription adjustment rules to obtain an adjusted high-frequency prescription set.
9. A terminal, comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the method according to any one of claims 1-8.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 1-8.
Citation Information
Patent Citations
Traditional Chinese medicine prescription recommendation method based on knowledge graph
CN116680412A
Traditional Chinese medicine knowledge recommendation system based on ancient book knowledge unit processing
CN116682526A
Intelligent recommendation method and system for traditional Chinese medicine prescription based on AI large model
CN118230893A
Intelligent prescription recommendation method and system for medicinal material shortage
CN120432075A