Search

CN-122025029-A - Chinese medicine prescription recommendation method integrating category information and LLM causal drive contrast learning and graph annotating meaning force

CN122025029ACN 122025029 ACN122025029 ACN 122025029ACN-122025029-A

Abstract

The invention provides a traditional Chinese medicine prescription recommendation method integrating category information and a large language model enhancement causal mechanism. Aiming at the problems that the existing model depends on statistical correlation, is difficult to filter pseudo-correlation, lacks of diagnosis and treatment and 'monarch, minister, assistant and guide' mechanism modeling, has insufficient semantic understanding and the like, the method constructs a different composition and isomorphic multi-view learning framework of symptoms and herbal medicines. On the heterogeneous graph level, the invention utilizes prescription data to synchronously classify symptoms and herbal medicines to form syndrome category representations, introduces symptom-herbal medicine causal information into multi-view contrast learning, and enhances the capability of heterogeneous graph node representations and herbal medicine recommendation. On the isomorphic graph level, the invention fuses symptoms with semantic information and category information of herbal medicines, introduces causal priors of the herbal medicines, learns isomorphic relations through graph attention network, enriches node characteristic expression, and improves the depicting ability of a model on traditional Chinese medicine knowledge such as 'theory-method-prescription-medicine' and 'monarch-minister-assistant-guide'. The invention can obviously improve the accuracy, stability and interpretability of the prescription recommendation of the traditional Chinese medicine, and has good clinical application value.

Inventors

  • HU HAILONG
  • ZHAO YIFAN
  • SUN ZAN
  • ZHANG HUI
  • Wu Lening
  • NIE CONG
  • XU XIANGWEI
  • JI WENHAO
  • JIN BIAO
  • HUANG HAOYU

Assignees

  • 湖州师范学院

Dates

Publication Date
20260512
Application Date
20260105

