Mongolian medicine prescription recommendation method based on graph attention network

By constructing a graph attention network model and combining it with the Mongolian medicine's "three roots" theory and constitution classification, the systematization and intelligentization of Mongolian medicine prescription recommendations were solved. This enabled precise modeling of the relationship between symptoms and Mongolian medicine, improving the accuracy and applicability of the recommendation results.

CN121601164APending Publication Date: 2026-03-03INNER MONGOLIA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511697991.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies are insufficient for systematically and intelligently recommending Mongolian medicine prescriptions, resulting in inadequate accuracy and intelligence in the recommendations. They also fail to effectively depict the complex relationship between symptoms and Mongolian medicines and lack consideration for synergistic effects and contraindications.

Method used

A graph attention network model is constructed. By building symptom-symptom, Mongolian medicine-Mongolian medicine homogeneous graph and symptom-Mongolian medicine bipartite heterogeneous graph, multi-level graph structure mining is carried out. Combining the Mongolian medicine "three roots" theory and constitution classification knowledge, a multi-label weighted mean square error loss function is used for model training and optimization to realize the interaction relationship between symptoms and Mongolian medicine.

Benefits of technology

It significantly improves the accuracy and reliability of Mongolian medicine prescription recommendations, can handle complex inputs with multiple symptoms, is suitable for diverse clinical scenarios, and the recommendation results are consistent with the diagnosis and treatment logic of Mongolian medicine and have good medical interpretability and generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121601164A_ABST
    Figure CN121601164A_ABST
Patent Text Reader

Abstract

The invention discloses a Mongolian medicine prescription recommendation method based on a graph attention network. The Mongolian medicine prescription recommendation method comprises the following steps: constructing a symptom-symptom homogeneous graph, a Mongolian medicine-Mongolian medicine homogeneous graph and a symptom-Mongolian medicine bipartite heterogeneous graph; performing graph attention calculation on the constructed graph structure to obtain a symptom node representation vector and a Mongolian medicine node representation vector; and through fusion and iterative updating of node representation vectors and in combination with a disease cause classification result, a recommendation probability vector of each candidate prescription in a Mongolian medicine set for the symptom subset is calculated, construction of a Mongolian medicine prescription recommendation model is completed, further optimization is performed, and an optimized Mongolian medicine prescription recommendation model is obtained. The method is used for recommending Mongolian medicine prescriptions according to symptoms. According to the method, the complex incidence relation between the symptoms and the Mongolian medicine can be comprehensively mined, the Mongolian medicine'three-root 'theory and physique classification knowledge are creatively integrated into the model reasoning process in a structured mode, and the accuracy and reliability of a recommendation result are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent diagnosis and treatment, and in particular relates to a method for recommending Mongolian medicine prescriptions based on graph attention networks. Background Technology

[0002] Mongolian medicine, as an important branch of traditional Chinese medicine, possesses a unique theoretical system and rich clinical experience. Historically, it has provided effective medical services to the Mongolian people and surrounding areas. The theoretical foundation of Mongolian medicine mainly revolves around the balance and regulation of the "Three Roots" (Hei, Xila, and Badagan), aiming to cure diseases and save lives by diagnosing and adjusting the state of these three roots. However, with the rapid development of modern medicine, the inheritance and application of Mongolian medicine in modern society face a series of challenges: (1) The knowledge system is complex and difficult to systematize. The theories and practices of Mongolian medicine are mostly derived from oral traditions or traditional medical literature, which makes its inheritance mainly dependent on experienced traditional Chinese medicine practitioners. However, this method of inheritance is inadequate in the face of the modern medical environment that requires the systematization and standardization of knowledge. In addition, the language and terminology used in traditional Mongolian medicine literature are often regional and temporal, making it difficult for modern medical practitioners and researchers to understand and apply.

[0003] (2) High dependence on clinical experience. In actual diagnosis and treatment, the recommendation of Mongolian medicine prescriptions often relies on the doctor's personal experience. Experienced doctors can accurately select appropriate Mongolian medicine prescriptions based on the patient's symptoms and the condition of the three roots (skin, head, and limbs). However, young doctors or inexperienced practitioners often find it difficult to make the best treatment choice when faced with complex clinical symptoms. This high dependence on experience restricts the widespread application and promotion of Mongolian medicine.

[0004] (3) Lack of systematic and intelligent diagnostic and treatment support tools. Although modern medicine has widely used computer-aided diagnostic systems (CADS) to support clinical decision-making, the development of such intelligent tools in the field of Mongolian medicine is relatively lagging behind. Traditional intelligent methods are usually based only on simple symptom-drug correspondences, and do not fully consider the common causes or similar pathogenesis among symptoms, making it difficult for the recommendation results to accurately reflect the patient's syndrome. The "three roots" theory and constitution classification in Mongolian medicine are crucial for syndrome differentiation and treatment, but existing intelligent systems often do not integrate such knowledge into the algorithm, and only rely on historical prescription data or empirical rules for recommendations, resulting in insufficient intelligence and personalization. Traditional intelligent recommendation methods do not adequately consider the synergistic effects or incompatibilities between Mongolian medicines, and when recommending prescriptions for multiple symptoms, they cannot effectively optimize the combination of Mongolian medicines, affecting the reliability and efficacy of the recommendation results.

[0005] In summary, current technologies struggle to simultaneously characterize the complex relationship between symptoms and Mongolian medicine, and to integrate knowledge from the field of Mongolian medicine. Therefore, the accuracy and intelligence of prescription recommendations need improvement. Consequently, an improved method is urgently needed to overcome these shortcomings and enhance the effectiveness of Mongolian medicine prescription recommendations. Summary of the Invention

[0006] The purpose of this invention is to provide a Mongolian medicine prescription recommendation method based on graph attention networks that provides accurate and reliable recommendation results.

[0007] This invention is implemented by the following technical solution: a method for recommending Mongolian medicine prescriptions based on graph attention networks, which includes the following steps: S1. Construct the graph model input layer, assuming a set of symptoms. Mongolian medicine collection ,in Indicates symptoms, Indicates Mongolian medicine, This represents the total number of symptom nodes. This represents the total number of Mongolian medicine nodes. set and The elements in the graph are used as nodes to construct: a symptom-symptom homogeneous graph containing only symptom nodes, a Mongolian medicine-Mongolian medicine homogeneous graph containing only Mongolian medicine nodes, and a symptom-Mongolian medicine bipartite heterogeneous graph containing both symptom nodes and Mongolian medicine nodes. S2. Homogeneous graph attention calculation: Graph attention network calculation is performed on the symptom-symptom homogeneous graph and the Mongolian medicine-Mongolian medicine homogeneous graph respectively to obtain the symptom node representation vector and the Mongolian medicine node representation vector; S3. Heterogeneous bipartite graph attention computation: Perform bidirectional graph attention network computation on the symptom-Mongolian medicine bipartite heterogeneous graph to obtain the symptom node representation vector of the symptom node and the Mongolian medicine node representation vector of the Mongolian medicine node in the bipartite heterogeneous graph, so as to model the interaction relationship between symptoms and Mongolian medicine. S4. Node representation fusion and iterative update: The representation vectors of symptom nodes in the symptom-symptom graph are... The representation vector in the symptom-Mongolian medicine bipartite isomer diagram Added and activated by the function Processing yields the fused symptom node representation vector. ; The representation vector of the Mongolian medicine node in the Mongolian medicine-Mongolian medicine graph The representation vector in the symptom-Mongolian medicine bipartite diagram Added and activated by the function Processing yields the fused Mongolian medicine node representation vector. ; The fused symptom node representation vector Returning to step S2, substitute the values ​​in equation (1) The fused Mongolian medicine node representation vector Returning to step S3, substitute the values ​​in equation (2) The attention calculation and fusion are repeated; after multiple iterations, the iteration stops when any termination condition is met, and the model parameters that are optimal on the validation set are returned to obtain the final representation vector of each symptom node. and the final representation vector of each medicine node The final representation vectors of all symptom nodes form the symptom representation matrix. The final representation vectors of all the Mongolian medicine nodes form a matrix. The termination conditions include: (1) setting the maximum number of training rounds. (2) The process terminates when any upper limit is reached; the weighted multi-label mean square error of the validation set is used as the monitoring indicator, and the result is recorded as follows: The verification loss of the round is Set an improved threshold With patience value If in consecutive In-wheel verification losses were not less than If improvements are not made, the process should be stopped early, and the model parameters should be rolled back to the previous state. That is, to roll back to the parameter corresponding to the round with the minimum verification loss up to the current round; S5. For a given subset of symptoms The subset of symptoms The symptom representation matrix is ​​composed of the final symptom representation matrix. Take the corresponding row to obtain the submatrix Then, with the candidate Mongolian medicine Representation vector Perform calculations to generate a weight representation matrix. And mapped to a pathogenesis vector through a multilayer perceptron. , used to represent the etiological classification results based on the Mongolian medicine "three roots" theory and constitution classification; S6. Calculate the Mongolian medicine prescription recommendation probability vector, based on the etiology vector obtained in step S5. Combined with the final representation matrix of Mongolian medicine Calculate the recommendation probability vector for each candidate prescription in the Mongolian medicine set for the symptom subset, and complete the construction of the Mongolian medicine prescription recommendation model; S7. Training and Optimization of the Mongolian Medicine Prescription Recommendation Model: Several historical Mongolian medicine medical records are used as training samples. A multi-label weighted mean square error loss function is employed to train and optimize the Mongolian medicine prescription recommendation model, resulting in an optimized model. Using this optimized model, the probability of recommending a Mongolian medicine prescription is output based on the input patient's symptoms. To ensure convergence and generalization performance, this invention employs a validation set multi-label weighted mean square error minimum termination mechanism for the Mongolian medicine prescription recommendation model.

[0008] Specifically, step S1 involves the following steps: S11. The nodes of the symptom-symptom homogeneous graph are connected based on the correlation between symptoms in historical Mongolian medicine medical records. When two symptoms have a common cause or similar pathogenesis in historical Mongolian medicine medical records, an undirected edge is established between the corresponding symptom nodes. S12. The nodes of the Mongolian medicine-Mongolian medicine homogeneous graph are constructed based on the similar efficacy or co-occurrence relationship of Mongolian medicine prescriptions in historical Mongolian medicine case data. When two prescriptions frequently appear at the same time or have synergistic effects in historical Mongolian medicine case data, an undirected edge is established between the corresponding Mongolian medicine nodes. S13. The edges of the symptom-Mongolian medicine bipartite heterogeneous graph are constructed based on the co-occurrence relationship of prescriptions. That is, if a symptom appears in the historical Mongolian medicine medical record data of a specific prescription, an undirected edge is established between the symptom node and the corresponding Mongolian medicine node.

[0009] Specifically, step S2 consists of the following steps: For symptom-symptom homogeneity graphs, for any symptom node and its neighboring symptom nodes Calculate attention weights And aggregate the edges of neighboring nodes to obtain the symptom node representation vector. Attention weights Calculate according to formula (1): (1) In the formula, This represents the initial feature vector of the symptom node. , For the original feature dimension, Representing neighbor symptom nodes initial feature vector transpose, This represents any neighboring node traversed in the Softmax normalized denominator. , This indicates the relationship between the central node and the "symptom-symptom" homogeneous graph. There exists a set of neighbors connected by an edge. Represents a set An arbitrary neighbor node index is used for summing the denominator. express A dimensional column vector space, where The aggregated dimension is compared with the initial dimension. They can be different; neighbor features can be transferred from... Mapped to ; For a homogeneous graph of Mongolian medicines, for any Mongolian medicine node and its neighboring Mongolian medicine nodes Calculate attention weights And aggregate the edges of neighboring nodes to obtain the node representation vector of the medicine. Attention weights Calculate according to formula (2): (2) In the formula, This represents the initial feature vector of the Mongolian medicine node. , Indicates the neighboring Mongolian medicine node initial feature vector transpose, This represents any neighboring node that is treated in the Softmax normalized denominator. initial feature vector transpose, This indicates that in the "Mongolian medicine-Mongolian medicine" homogeneous graph, the node related to the central Mongolian medicine node... There exists a set of neighbors connected by an edge. Represents a set An arbitrary neighbor node index is used for summation of the denominator; Symptom node representation vector Calculated according to formula (3): (3) Mongolian medicine node representation vector Calculated according to formula (4): (4) In the formula, and These represent the attention weight parameters for symptom-symptom homogeneity graphs and Mongolian medicine-Mongolian medicine homogeneity graphs, respectively. This represents the central symptom node in a symptom-symptom homogeneity graph. The index of any neighboring symptom node, Indicated in the symptom-symptom homogeneity graph with There exists a set of neighbors connected by an edge. This represents the central Mongolian medicine node in the Mongolian medicine-Mongolian medicine homogeneity graph. The index of any neighboring Mongolian medicine node. Indicates the relationship between Mongolian medicine and Mongolian medicine homogeneity diagram. There exists a set of neighbors connected by an edge.