Claims (10)

  1. 1. The traditional Chinese medicine prescription recommendation method integrating category information and LLM causal drive contrast learning and graph annotating force is characterized by comprising the following steps: step 1, constructing a symptom-symptom isomorphic diagram, a symptom-herbal iso-composition and a herbal-herbal isomorphic diagram according to the collected traditional Chinese medicine prescription data; Step 2, collecting prescription numbers of each symptom and herb in the prescription data of the traditional Chinese medicine, classifying the symptom and herb by using spectral clustering, and realizing one-to-one relation between symptom and herb group by combining threshold values; step 3, collecting attribute semantic expressions of symptoms and traditional Chinese medicines, and converting the attribute semantic expressions into symptom and herbal node expressions through a large language model and ELU functions; step 4, using symptom-herbal medicine isomerism map and category information thereof as penalty items, obtaining symptom-herbal medicine causal map through Notears causal learning, using herbal medicine-herbal medicine isomorphic map and semantic similarity thereof as penalty items, and obtaining herbal medicine-herbal medicine causal map through Notears causal learning; Step 5, using the class expression integrated with the symptom and the herbal medicine as input, using the symptom-herbal medicine causal graph as a subgraph thereof, and updating the symptom and the herbal medicine node expression by contrast learning of symptom-herbal medicine heterogram; Step 6: the class expression and the semantic expression which are integrated with symptoms and herbal medicines are fused in a non-linear way, the symptom node expression is learned through attention force diagram convolution for the symptom-symptom isomorphic diagram, and the attention force diagram convolution learning is performed through the integration of the herbal medicine-herbal medicine causal diagram for the herbal medicine-herbal isomorphic diagram, so that the herbal node expression is obtained. And 7, fusing information from different graphs, and calculating the score of the herbal medicine for curing the given symptom set. The model was optimized by Adam optimizer using BCELoss, BPRLoss, infoNCELoss as a loss function.
  2. 2. The method for recommending Chinese medicine prescriptions by fusing category information with causal driving contrast learning and drawing attention of LLM according to claim 1, wherein the step 1 is to construct a plurality of drawing structures according to Chinese medicine prescription data, including symptom-symptom isomorphic drawing, symptom-herbal isomorphic drawing, herbal-herbal isomorphic drawing, specifically: each prescription contains a group of symptoms and a group of herbal medicines, and for the symptoms and the herbal medicines which are simultaneously present in the same prescription, the symptoms and the symptoms have the relations of complications, inducement and the like, the herbal medicines and the herbal medicines have the relations of compatibility principles and the like, and the symptoms and the herbal medicines have the healing relations. Such as prescriptions: wherein , Symptomatic-herbal heterographic edge . Symptom-herbal graph is defined as if there is an edge between two nodes 1, Otherwise 0. Similarly, through co-occurrence data of symptoms (herbs) in the prescription, a symptom-symptom isomorphic map and a herb-herb isomorphic map are constructed, and the node characteristic representation of the symptoms (herbs) is enriched. And Representing a filtering threshold.
  3. 3. The method for recommending Chinese medicine prescriptions by combining causal driving contrast learning and drawing meaning force of category information and LLM according to claim 1, wherein the step 2 is characterized in that the method comprises the steps of collecting each symptom in Chinese medicine prescription data and prescription number of the occurrence of herbal medicine, classifying the symptom and the herbal medicine by using spectral clustering, and realizing one-to-one relation between symptom type and medicine group by threshold combination, specifically comprises the following steps: node embedding representation is obtained by Node2Vec for symptom-herbal bipartite graph random walk, and final Node embedding is obtained by splicing symptom and herbal meridian tropism information , All nodes are classified by combining cosine similarity and spectral clustering [26], symptom classification is expressed as symptoms, herbal medicine classification is expressed as medicine groups, and classification merging is carried out through threshold filtering to achieve a one-to-one relation between symptoms and medicine groups, and the learning effect of an initial embedded lifting model of symptoms and herbal medicines is optimized according to category information, wherein the formula is as follows: Wherein A is a symptom-herb adjacency matrix, D is a degree matrix, and its elements are node degrees. And performing feature decomposition on the L to obtain feature vectors, taking the feature vectors corresponding to the first K minimum feature values, and performing K-Means clustering on the feature vectors to obtain a final clustering result.
  4. 4. The method for recommending Chinese medicine prescriptions by fusion of category information and causal drive contrast learning and drawing meaning force of LLM according to claim 1, wherein the step 3 is to collect attribute semantic expressions of symptoms and Chinese medicines, and convert the attribute semantic expressions into symptom and herbal node expressions through a large language model and an ELU function, specifically: transforming natural language descriptions of symptom and herbal attribute information into vector features using a BERT big language model, and dimension-reducing the vector features of symptom and herbal using an ELU activation function: Wherein the method comprises the steps of Representing a BERT text embedding model, converting a symptom (herb) text file into sentence embedding vectors, and mapping the sentence embedding vectors to dimension reduction matrices Multiplying, performing nonlinear transformation by ELU activation function, and mapping the initial sentence embedding dimension into embedding dimension required by model to obtain preprocessed symptom (herbal) embedding 。 For herbal embedding, the original representation is represented with contextual information of herbal neighbors Enhancement is performed. Calculating a similarity matrix for all herbal medicine embedments by using cosine similarity, selecting the first k most similar herbal medicines as neighbors, and obtaining enhanced herbal medicine embedments by using a herbal medicine enhancement model based on a graph attention mechanism according to neighbor information: Wherein the method comprises the steps of Is the embedding of the central herbal medicine, Embedding similar neighbor herbs for herb h by scoring function with attention And Obtain attention weight Finally, weighted averaging and nonlinear transformation are carried out Enhanced herbal embedding 。
  5. 5. The method for recommending a Chinese medicine prescription for fusing causal driving contrast learning and drawing meaning force of category information and LLM according to claim 1, wherein the step 4 is characterized in that the symptom-herbal medicine heterogeneous map is combined with the category information thereof as a penalty item, the symptom-herbal medicine causal map is obtained through Notears causal learning, the herbal medicine-herbal medicine isomorphic map is combined with the semantic similarity thereof as a penalty item, and the herbal medicine-herbal medicine causal map is obtained through Notears causal learning, specifically: The Notears algorithm is improved, category information between symptoms and herbal medicines and semantic similarity between the herbal medicines are used as structure prior information and are integrated into an objective function of the algorithm, the algorithm is used for weighting and punishing the weight of the learned causal graph, complex relations between the symptoms and the herbal medicines can be found, interference caused by data sparsity is relieved, and the interpretation of a recommendation model is improved. For symptom and herb priori information, the category information is introduced to construct a structural punishment matrix : Representing symptoms of A corresponding set of categories is provided for each of the plurality of categories, Representing herbal medicine A corresponding set of categories is provided for each of the plurality of categories, For penalty values between symptom i and herb j, the penalty value is at most 1 when there is no shared category. Structured symptom-herb punishment matrix Is embedded into the whole structure penalty matrix The following are provided: For the prior information of the herbal medicines, the constraint on the causal structure learning process is realized by converting the semantic similarity of the nodes of the herbal medicines into penalty coefficients. Wherein, the The semantic cosine similarity between herb i and herb j is a numerical value defined on interval 0,1, which is used to measure the similarity of two herbs in terms of attributes. Diagonal line element The prior fusion mechanism not only effectively reduces the generation of noise edges, but also guides the model to focus on a causal path with more medical rationality, thereby improving the structural quality and the field credibility of the causal graph. In the optimization process, the structural penalty term acts together with the data fitting term and the loop-free constraint term to guide the learning of the weight matrix, and the statistical dependency relationship of prescription data is effectively reflected. Wherein, the For sparse control coefficients, the degree of influence of the penalty in the penalty is controlled, Is the penalty weight of the loop-free constraint term, ) Is a learned causal structure weight matrix, Is the intensity of the effect of herb j on symptom i, Is the intensity of the effect of herb j on herb i, For herbal or symptomatic one-hot encoding matrices of prescription data, a final causal matrix is obtained by fitting the encoding matrix to a causal structural weight matrix. The edge weight is a causal intensity value among the herbs and represents the direct causal influence degree of the source node on the target node. The larger the weight is, the more obvious causal dependency relation is represented when the corresponding nodes are used in a combined mode, and the zero weight indicates that no direct causal relation exists between the two nodes. Compared with the traditional unified sparse constraint, the structural regularization term enables the model to pay more attention to the causal paths of the structurally reasonable nodes, reduces the occurrence of unreliable edges, and improves the neighborhood consistency of the model.
  6. 6. The method for recommending a Chinese medicinal prescription for use in combination with causal driven contrast learning and graph annotating forces for LLM according to claim 1, wherein said step 5 comprises using a symptom-herbal causal graph as a subgraph thereof, and updating symptom and herbal node expressions by contrast learning the symptom-herbal iso-graph, specifically: In order to obtain more accurate symptom-traditional Chinese medicine compatibility, the symptom and herbal medicine category embedding is used, and on the basis of a graph enhancement mechanism proposed in SGL, symptom-herbal medicine causal priori knowledge is introduced to carry out disturbance treatment on an original graph by a side discarding strategy so as to cope with the difference of the dependence degree of different symptoms on various kinds of information. From symptom-herbal causal interaction edge set Screening out high causal effect symptom-herbal causal edge to discard, and obtaining discarded edge set , Then random sampling is used. Two independent damage subgraphs are constructed in this way: exploring local effective characteristics of the graph structure, constructing positive sample pairs by using subgraphs of the same node, and constructing negative sample pairs by using subgraphs of different nodes. For symptom-herb interaction graph, residual connection with learnable parameters is introduced on the basis of LightGCN, and final symptom and herb characterization is generated through neighborhood aggregation. The method utilizes a nonlinear propagation mode to learn symptoms and embedded representation of herbal medicines, and has certain learning capacity and self-adaptability while retaining structural information. Is the coefficient of the residual error that can be learned, Is an activation function, where ReLU function is used, symptoms In the first place The embedding of layers is expressed as , Representing symptoms of Is a set of herbal neighbors of a person, Then the number of neighbors is indicated, Representing herbal medicine Is a set of symptom neighbors of (a), Representing the number of neighbors that are present, Indicating that the herb is at the first After the layer is embedded and normalized, the characteristic contribution of different neighbor nodes is balanced, the stability of characteristic propagation is ensured, and the reasonable influence of each neighbor is maintained. By obtaining output embedding of the front L layer , , , Weighted averaging of the embedding of all layers (from layer 0 to layer L) results in a stable and efficient final characterization. Wherein the method comprises the steps of And Features of symptoms and herbs after multi-layer information fusion are respectively shown, and L is the number of polymerization layers. Interactive information of symptom s and herb h is obtained by inner product :
  7. 7. The method for recommending Chinese medicine prescriptions based on causal driving contrast learning and graph meaning force by combining category information and LLM according to claim 1, wherein the step 6 is characterized in that category expressions and semantic expressions which are combined with symptoms and herbs are non-linearly combined, symptom node expressions are learned by taking care of striving for convolution for symptom-symptom isomorphism patterns, and herb node expressions are obtained by taking care of striving for convolution learning by combining herb-herb causal patterns for herb-herb isomorphism patterns, specifically as follows: Feature learning of isomorphic diagrams is performed by means of attention seeking convolution. Since the symptoms are often represented as co-occurrence associations rather than explicit causal triggers, causal attention templates are not introduced to symptom nodes in this module. In contrast, the compatibility principle that a certain herb causes another herb to be used jointly is adopted among the herbs, so that the causal relationship among the herbs is the prior attention mechanism in the graph neural network and guides the attention direction in the neighbor information aggregation process. Non-linear fusion of the semantic embedment of the resulting symptoms and herbs with their corresponding class embedment: Wherein the method comprises the steps of As a function of the stitching function, Is a multi-layer perceptron. And then will be As input, the multi-headed representation is reshaped by linear mapping: Wherein the method comprises the steps of ( ) Is the number of nodes of the symptom (herb), In order to pay attention to the number of heads, For the output dimension of each head, by The function reshapes the two-dimensional vector into a three-dimensional vector. Each edge attention representation is then calculated, borrowed from "weighted activation" to construct the score term and normalized by softmax as an edge weight: To incorporate the attention weight of the causal information of the herb by side weight Side index construction sparse matrix And realizing neighbor information aggregation through graph convolution. Wherein the method comprises the steps of And finally obtaining node embedding fusing neighbor information for outputting the layer weight matrix. By introducing an attention force diagram convolution mechanism, primary and secondary symptoms are distinguished in a symptom diagram by using attention weights, causal priori knowledge is fused in a herbal medicine diagram, attention calculation is guided, directivity and compatibility relation among herbal medicines are simulated, and the medicine principle of 'monarch, minister, assistant and guide' of traditional Chinese medicine is embodied. The module can enhance the expression capability of node representation, improve the interpretability and the professionality of the model, and realize the effective fusion of traditional Chinese medicine knowledge and the graph neural network.
  8. 8. The method for recommending Chinese medicine prescriptions by combining category information with causal driving contrast learning and drawing attention of LLM according to claim 1, wherein the step 7 is to combine information from different drawings and calculate the score of the set of symptoms for which the herb can cure, specifically as follows: embedding obtained by contrast learning module And embedding obtained by isomorphic attention network Summing the two types of information respectively to obtain complete embedded information capable of comprehensively reflecting symptoms and herbal characteristics: One-heat coding matrix for prescriptions and symptom sets Interacting with the symptom embedding matrix to obtain a prescription embedding with symptom information fused, and multiplying the prescription embedding with the herbal matrix to obtain the recommended probability of a final prescription to each herbal medicine: The top K herbs with predictive probabilities were used as recommended results for the corresponding symptom sets. Using BCELoss, BPRLoss, infoNCELoss as a loss function, the model was optimized by Adam optimizer, as follows: To better capture symptom-to-herb preference information, a bayesian personalized ranking loss function (BPR) was introduced. BPR learns symptom preferences by optimizing a pairwise ordering objective to promote model predictive scoring of symptom interacted herbs over non-interacted herbs: wherein p represents a positive sample herb of symptom s, n represents a negative sample herb, Representing the pair of training data, And Representing the preference scores of symptom s for positive sample herb p and negative sample herb n respectively, Representing sigmoid activation function, selecting BPR loss # -, and ) As a primary supervisory loss function. For contrast learning, the optimization objective is to expand the distance between negative pairs of samples (increase the alien node difference) by reducing the distance between positive pairs of samples (decrease the alien node difference). Using InfoNCE loss functions as optimization targets: wherein for the original graph Edge discarding is carried out to generate two sub-graphs And , A sub-graph representing the other nodes, Is a temperature coefficient. Similarly, a comparative learning loss function for herbal categories can be obtained: The final contrast learning loss function is expressed as: BCELoss is used as a loss function in the training process Comparing it with a loss function in contrast learning Fusion, forming the final loss function: And updating model parameters by using an Adam optimizer so as to improve the accuracy and stability of recommendation.
  9. 9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements a method of herbal prescription recommendation incorporating causal drive contrast learning and attention to LLM with category information according to any one of claims 1 to 7 when executing the program.
  10. 10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements a method of herbal prescription recommendation that fuses causal driven contrast learning and graph-annotating forces of category information with LLM according to any one of claims 1 to 7.