[0010] Specifically, step S3 involves the following steps: Calculate symptom nodes separately for the symptom-Mongolian medicine two-part isomer diagram. Point to its adjacent Mongolian medicine node Attention weights And the nodes of Mongolian medicine Point to its adjacent symptom nodes Attention weights ; Attention weight Calculate according to formula (5): (5) In the formula, Indicates symptom nodes initial feature vector transpose, Indicates and The connected first A Mongolian medicine neighbor node The initial feature vector, Indicating symptoms – Mongolian medicine two-part isomer diagram with There exists a set of Mongolian medicine neighbors connected by edges. Represents a set A neighboring Mongolian medicine node index; Attention weight Calculate according to formula (6): (6) In the formula, Indicates Mongolian medicine nodes initial feature vector transpose, Indicating Mongolian medicine – symptom direction, central Mongolian medicine The index of any neighboring symptom node, This indicates that the Mongolian medicine – symptom-based isomerism diagram is related to... A set of adjacent symptoms. Representing neighbor symptom nodes The initial feature vector, ; Using equation (5) for each symptom node All connected Mongolian medicine neighbors calculate For the same Perform row-normalized Softmax to construct the matrix. With the identity matrix and Combined with the formation of symptom-Mongolian medicine adjacency matrix ; Equation (6) is used for each Mongolian medicine node All connected symptoms of neighbors calculate For the same Perform row-normalized Softmax to construct the matrix. With the identity matrix and Combined to form a Mongolian medicine-symptom adjacency matrix Symptoms-Mongolian Medicine Adjacency Matrix Mongolian Medicine - Symptom Adjacency Matrix This is used to characterize the strength of the association between symptoms and Mongolian medicine; Symptoms - Mongolian Medicine Adjacency Matrix Calculate according to formula (7): (7) Mongolian medicine - symptom adjacency matrix Calculate according to formula (8): (8) In the formula, and They are respectively order and An identity matrix of order 1, used to add unit connections to nodes within a matrix; For each symptom node Based on its neighboring Mongolian medicine nodes and their corresponding attention weights Calculate the output symptom node representation vector Symptom node representation vector according to Calculate, where, Represents a nonlinear activation function , This represents the input representation vector of the corresponding neighbor node; For each Mongolian medicine node Based on its neighboring symptom nodes and their corresponding attention weights Calculate the output Mongolian medicine node representation vector Mongolian medicine node representation vector according to Calculate, where, This represents the set of neighbors connected to the central node. Represents a set Any neighbor index in the array.

[0011] Specifically, in step S4: the first Symptom node representation vector after sub-fusion Satisfying equation (9): (9) In the formula Indicates the first Symptom nodes after secondary fusion The representation vector; No. The Mongolian medicine node representation vector after sub-fusion Satisfying equation (10): (10) In the formula Indicates the first The Mongolian medicine node after secondary fusion The representation vector.

[0012] Specifically, the method for multi-level iterative calculation in step S4 is as follows: continuously execute the representation vectors of the symptom nodes and the Mongolian medicine nodes. Layer iteration, sequentially according to the formula , , , , Update, in which ,when Time to take As a symptom node The final representation vectors of the symptom nodes are then concatenated vertically in node number order to form a matrix. ; in sequence according to the formula , , , , Update, in which ,when Time to take As a node of Mongolian medicine The final representation vectors are then vertically concatenated according to node numbering order to obtain a matrix composed of the final representation vectors of the Mongolian medicine nodes. .

[0013] Specifically, in step S5, the pathogenesis vector is calculated using a multilayer perceptron. Calculate according to formula (11): (11) In the formula, for copy The resulting representation matrix, The number of nodes in the symptom subset. This indicates the treatment of each symptom. Calculation and candidate Mongolian medicines The matching score, and The number of symptoms in the said symptom subset, symbolized by " " indicates that matrices are multiplied element by element; These represent the weight parameters of the affine transformation in the first layer of a multilayer perceptron. This is represented by the bias parameters of the first-layer affine transformation of the multilayer perceptron; overall, this step first uses... The symptoms were scored one by one and normalized to obtain the results. Then use right The aggregate vector is obtained by weighting each element and summing along the rows. = Finally, the pathogenesis vector is obtained through MLP and activation. .

[0014] Specifically, in step S6, let If the probability vector of the recommended Mongolian medicine prescription is given, it can be calculated using formula (12): (12) Recommendation probability vector .

[0015] Specifically, in step S7, the multi-label weighted mean square error loss function is shown in equation (13): (13) Among them, the weighted mean square error ; ;No. Category weight of each Mongolian medicine label Through Mongolian medicine The inverse proportion of the frequency of occurrence in the training samples balances the distribution of different Mongolian medicine labels; specifically This refers to the first training sample among all training samples. The number of samples whose Mongolian medicine labels were marked as 1; Represents a subset of symptoms Corresponding Mongolian medicine The true label vector; This is the regularization coefficient, used to suppress overfitting; Indicates the first The number of samples whose Mongolian medicine labels were marked as 1. This indicates the labeling of all Mongolian medicines. Frequency of occurrence Take the maximum value. Mongolian medicine Frequency of occurrence in the training samples Represents all learnable parameters of the model The square of the L2 norm, It represents a collection of Mongolian medicines. Representing vectors The The component, that is, the first component. The probability of recommending each Mongolian medicine label. The model represents a subset of input symptoms. The predicted probability vector.

[0016] Advantages of this invention: (1) By constructing a multi-level graph structure of symptom-symptom, Mongolian medicine-Mongolian medicine and symptom-Mongolian medicine heterogeneous bipartite graph, this invention comprehensively explores the complex relationship between symptoms and Mongolian medicine, which significantly improves the accuracy and reliability of the recommendation results.

[0017] (2) The Mongolian medicine “three roots” theory and the knowledge structure of constitution classification are innovatively integrated into the model reasoning process, making the recommendation results more in line with the Mongolian medicine diagnosis and treatment logic, and having good medical rationality and explanatory power.

[0018] (3) The model of the present invention can effectively handle complex inputs with multiple symptoms, and the combination of multi-label weighted mean square error loss function improves the generalization ability and robustness of the model, making it suitable for diverse clinical scenarios. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is an overall flowchart of the method recommended in this invention; Figure 2 This is an example diagram illustrating the diagnostic and treatment process of "blood-related headache" in Mongolian medicine according to the present invention; Figure 3 This is a diagram illustrating the overall architecture of the graph attention model of this invention. Figure 4 This invention presents a bipartite graph attention network oriented towards symptoms (left) and Mongolian medicine (right); Figure 5 This is a symptom-symptom homogeneity graph of the present invention; Figure 6 This is a diagram showing the homogeneity of Mongolian medicines in this invention. Figure 7 This is a diagram of the two isomers of the Mongolian medicine for the symptoms of this invention; Figure 8 This is a diagram of the multilayer perceptron network structure of the present invention. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] See Figure 1 A method for recommending Mongolian medicine prescriptions based on graph attention networks includes the following steps: S1. Construct the graph model input layer, assuming a set of symptoms. Collection of Mongolian and Mongolian Medicine ,in, Indicates symptoms, Indicates Mongolian medicine, This represents the total number of symptom nodes. This represents the total number of nodes in the Mongolian medicine category.

[0023] Each symptom corresponds to a symptom node, and each Mongolian medicine prescription corresponds to a Mongolian medicine node. Three types of graph structures are established for all symptom nodes and Mongolian medicine nodes: symptom-symptom homogeneous graph containing only symptom nodes, Mongolian medicine-Mongolian medicine homogeneous graph containing only Mongolian medicine nodes, and symptom-Mongolian medicine bipartite heterogeneous graph containing both symptom and Mongolian medicine nodes. In this embodiment, step S1 is specifically as follows: S11, such as Figures 5 to 7 As shown, the edges between nodes in the symptom-symptom homogeneous graph are constructed based on the correlation between symptoms in historical Mongolian medicine medical records. When two symptoms have a common etiology or similar pathogenesis in historical Mongolian medicine medical records, an undirected edge is established between the corresponding symptom nodes. S12. The nodes of the Mongolian medicine-Mongolian medicine homogeneous graph are constructed based on the similar efficacy or co-occurrence relationship of Mongolian medicine prescriptions in historical Mongolian medicine case data. When two prescriptions frequently appear at the same time or have synergistic effects in historical Mongolian medicine case data, an undirected edge is established between the corresponding Mongolian medicine nodes. S13. The edges of the symptom-Mongolian medicine two-part heterogeneous graph are constructed based on the co-occurrence relationship of prescriptions. That is, if a symptom appears in the historical Mongolian medicine medical record data of a specific prescription, an undirected edge is established between the symptom node and the corresponding Mongolian medicine node. Table 1 presents a data fragment from the Mongolian medicine prescription knowledge base. The prescription records for the disease name "Heyi edema" include multiple prescriptions such as "Guangzao Qiwei San" and "Chenxiang Sanshiwuwei San". Based on this, edges can be added between the Mongolian medicine nodes of "Guangzao Qiwei San" and "Chenxiang Sanshiwuwei San" to represent their prescription co-occurrence relationship. For example, the disease name "Surya disease of the stomach and large intestine" in Table 1 includes symptoms such as "bloating and pain in the stomach and lower abdomen with borborygmus" and "nausea and vomiting". Its corresponding prescription contains the formula "Shan Kumai Qiwei San". Therefore, a connection is established between the symptom nodes "bloating and pain in the stomach and lower abdomen with borborygmus" and "nausea and vomiting" and the Mongolian medicine node "Shan Kumai Qiwei San", which reflects the relationship between symptoms and formula in this case. The construction of the multi-granularity graph structure is completed through the above step S1, which integrates the symptom association knowledge of Mongolian medicine diseases and the co-occurrence information of prescriptions, providing rich relational input for subsequent attention calculation, thereby improving the model's ability to express complex symptoms.

[0024] Table 1: Collection of Mongolian Medicines

[0025] S2. Homogeneous graph attention calculation: Graph attention network calculation is performed on the symptom-symptom homogeneous graph and the Mongolian medicine-Mongolian medicine homogeneous graph respectively to obtain the symptom node representation vector and the Mongolian medicine node representation vector; In this embodiment, step S2 is specifically as follows: like Figure 3 As shown, the overall architecture of the model of the present invention includes a parallel attention calculation module for symptom-symptom homogeneity graphs and Mongolian medicine-Mongolian medicine homogeneity graphs; against Figure 5 The symptom-symptom homogeneity graph shown calculates attention weights for any symptom node and its neighboring symptom nodes, and aggregates the features of neighboring nodes to obtain the representation vector of the symptom node. like Figure 6 The Mongolian medicine-Mongolian medicine homogeneous graph shown calculates the attention weights between any Mongolian medicine node and its neighboring Mongolian medicine nodes, and aggregates them to obtain the representation vector of the Mongolian medicine node; The weights are calculated using a self-attention mechanism, and Equation (1) gives the attention weights of the symptom-symptom homogeneity graph. Calculation method: (1) In the formula, This represents the initial feature vector of the symptom node. Representing neighbor symptom nodes initial feature vector transpose, This represents any neighboring node traversed in the Softmax normalized denominator. , This indicates the relationship between the central node and the symptom-symptom homogeneity graph. There exists a set of neighbors connected by an edge. Represents a set An arbitrary neighbor node index is used for summing the denominator.

[0026] Formula (2) gives the attention weights of the Mongolian medicine-Mongolian medicine homogeneity graph. Calculation method: (2) In the formula, This represents the initial feature vector of the Mongolian medicine node. Indicates the neighboring Mongolian medicine node initial feature vector transpose, This represents any neighboring node that is treated in the Softmax normalized denominator. initial feature vector transpose, This indicates that in the "Mongolian medicine-Mongolian medicine" homogeneous graph, the node related to the central Mongolian medicine node... There exists a set of neighbors connected by an edge. Represents a set An arbitrary neighbor node index is used for summing the denominator.

[0027] The initial feature vectors of the symptom node and the Mongolian medicine node are denoted as follows: and ,in, The dimension is The real number column vector space, For the original feature dimension; To hide dimensions on the network.

[0028] In this embodiment, the attribute encoding of nodes is taken in the initial state; specifically, for example, the attributes of symptom nodes include the attribution of the three roots and the constitution indication; the attributes of Mongolian medicine (prescription / herb) include dosage form / usage and compatibility relationship; during encoding, one-hot / multi-hot encoding is used for discrete attributes; the text description is concatenated to the attribute vector after being processed by TF-IDF / sentence vector; numerical attributes (dosage, etc.) are concatenated after standardization; finally, all fields are concatenated to a uniform length. vector and ).

[0029] The attention weights of the symptom-symptom homogeneity graph are calculated using formula (1). The attention weights of the Mongolian medicine-Mongolian medicine homogeneous graph are calculated using formula (2). Let there be a set of homogeneous neighbors. , ; For symptoms, the attention-weighted summation has The attention-weighted summation of Mongolian medicine side effects has an effect. This yields the representation vector of the symptom nodes as shown in formula (3). And the representation vector of the Mongolian medicine node as shown in formula (4) : (3) (4) In the formula, and These represent the attention weight parameters for symptom-symptom homogeneity graphs and Mongolian medicine-Mongolian medicine homogeneity graphs, respectively. This represents the central symptom node in a symptom-symptom homogeneity graph. The index of any neighboring symptom node. Indicated in the symptom-symptom homogeneity graph with There exists a set of neighbors connected by an edge. This represents the central Mongolian medicine node in the Mongolian medicine-Mongolian medicine homogeneity graph. The index of any neighboring Mongolian medicine node. Indicates the relationship between Mongolian medicine and Mongolian medicine homogeneity diagram. There exists a set of neighbors connected by an edge.

[0030] After completing step S2, the symptom node and the Mongolian medicine node each obtain an implicit vector representation of the relationship between nodes of the same type, which will provide a foundation for heterogeneous graph interaction. Through this step, the model extracts the symptom features implied by the comorbidity relationship between symptoms at the symptom level, and extracts the efficacy features reflected by the synergistic or contraindication relationship between different prescriptions at the Mongolian medicine level, thereby improving the ability to characterize the symptom and prescription node representations.