Description

Chinese medicine prescription recommendation method integrating category information and LLM causal drive contrast learning and graph annotating meaning force Technical Field The invention relates to the technical field of deep learning, in particular to a traditional Chinese medicine prescription recommendation method for causal drive contrast learning and drawing meaning force of fusion category information and LLM. Background The theory and practice of traditional Chinese medicine as a traditional medical system with long history and deep culture foundation form a complete diagnosis and treatment system in thousands of years of development, and the traditional Chinese medicine system covers various intervention means such as traditional Chinese medicine, acupuncture and moxibustion, massage and the like. The clinical diagnosis and treatment process with Chinese medicine as the core is realized in the form of "treating-method-prescription-medicine" system mode, and the medicine compatibility is completed finally by first distinguishing the pathogenesis and the symptoms based on the symptoms and then establishing corresponding treatment methods. The compatibility of the traditional Chinese medicine prescription follows the classical principle of ' monarch, minister, assistant and guide ', namely monarch, minister, assistant and guide ' directly hit the main symptoms, the minister, assistant and guide and main effects are synergistic, toxicity is reduced, and the guiding drugs play roles in harmonizing or guiding channels, so that an overall synergistic treatment scheme is formed. Along with the rapid development of modern technology and the continuous penetration of multidisciplinary cross fusion, the modernization of traditional Chinese medicine has become the necessary direction of disciplinary development. Leading edge technologies such as artificial intelligence, big data analysis and the like are gradually integrated into traditional Chinese medicine research and application, and a new tool is provided for prescription analysis and optimization. However, due to the profusion of traditional Chinese medicine and the diversity of clinical experience, certain limitations and challenges still exist in the traditional Chinese medicine recommendation oriented to the scenes of clinical auxiliary decision making, complex syndrome differentiation, inter-school knowledge fusion and the like. Therefore, the scientific connotation and action mechanism of the traditional Chinese medicine prescription are deeply excavated, so that not only is the traditional Chinese medicine prescription beneficial to realizing more accurate decision making during clinical medicine selection of a traditional Chinese medicine prescription, but also the effective prescription which is not fully recorded can be promoted to be excavated from classical medical books, thereby deepening the understanding of the deep law of the traditional Chinese medicine prescription and promoting the inheritance, innovation and development of traditional Chinese medicine. Recommendation tasks have been widely applied to the recommendation of many different objects, such as movie recommendation, book recommendation, merchandise recommendation, and the like. Traditional recommendation systems are different from traditional Chinese medicine prescription recommendations. Traditional recommendation systems mainly solve the problem of binary matching between single entities (such as users and articles), while traditional Chinese medicine prescription recommendation involves complex networked interactions between multidimensional collections of entities. The medicine interaction network not only comprises a nonlinear mapping relation between symptoms and herbal medicines, but also needs to systematically consider the synergic or antagonistic action among a plurality of herbal medicines in a prescription, and the multi-level and multi-scale medicine interaction network forms a core scientific difficulty of the traditional Chinese medicine recommendation system. Therefore, the intelligent prescription recommendation of traditional Chinese medicines which fuses the front technologies such as machine learning, graph convolution neural network, large language model and the like is gradually becoming the key field of modern research of traditional Chinese medicines. The traditional Chinese medicine prescription recommendation method based on machine learning has a plurality of common defects. The model representation is highly dependent on the quality of the manually designed features or external knowledge patterns, its embedded representation is susceptible to data noise interference, and it is difficult to fully learn and exploit the complex, nonlinear co-occurrence rules underlying prescription chinese herbal medicine and symptoms. The model architecture has the limitation that the adopted self-encoder has insufficient characterization capability, the traditional