[0031] S3. Heterogeneous bipartite graph attention computation: Perform bidirectional graph attention network computation on the symptom-Mongolian medicine bipartite heterogeneous graph to obtain the symptom node representation vector of the symptom node and the Mongolian medicine node representation vector of the Mongolian medicine node in the bipartite heterogeneous graph, so as to model the interaction relationship between symptoms and Mongolian medicine. In this embodiment, step S3 is specifically as follows: like Figure 4 As shown, this invention addresses the symptoms of a two-part heterogeneous graph design. Figure 4 (Left) and facing Mongolian medicine ( Figure 4 (Right) Attention network in two directions: on the one hand, the attention weight of each symptom node pointing to its neighboring Mongolian medicine node is calculated, and on the other hand, the attention weight of each Mongolian medicine node pointing to its neighboring symptom node is calculated. In formula (5) Indicates symptom nodes Pointing to its neighbor Mongolian medicine node The attention weights, in formula (6) Indicates Mongolian medicine nodes Pointing to symptom nodes Attention weights; (5) In the formula, Indicates symptom nodes initial feature vector transpose, Indicates and The connected first A Mongolian medicine neighbor node The initial feature vector, Symptoms - Mongolian Medicine Part Two Diagram and There exists a set of Mongolian medicine neighbors connected by edges. Represents a set A neighboring Mongolian medicine node index; (6) In the formula, Indicates Mongolian medicine nodes initial feature vector transpose, Indicating Mongolian medicine - symptom direction, central Mongolian medicine The index of any neighboring symptom node, Symptoms - Mongolian Medicine Part Two Diagram and A set of adjacent symptoms. Representing neighbor symptom nodes The initial feature vector; Using equation (5) for each symptom node All connected Mongolian medicine neighbors calculate For the same Perform row-normalized Softmax to construct the matrix. With the identity matrix and Combined with the formation of symptom-Mongolian medicine adjacency matrix , E Represents the edge set of the symptom-Mongolian medicine bipartite graph; Equation (6) is used for each Mongolian medicine node. All connected symptoms of neighbors calculate For the same Perform row-normalized Softmax to construct the matrix. With the identity matrix and Combined to form a Mongolian medicine-symptom adjacency matrix Symptoms-Mongolian Medicine Adjacency Matrix Mongolian Medicine - Symptom Adjacency Matrix This is used to characterize the strength of the association between symptoms and Mongolian medicine; among them, Indicates that the element is taken from the real number field. dimensional matrix space, where For the number of nodes in Mongolian medicine, This represents the number of symptom nodes.

[0032] Equations (7) and (8) give the method for constructing the adjacency matrix: (7) (8) in, and They are respectively order and An identity matrix of order 1, used to add unit connections to nodes within a matrix; Based on the above adjacency matrix and Information dissemination based on the symptom-Mongolian medicine two-part isomer diagram: For each symptom node, according to the matrix By weighted aggregation of the representation vectors of all adjacent Mongolian medicine nodes, the output representation of the symptom node in the bipartite heterogeneous graph is obtained. In the formula, Represents a nonlinear activation function , This represents the input representation vector of the corresponding neighbor node (if the fused representation is used in this layer, then...). Unified as ); For each Mongolian medicine node, then according to the matrix Aggregating the representations of its adjacent symptom nodes yields the output representation of the Mongolian medicine node in a bipartite heterogeneous graph. In the formula, This represents the set of neighbors connected to the central node. Represents a set Any neighbor index in; With the help of this bidirectional attention mechanism, symptom nodes will pay attention to Mongolian medicine neighbors that are highly related to themselves, and Mongolian medicine nodes can also highlight important symptom neighbors, thereby achieving interactive fusion of symptom and prescription characteristics. Step S3 extracts cross-modal symptom-prescription association features, which makes up for the shortcomings of isolated modeling of symptoms and Mongolian medicine in homogeneous graphs, thereby further improving the accuracy of node representation in depicting the correspondence between symptoms and prescriptions.

[0033] S4. Node representation fusion and iterative update: The symptom node representation vector and Mongolian medicine node representation vector obtained by homogeneous graph attention calculation are fused and iterated with the output representation of symptom nodes in bipartite graph and output representation of Mongolian medicine nodes in bipartite graph calculated by heterogeneous bipartite graph attention network to obtain the final representation matrix of symptom nodes and the final representation matrix of Mongolian medicine nodes, and the multi-level relationship features between symptoms and Mongolian medicine are extracted and fused. In this embodiment, step S4 is specifically as follows: In this embodiment, node vectors from the symptom-symptom homogeneous graph, the Mongolian medicine-Mongolian medicine homogeneous graph, and the symptom-Mongolian medicine bipartite heterogeneous graph are fused using element-wise vector addition, and the nonlinear expressive power of the representation is enhanced by an activation function. The representation vector of the symptom node in the symptom-symptom homogeneous graph is then used. Output representation of symptom nodes in the symptom-Mongolian medicine bipartite isomer graph Added and activated by the function Processing, obtaining the first Symptom nodes after sub-fusion As shown in equation (9): (9) The representation vector of the Mongolian medicine node in the Mongolian medicine-Mongolian medicine homogeneous graph. The output representation of the Mongolian medicine node in the symptom-Mongolian medicine bipartite isomorphism graph Added and activated by the function Processing, obtaining the first The Mongolian medicine node after sub-fusion As shown in formula (10): (10) The fused symptom node representation vector Returning to step S2, substitute the values ​​in equation (1) The fused Mongolian medicine node representation vector Returning to step S3, substitute the values ​​in equation (2) Attention calculation and fusion are repeatedly performed; specifically, the representation vectors of symptom nodes and Mongolian medicine nodes are continuously processed. Layer iteration, sequentially according to the formula , , , , Update, in which ,when When any termination condition is met, iteration stops, and the model parameters that are optimal on the validation set are rolled back. As a symptom node The final representation vectors of the symptom nodes are then concatenated vertically in node number order to form a matrix. ; in sequence according to the formula , , , , Update, in which ,when When any termination condition is met, iteration stops, and the model parameters that are optimal on the validation set are rolled back. As a node of Mongolian medicine The final representation vectors are then vertically concatenated according to node numbering order to obtain a matrix composed of the final representation vectors of the Mongolian medicine nodes. ; Termination conditions include: (1) setting the maximum number of training rounds. (2) The process terminates when any upper limit is reached; the weighted mean square error (WMSE) of the validation set is used as the monitoring metric, and the result is recorded as follows: The verification loss of the round is Set an improved threshold With patience value If in consecutive In-wheel verification losses were not less than If improvements are not made, the process should be stopped early, and the model parameters should be rolled back to the previous state. That is, the parameters are rolled back to the parameters corresponding to the round with the minimum verification loss up to the current round.

[0034] At this point, the model has used graph neural networks to extract and fuse multi-level relationship features between symptoms and Mongolian medicine.

[0035] Through the knowledge fusion processing in step S4, information from different graph structures can be integrated in a unified vector space. The representation of each symptom and Mongolian medicine node includes comprehensive information such as symptom association, drug association, and symptom-drug interaction, thereby significantly improving the accuracy of etiology inference and prescription matching in subsequent steps.

[0036] S5, Etiological Vector Prediction, such as Figure 2 As shown, in Mongolian medicine clinical practice, doctors typically determine the type of illness based on the patient's symptoms, and then select prescriptions and medications accordingly. For a given subset of symptoms... The subset of symptoms The symptom representation matrix is ​​composed of the final symptom representation matrix. Take the corresponding row to obtain the submatrix With the candidate Mongolian medicine Representation vector Perform calculations to generate a weight representation matrix. And mapped to a pathogenesis vector through a multilayer perceptron. , used to represent the etiological classification results based on the Mongolian medicine "three roots" theory and constitution classification; In this embodiment, step S5 is specifically as follows: In step S5, this invention introduces a disease prediction module to simulate the diagnostic process of Mongolian medicine, thereby further improving the consistency of the recommendation results with Mongolian medical theory. For a given subset of symptoms, i.e., the set of symptoms of a patient seeking diagnosis, extract the representation vector of each symptom node in the subset. Let the symptom subset be... Include Each symptom is represented by a vector matrix. Select the representation vector of candidate Mongolian medicine prescriptions. ( Indicates candidate Mongolian medicines / prescriptions The final representation vector; The final representation set of all Mongolian medicines / prescriptions is represented by the final representation matrix of all Mongolian medicine nodes; the symptom subset representation matrix is ​​also included. Perform element-wise operations with the candidate Mongolian medicine vector to generate a weight representation matrix. The pathogenesis vector is obtained by inputting it into a multilayer perceptron. ; utilize such Figure 8 The MLP architecture shown is Used to represent the etiology classification results based on the Mongolian medicine "three roots" theory and constitution classification; Formula (11) gives the method for constructing the etiology vector: (11) in, The symptom node representation matrix, for copy The resulting representation matrix, The number of nodes in the symptom subset. Used for each symptom Calculation and candidate Mongolian medicines The matching score, and The number of symptoms in the said symptom subset, symbolized by " " indicates that matrices are multiplied element by element; These represent the weight parameters of the affine transformation in the first layer of a multilayer perceptron. This represents the bias parameters of the first-layer affine transformation of the multilayer perceptron; The elements of the etiology vector can correspond to the "Three Roots" theory of Mongolian medicine and the various etiology categories under the constitution classification (such as imbalance of Heyi constitution, Xila constitution, Badagan constitution and evil qi type, etc.). The graph attention neural network model can automatically predict the etiology characteristics reflected by the current symptom subset by learning the correspondence between symptoms-etiology-prescription in historical data. Through the processing in step S5, this invention incorporates the diagnostic thinking of Mongolian medicine into the recommendation algorithm, enabling the generated etiology vector to guide prescription matching, which is more in line with the clinical diagnosis and treatment rules of Mongolian medicine, and improves the interpretability and accuracy of the recommendation results.

[0037] S6. Calculate the Mongolian medicine prescription recommendation probability vector, based on the etiology vector obtained in step S5, combined with the final representation matrix of Mongolian medicine. Calculate the recommendation probability vector for each candidate prescription in the Mongolian medicine set for the symptom subset, and complete the construction of the Mongolian medicine prescription recommendation model; In this embodiment, step S6 is specifically as follows: Using etiology vectors Mongolian medicine representation matrix The combination of represents the degree of matching, let If the probability vector of the recommended Mongolian medicine prescription is given, it can be calculated using formula (12): (12) Through the above calculations, the matching score of each candidate prescription with the current symptom set, i.e., the recommendation probability vector, can be obtained. The larger the value, the stronger the adaptability of the prescription for treating the symptom set. At this point, the model has generated scores or probability rankings for each Mongolian medicine prescription based on symptom characteristics and etiological inferences, providing a basis for subsequent recommendation decisions.

[0038] Step S6 realizes the fusion mapping of symptoms, causes and Mongolian medicine prescription space, which can provide a multi-candidate prescription recommendation list for complex symptoms and improve the ability of the recommendation process to distinguish different alternative solutions.

[0039] S7. Training and Optimization of Mongolian Medicine Prescription Recommendation Model: Several historical Mongolian medicine medical records are used as training samples. A multi-label weighted mean square error loss function is used to train and optimize the Mongolian medicine prescription recommendation model, resulting in an optimized model. The optimized model is then used to output the probability of recommending a Mongolian medicine prescription based on the input patient's symptoms. To ensure convergence and generalization performance, this invention employs a minimum termination mechanism based on the validation set multi-label weighted mean square error (WMSE). The minimum WMSE is determined by the validation set WMSE sequence {Jt}: Jt is calculated in each round, and the historical best value is maintained. If Jt... <best If δ (an improvement of at least δ) is achieved, then best is updated and the current parameters are saved; if the condition is not met for p consecutive rounds (or the maximum number of rounds Tmax is reached), then stop early; when stopping, the parameters are rolled back to the round corresponding to the historical minimum loss.

[0040] In this embodiment, step S7 is specifically as follows: The training samples can consist of historical Mongolian medicine medical records. In this embodiment, there are 725 training samples. Each sample contains a subset of symptoms as input and the corresponding actual prescription output. The loss function is defined as shown in formula (13): (13) No. Category weight of each Mongolian medicine label Through Mongolian medicine The inverse proportion of the frequency of occurrence in the training samples balances the distribution of different Mongolian medicine labels; specifically This refers to the first training sample among all training samples. The number of samples whose Mongolian medicine labels were marked as 1; Represents a subset of symptoms Corresponding Mongolian medicine The true label vector; This is the regularization coefficient, used to suppress overfitting; Indicates the first The number of samples whose Mongolian medicine labels were marked as 1. This indicates the labeling of all Mongolian medicines. Frequency of occurrence Take the maximum value. Mongolian medicine Frequency of occurrence in the training samples Represents all learnable parameters of the model The square of the L2 norm, It represents a collection of Mongolian medicines. Representing vectors The The component, that is, the first component. The probability of recommending each Mongolian medicine label. The model represents a subset of input symptoms. The predicted probability vector.

[0041] By adopting the aforementioned multi-label weighted WMSE (weighted multi-label mean square error) loss, on the one hand, the bias caused by the imbalance of the formula label distribution in the training data on model learning is alleviated by introducing label weights; on the other hand, the generalization ability and stability of the model are improved by combining regularization constraints. Thus, step S7 ensures that the model can fully learn the correspondence between symptoms and prescriptions, maintaining high accuracy and robustness when recommending multiple candidate prescriptions.

[0042] In this embodiment, step S8 is specifically as follows: In this embodiment, the trained model was applied to a real case and prescriptions were recommended for a certain group of clinical symptoms. The results are listed in Table 2. The symptom set includes nine symptoms: abdominal distension, frothy diarrhea, excessive flatulence, lower abdominal pain on both sides of the bladder, headache with coldness, dizziness, loss of appetite, weight loss, and borborygmus. Based on the above symptom input, the model outputs several candidate Mongolian medicine prescriptions and their recommended probability vectors, as shown in the "GAT" column of Table 2. The main candidate prescriptions recommended by the model include Eight-Ingredient Xiaqing Powder, Twelve-Ingredient Pomegranate Powder, Six-Ingredient Anxiao Powder, and Five-Ingredient Qingzhuo Powder. The "Real Prescriptions" column of Table 2 shows the prescription schemes actually used in Mongolian medicine clinical practice, including prescriptions such as Twelve-Ingredient Pomegranate Powder, Eight-Ingredient Xiaqing Powder, and Six-Ingredient Anxiao Powder. It can be seen that many prescriptions in the model's recommended results are consistent with real prescriptions. Among them, the recommended prescriptions for symptoms such as "lower abdominal pain on both sides of the bladder," "headache with coldness," and "dizziness" are the corresponding prescriptions used in actual clinical practice.

[0043] The results verify that the method of the present invention can accurately predict the etiological vector that is consistent with the diagnosis of Mongolian medicine based on complex symptoms, and recommend prescription combinations that fit clinical experience accordingly, demonstrating high effectiveness of intelligent recommendation and rationality of Mongolian medicine theory.

[0044] In practice, the system can provide doctors with the recommended prescriptions and their probability rankings for reference, assisting them in developing personalized Mongolian medicine treatment plans.

[0045] Table 2. Recommended Cases of Mongolian Medicine Prescriptions

[0046] It should be noted that the above embodiments are intended to more clearly illustrate the technical solution of the present invention, rather than to limit its scope of protection. Equivalent modifications or variations made by those skilled in the art without inventive effort should be considered to fall within the scope of protection of the present invention.

Claims

1. A method for recommending Mongolian medicine prescriptions based on graph attention networks, characterized in that, It includes the following steps: S1. Construct the graph model input layer, assuming a set of symptoms. Mongolian medicine collection ,in Indicates symptoms, Indicates Mongolian medicine, This represents the total number of symptom nodes. This represents the total number of Mongolian medicine nodes. set and The elements in the graph are used as nodes to construct: a symptom-symptom homogeneous graph containing only symptom nodes, a Mongolian medicine-Mongolian medicine homogeneous graph containing only Mongolian medicine nodes, and a symptom-Mongolian medicine bipartite heterogeneous graph containing both symptom nodes and Mongolian medicine nodes. S2. Homogeneous graph attention calculation: Graph attention network calculation is performed on the symptom-symptom homogeneous graph and the Mongolian medicine-Mongolian medicine homogeneous graph respectively to obtain the symptom node representation vector and the Mongolian medicine node representation vector; S3. Heterogeneous bipartite graph attention computation: Perform bidirectional graph attention network computation on the symptom-Mongolian medicine bipartite heterogeneous graph to obtain the symptom node representation vector of the symptom node and the Mongolian medicine node representation vector of the Mongolian medicine node in the bipartite heterogeneous graph, so as to model the interaction relationship between symptoms and Mongolian medicine. S4. Node representation fusion and iterative update: The representation vectors of symptom nodes in the symptom-symptom graph are... The representation vector in the symptom-Mongolian medicine bipartite isomer diagram Added and activated by the function Processing yields the fused symptom node representation vector. ; The representation vector of the Mongolian medicine node in the Mongolian medicine-Mongolian medicine graph The representation vector in the symptom-Mongolian medicine bipartite diagram Added and activated by the function Processing yields the fused Mongolian medicine node representation vector. ; The fused symptom node representation vector Returning to step S2, substitute the values ​​in equation (1) The fused Mongolian medicine node representation vector Returning to step S3, substitute the values ​​in equation (2) Repeatedly perform attention calculation and fusion; After multiple iterations, the iteration stops when any termination condition is met, and the model parameters that are optimal on the validation set are returned to their optimal values, thus obtaining the final representation vector for each symptom node. and the final representation vector of each medicine node The final representation vectors of all symptom nodes form the symptom representation matrix. The final representation vectors of all the Mongolian medicine nodes form a matrix. ; The termination conditions include: (1) setting the maximum number of training rounds. (2) The process terminates when any upper limit is reached; the weighted multi-label mean square error of the validation set is used as the monitoring indicator, and the result is recorded as follows: The verification loss of the round is Set an improved threshold With patience value If in consecutive In-wheel verification losses were not less than If improvements are not made, the process should be stopped early, and the model parameters should be rolled back to the previous values. That is, to roll back to the parameter corresponding to the round with the minimum verification loss up to the current round; S5. For a given subset of symptoms The subset of symptoms The symptom representation matrix is ​​composed of the final symptom representation matrix. Take the corresponding row to obtain the submatrix Then, with the candidate Mongolian medicine Representation vector Perform calculations to generate a weight representation matrix. And mapped to a pathogenesis vector through a multilayer perceptron. , used to represent the etiological classification results based on the Mongolian medicine "three roots" theory and constitution classification; S6. Calculate the Mongolian medicine prescription recommendation probability vector, based on the etiology vector obtained in step S5. Combined with the final representation matrix of Mongolian medicine Calculate the recommendation probability vector for each candidate prescription in the Mongolian medicine set for the symptom subset, and complete the construction of the Mongolian medicine prescription recommendation model; S7. Training and Optimization of the Mongolian Medicine Prescription Recommendation Model: Several historical Mongolian medicine medical records are used as training samples. A multi-label weighted mean square error loss function is employed to train and optimize the Mongolian medicine prescription recommendation model, resulting in an optimized model. Using this optimized model, the probability of recommending a Mongolian medicine prescription is output based on the input patient's symptoms. To ensure convergence and generalization performance, this invention employs a validation set multi-label weighted mean square error minimum termination mechanism for the Mongolian medicine prescription recommendation model.

2. The method for recommending Mongolian medicine prescriptions based on graph attention networks according to claim 1, characterized in that, The specific steps of step S1 are as follows: S11. The nodes of the symptom-symptom homogeneous graph are connected based on the correlation between symptoms in historical Mongolian medicine medical records. When two symptoms have a common cause or similar pathogenesis in historical Mongolian medicine medical records, an undirected edge is established between the corresponding symptom nodes. S12. The nodes of the Mongolian medicine-Mongolian medicine homogeneous graph are constructed based on the similar efficacy or co-occurrence relationship of Mongolian medicine prescriptions in historical Mongolian medicine case data. When two prescriptions frequently appear at the same time or have synergistic effects in historical Mongolian medicine case data, an undirected edge is established between the corresponding Mongolian medicine nodes. S13. The edges of the symptom-Mongolian medicine bipartite heterogeneous graph are constructed based on the co-occurrence relationship of prescriptions. That is, if a symptom appears in the historical Mongolian medicine medical record data of a specific prescription, an undirected edge is established between the symptom node and the corresponding Mongolian medicine node.

3. The method for recommending Mongolian medicine prescriptions based on graph attention networks according to claim 1, characterized in that, The specific steps of step S2 are as follows: For symptom-symptom homogeneity graphs, for any symptom node and its neighboring symptom nodes Calculate attention weights And aggregate the edges of neighboring nodes to obtain the symptom node representation vector. Attention weights Calculate according to formula (1): (1) In the formula, This represents the initial feature vector of the symptom node. , For the original feature dimension, Representing neighbor symptom nodes initial feature vector transpose, This represents any neighboring node traversed in the Softmax normalized denominator. , This indicates the relationship between the central node and the "symptom-symptom" homogeneous graph. There exists a set of neighbors connected by an edge. Represents a set An arbitrary neighbor node index is used for summing the denominator. express A dimensional column vector space, where The aggregated dimension is compared with the initial dimension. They can be different; neighbor features can be transferred from... Mapped to ; For a homogeneous graph of Mongolian medicines, for any Mongolian medicine node and its neighboring Mongolian medicine nodes Calculate attention weights And aggregate the edges of neighboring nodes to obtain the node representation vector of the medicine. Attention weights Calculate according to formula (2): (2) In the formula, This represents the initial feature vector of the Mongolian medicine node. , Indicates the neighboring Mongolian medicine node initial feature vector transpose, This represents any neighboring node that is treated in the Softmax normalized denominator. initial feature vector transpose, This indicates that in the "Mongolian medicine – Mongolian medicine" homogeneous graph, the node related to the central Mongolian medicine node... There exists a set of neighbors connected by an edge. Represents a set An arbitrary neighbor node index is used for summation of the denominator; Symptom node representation vector Calculated according to formula (3): (3) Mongolian medicine node representation vector Calculated according to formula (4): (4) In the formula, and These represent the attention weight parameters for symptom-symptom homogeneity graphs and Mongolian medicine-Mongolian medicine homogeneity graphs, respectively. This represents the central symptom node in a symptom-symptom homogeneity graph. The index of any neighboring symptom node. Indicated in the symptom-symptom homogeneity graph with There exists a set of neighbors connected by an edge. This represents the central Mongolian medicine node in the Mongolian medicine-Mongolian medicine homogeneity graph. The index of any neighboring Mongolian medicine node. Indicates the relationship between Mongolian medicine and Mongolian medicine homogeneity diagram. There exists a set of neighbors connected by an edge.

4. The method for recommending Mongolian medicine prescriptions based on graph attention networks according to claim 1, characterized in that, The specific steps of step S3 are as follows: Calculate symptom nodes separately for the symptom-Mongolian medicine two-part isomer diagram. Point to its adjacent Mongolian medicine node Attention weights And the nodes of Mongolian medicine Point to its adjacent symptom nodes Attention weights ; Attention weight Calculate according to formula (5): (5) In the formula, Indicates symptom nodes initial feature vector transpose, Indicates and The connected first A Mongolian medicine neighbor node The initial feature vector, Indicating symptoms – Mongolian medicine two-part isomer diagram with There exists a set of Mongolian medicine neighbors connected by edges. Represents a set A neighboring Mongolian medicine node index; Attention weight Calculate according to formula (6): (6) In the formula, Indicates Mongolian medicine node initial feature vector transpose, Indicating Mongolian medicine – symptom direction, central Mongolian medicine The index of any neighboring symptom node. This indicates the Mongolian medicine – symptoms bipartis isomerism diagram with A set of adjacent symptoms. Representing neighbor symptom nodes The initial feature vector, ; Using equation (5) for each symptom node All connected Mongolian medicine neighbors calculate For the same Perform row-normalized Softmax to construct the matrix. With the identity matrix and Combined with the formation of symptom-Mongolian medicine adjacency matrix ; Equation (6) is used for each Mongolian medicine node All connected symptoms of neighbors calculate For the same Perform row-normalized Softmax to construct the matrix. With the identity matrix and Combined to form a Mongolian medicine-symptom adjacency matrix ; Symptoms - Mongolian Medicine Adjacency Matrix Mongolian Medicine - Symptom Adjacency Matrix This is used to characterize the strength of the association between symptoms and Mongolian medicine; Symptoms - Mongolian Medicine Adjacency Matrix Calculate according to formula (7): (7) Mongolian medicine - symptom adjacency matrix Calculate according to formula (8): (8) In the formula, and They are respectively order and An identity matrix of order 1, used to add unit connections to nodes within a matrix; For each symptom node Based on its neighboring Mongolian medicine nodes and their corresponding attention weights Calculate the output symptom node representation vector ; Symptom node representation vector according to Calculate, where, Represents a nonlinear activation function , This represents the input representation vector of the corresponding neighbor node; For each Mongolian medicine node Based on its neighboring symptom nodes and their corresponding attention weights Calculate the output Mongolian medicine node representation vector Mongolian medicine node representation vector according to Calculate, where, This represents the set of neighbors connected to the central node. Represents a set Any neighbor index in the array.

5. A method for recommending Mongolian medicine prescriptions based on graph attention networks according to claim 1, characterized in that, In step S4: Symptom node representation vector after sub-fusion Satisfying equation (9): (9) In the formula Indicates the first Symptom nodes after secondary fusion The representation vector; No. The Mongolian medicine node representation vector after sub-fusion Satisfying equation (10): (10) In the formula Indicates the first The Mongolian medicine node after secondary fusion The representation vector.

6. The method for recommending Mongolian medicine prescriptions based on graph attention networks according to claim 1, characterized in that, The specific method for multi-level iterative calculation in step S4 is as follows: continuously execute the representation vectors of symptom nodes and Mongolian medicine nodes. Layer iteration, sequentially according to the formula , , , , Update, in which ,when Time to take As a symptom node The final representation vectors of the symptom nodes are then concatenated vertically in node number order to form a matrix. ; in sequence according to the formula , , , , Update, in which ,when Time to take As a node of Mongolian medicine The final representation vectors are then vertically concatenated according to node numbering order to obtain a matrix composed of the final representation vectors of the Mongolian medicine nodes. .

7. A method for recommending Mongolian medicine prescriptions based on graph attention networks according to claim 1, characterized in that, In step S5, the pathogenesis vector is calculated using a multilayer perceptron. Calculate according to formula (11): (11) In the formula, for copy The resulting representation matrix, The number of nodes in the symptom subset. This indicates the treatment of each symptom. Calculation and candidate Mongolian medicines The matching score, and The number of symptoms in the said symptom subset, symbolized by " " indicates that matrices are multiplied element by element; These represent the weight parameters of the affine transformation in the first layer of a multilayer perceptron. This is represented by the bias parameters of the first-layer affine transformation of the multilayer perceptron; overall, this step first uses... The symptoms were scored one by one and normalized to obtain the results. Then use right The aggregate vector is obtained by weighting each element and summing along the rows. = Finally, the pathogenesis vector is obtained through MLP and activation. .

8. A method for recommending Mongolian medicine prescriptions based on graph attention networks according to claim 1, characterized in that, In step S6, let If the probability vector of the recommended Mongolian medicine prescription is given, it can be calculated using formula (12): (12) Recommendation probability vector .

9. A method for recommending Mongolian medicine prescriptions based on graph attention networks according to claim 1, characterized in that, In step S7, the multi-label weighted mean square error loss function is shown in equation (13): (13) Among them, the weighted mean square error ; ;No. Category weight of each Mongolian medicine label Through Mongolian medicine The inverse proportion of the frequency of occurrence in the training samples balances the distribution of different Mongolian medicine labels; specifically This refers to the first training sample among all training samples. The number of samples whose Mongolian medicine labels were marked as 1; Represents a subset of symptoms Corresponding Mongolian medicine The true label vector; This is the regularization coefficient, used to suppress overfitting; Indicates the first The number of samples whose Mongolian medicine labels were marked as 1. This indicates the labeling of all Mongolian medicines. Frequency of occurrence Take the maximum value. Mongolian medicine Frequency of occurrence in the training samples Represents all learnable parameters of the model The square of the L2 norm, It represents a collection of Mongolian medicines. Representing vectors The The component, that is, the first component. The probability of recommending each Mongolian medicine label. The model represents a subset of input symptoms. The predicted probability vector.