Herbal medicine and symptom relation modeling method based on heterogeneous attention mechanism

By constructing a heterogeneous attention relationship network, dynamically calculate attention scores, and enhancing node representation capabilities, the problems of information integration and dynamic adjustment in the traditional Chinese medicine recommendation system are solved, and more accurate modeling of the relationship between herbal medicine and symptom is achieved.

CN120260796APending Publication Date: 2025-07-04BEIJING ANGOPRO TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510400049.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The prior art has failed to effectively integrate multiple types of relationship information in the traditional Chinese medicine recommendation system, and lacks a dynamic adjustment mechanism, resulting in poor recommendation results in dealing with complex symptoms and combinations of multiple herbal medicines.

Method used

Construct a heterogeneous attention relationship network, capture the complex interaction between herbs-herbs, herbs-symptoms and symptoms-symptoms through the graph neural network structure, dynamically calculate attention scores, and enhance node representation ability.

Benefits of technology

It significantly improves the modeling accuracy and feature representation accuracy of the traditional Chinese medicine recommendation system, and can more accurately capture the context dependence between herbs and symptoms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120260796A_ABST
    Figure CN120260796A_ABST
Patent Text Reader

Abstract

The invention discloses a herbal medicine and symptom relation modeling method based on a heterogeneous attention mechanism, and the method comprises the following steps: constructing a heterogeneous attention relation network based on a graph neural network structure; the heterogeneous attention relationship network comprises herbal medicine nodes, symptom nodes and edges for connecting the nodes, and the types of the edges for connecting the nodes comprise herbal medicine-herbal medicine edges, herbal medicine-symptom edges and symptom-symptom edges; obtaining an attention score of each node based on the edge type of the connection node; based on the attention score of each node, gathering information of the quality nodes and information of the heterogeneous nodes to obtain enhanced node representation; and based on the enhanced node representation, constructing a context dependence model between the herbal medicine and the symptom, and carrying out herbal medicine recommendation. According to the invention, herbal medicine and symptom relation modeling based on a heterogeneous attention mechanism is realized, and a more accurate and efficient feature representation method is provided for a traditional Chinese medicine recommendation system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of traditional Chinese medicine recommendation, and particularly relates to a method for modeling the relationship between herbs and symptoms based on a heterogeneous attention mechanism. Background Art

[0002] In traditional Chinese medicine recommendation systems, traditional methods mainly rely on simple statistical analysis and rule reasoning, establishing the relationship between herbs and symptoms based on fixed rules or empirical formulas. These methods usually only consider a single type of association, such as the direct correspondence between herbs and symptoms, while ignoring the interaction between herbs and the potential connection between symptoms. This limitation results in poor recommendation effects when dealing with complex symptoms and multi-herb combinations, and it is difficult to meet the needs of personalized recommendation.

[0003] In recent years, some patents have attempted to improve the modeling of the relationship between herbs and symptoms through advanced technologies. For example, Patent CN202310548996.9 proposes an intelligent recommendation system for traditional Chinese medicine prescriptions, which models symptoms and medicinal materials using the one-hot encoding and feature vector method, and generates traditional Chinese medicine prescriptions through a data processing module. However, this method performs poorly in dealing with heterogeneous data and is difficult to effectively integrate different types of information.

[0004] Another patent CN202110962813.9 proposes a traditional Chinese medicine decoction piece formula recommendation system based on an integrated neural network, which learns the non-linear relationship between herbs and symptoms by constructing a multi-layer neural network. Although this model improves the recommendation accuracy to a certain extent, it still has limitations in dealing with complex scenarios, especially in dynamically adjusting the node attention distribution.

[0005] In summary, there are still the following deficiencies in the current modeling of the relationship between herbs and symptoms: First, it fails to effectively integrate various types of relationship information, resulting in poor performance of the model in dealing with heterogeneous data; second, there is a lack of a dynamic adjustment mechanism, making it difficult to adapt to the modeling needs in different situations.

[0006] To solve the above problems, it is urgent to propose a method for modeling the relationship between herbs and symptoms based on a heterogeneous attention mechanism, which can greatly improve the accuracy of traditional Chinese medicine recommendation. Summary of the Invention

[0007] To solve the above technical problems, the present invention proposes a method for modeling the relationship between herbs and symptoms based on a heterogeneous attention mechanism. By constructing a heterogeneous attention relationship network, this method can capture the complex interaction relationships between herb-herb, herb-symptom, and symptom-symptom simultaneously. By dynamically calculating the attention scores based on edge types, it significantly enhances the representation ability of nodes, overcomes the limitations of existing patent solutions, improves the accuracy of modeling and the feature representation accuracy of traditional Chinese medicine recommendation systems, so as to solve the problems existing in the above-mentioned prior art.

[0008] To achieve the above object, the present invention provides a method for modeling the relationship between herbs and symptoms based on a heterogeneous attention mechanism, including the following steps:

[0009] Based on the graph neural network structure, construct a heterogeneous attention relationship network; the heterogeneous attention relationship network includes herb nodes, symptom nodes, and edges connecting the nodes, and the edge types connecting the nodes include herb-herb edges, herb-symptom edges, and symptom-symptom edges;

[0010] Based on the edge types connecting the nodes, obtain the attention scores of each node;

[0011] Based on the attention scores of each node, aggregate the information of homogeneous nodes and heterogeneous nodes to obtain enhanced node representations;

[0012] Based on the enhanced node representations, construct a context-dependent model between herbs and symptoms for herb recommendation.

[0013] Optionally, the process of training the heterogeneous attention relationship network further includes:

[0014] Using the labeled herb-symptom relationship data, optimize the network parameters through the backpropagation algorithm; use the cross-entropy loss function to evaluate the network performance, and update the network weights through the gradient descent method.

[0015] Optionally, the process of obtaining the attention scores of each node based on the edge types connecting the nodes includes:

[0016] Based on the edge types connecting the nodes, assign an initial attention weight to each edge; based on the multi-head attention mechanism module, combine the original feature vectors of the corresponding nodes and the initial attention weights of the corresponding edges to obtain the attention scores of each node.

[0017] Optionally, the calculation formula of the attention scores is as follows:

[0018]

[0019] where a ij is the attention score between node i and node j, and e ijis the type from edge i to j, h i and h j are the attribute information of node i and node j respectively, N(i) is the set of neighbor nodes of node i, f is a non-linear function, e ik is the type from edge i to k, h k is the attribute information of node k, and k is an element belonging to N(i).

[0020] Optionally, the process of aggregating the information of homogeneous and heterogeneous nodes based on the attention scores of each node to obtain the enhanced node representation includes:

[0021] Based on the attention scores of each node, weighted aggregate the feature vectors of neighbor nodes;

[0022] Fuse the aggregated feature vectors with the original feature vectors of the corresponding nodes to obtain the enhanced node representation.

[0023] Optionally, the calculation formula of the enhanced node representation is as follows:

[0024]

[0025] where h i ' is the representation of the enhanced node i.

[0026] The present invention also provides a system for modeling the relationship between herbs and symptoms based on a heterogeneous attention mechanism. Based on the above method, it includes: a heterogeneous network construction module, an attention score acquisition module, a node representation enhancement module, and an herb recommendation module;

[0027] The heterogeneous network construction module is used to construct a heterogeneous attention relationship network based on the graph neural network structure; the heterogeneous attention relationship network includes herb nodes, symptom nodes, and edges connecting the nodes, and the edge types connecting the nodes include herb-herb edges, herb-symptom edges, and symptom-symptom edges;

[0028] The attention score acquisition module is used to obtain the attention score of each node based on the edge type connecting the nodes;

[0029] The node representation enhancement module is used to aggregate the information of homogeneous and heterogeneous nodes based on the attention score of each node to obtain the enhanced node representation;

[0030] The herb recommendation module is used to construct a context-dependent model between herbs and symptoms based on the enhanced node representation and perform herb recommendation.

[0031] The present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program to implement the steps of the above method.

[0032] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method are implemented.

[0033] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the method are implemented.

[0034] Compared with the prior art, the present invention has the following advantages and technical effects:

[0035] By constructing a heterogeneous attention relationship network, the present invention can simultaneously capture the complex interaction relationships among herb-herb, herb-symptom, and symptom-symptom. The heterogeneous attention relationship network dynamically calculates attention scores based on edge types, enabling each node to aggregate information from homogeneous and heterogeneous nodes, significantly enhancing its representation ability. This method overcomes the limitations of traditional single-modal relationship learning and can more accurately capture the context-dependent relationship between herbs and symptoms, providing a more accurate feature representation for traditional Chinese medicine recommendation.

[0036] Through the above technical solution, the present invention realizes the modeling of the relationship between herbs and symptoms based on the heterogeneous attention mechanism, providing a more accurate and efficient feature representation method for the traditional Chinese medicine recommendation system. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The drawings constituting a part of this application are used to provide a further understanding of this application. The schematic embodiments of this application and their descriptions are used to explain this application and do not constitute an improper limitation of this application. In the drawings:

[0038] Figure 1 is a schematic diagram of the herb recommendation process according to the second embodiment of the present invention;

[0039] Figure 2 is a schematic diagram of the herb recommendation process according to the third embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0040] It should be noted that, without conflict, the embodiments in this application and the features in the embodiments can be combined with each other. The following will refer to the drawings and combine the embodiments to detail this application.

[0041] It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0042] Embodiment 1

[0043] In this embodiment, a method for modeling the relationship between herbs and symptoms based on a heterogeneous attention mechanism is provided, including the following steps:

[0044] Based on the graph neural network structure, construct a heterogeneous attention relationship network; the heterogeneous attention relationship network includes herb nodes, symptom nodes, and edges connecting the nodes, and the edge types connecting the nodes include herb-herb edges, herb-symptom edges, and symptom-symptom edges;

[0045] Based on the edge types connecting the nodes, obtain the attention scores of each node;

[0046] Based on the attention scores of each node, aggregate the information of homogeneous nodes and heterogeneous nodes to obtain enhanced node representations;

[0047] Based on the enhanced node representations, construct a context dependence model between herbs and symptoms for herb recommendation.

[0048] Implementable, construction of the heterogeneous attention relationship network (HAR-Net):

[0049] Node definition:

[0050] Herb node (H node): Represents a specific herb, and each herb node contains its attribute information, such as medicinal properties, efficacy, etc.

[0051] Symptom node (S node): Represents a specific symptom, and each symptom node contains its attribute information, such as symptom description, severity, etc.

[0052] Edge definition:

[0053] Herb-herb edge (H-H edge): Represents the interaction relationship between different herbs.

[0054] Herb-symptom edge (H-S edge): Represents the treatment relationship between herbs and symptoms.

[0055] Symptom-symptom edge (S-S edge): Represents the association relationship between different symptoms.

[0056] Furthermore, the heterogeneous attention relationship network (HAR-Net) adopts a graph neural network structure, where each node is represented as a feature vector, and the feature vector contains the attribute information of herbs or symptoms.

[0057] Implementable, implementation of the heterogeneous attention mechanism:

[0058] Based on the edge type of the connected nodes (whether H-H, H-S, or S-S), obtain the attention score of each node. The calculation of the attention score is based on the edge type and the attribute information of the nodes. The specific process includes: based on the edge type of the connected nodes, assign an initial attention weight to each edge; based on the multi-head attention mechanism module, combine the original feature vector of the corresponding node and the initial attention weight of the corresponding edge to obtain the attention score of each node.

[0059] Furthermore, the calculation formula of the attention score is as follows:

[0060]

[0061] Where, a ij is the attention score between node i and node j, e ij is the type of the edge from i to j, h i and h j are the attribute information of node i and node j respectively, N(i) is the set of neighbor nodes of node i, f is a non-linear function, e ik is the type of the edge from i to k, h k is the attribute information of node k, and k is an element belonging to N(i).

[0062] Furthermore, when calculating the attention score, the Heterogeneous Attention Relationship Network (HAR-Net) considers the directionality of the edges, that is, distinguishes incoming edges and outgoing edges, to more precisely capture the information flow.

[0063] Furthermore, when calculating the attention score, the Heterogeneous Attention Relationship Network (HAR-Net) considers the degree information of the nodes, that is, the number of connected edges of the nodes, to balance the contribution of different nodes to the attention score.

[0064] Furthermore, when calculating the attention score, the Heterogeneous Attention Relationship Network (HAR-Net) considers the hierarchical information of the nodes, that is, the hierarchical position of the nodes in the network, to more comprehensively capture the interaction relationship between nodes.

[0065] Furthermore, when calculating the attention score, the Heterogeneous Attention Relationship Network (HAR-Net) adopts the self-attention mechanism to capture the complex interaction of the internal features of the nodes.

[0066] Furthermore, when calculating the attention score, the Heterogeneous Attention Relationship Network (HAR-Net) adopts the position encoding technology to consider the position information of the nodes in the network and enhance the representation ability of the model.

[0067] Implementable. Each node updates its own representation by aggregating the information of its neighbor nodes. During the aggregation process, the attention scores corresponding to different types of edges are different, thus achieving effective fusion of heterogeneous information.

[0068] The process of aggregating the information of homogeneous nodes and heterogeneous nodes based on the attention scores of each node to obtain the enhanced node representation includes: weighted aggregating the feature vectors of neighbor nodes based on the attention scores of each node; fusing the aggregated feature vectors with the original feature vectors of the corresponding nodes to obtain the enhanced node representation.

[0069] The calculation formula for the enhanced node representation is as follows:

[0070]

[0071] where h i ' is the representation of the enhanced node i.

[0072] Furthermore, when aggregating information, the heterogeneous attention relationship network (HAR-Net) adopts a multi-head attention mechanism to capture the complex interaction relationships between nodes from multiple perspectives.

[0073] Furthermore, when aggregating information, the heterogeneous attention relationship network (HAR-Net) adopts a gating mechanism to dynamically adjust the weights of the neighbor node feature vectors.

[0074] Furthermore, when aggregating information, the heterogeneous attention relationship network (HAR-Net) adopts a residual connection technique to alleviate the problem of gradient disappearance and improve the training efficiency of the model.

[0075] Implementable. Training of the heterogeneous attention mechanism:

[0076] The cross-entropy loss function is used to measure the difference between the relationship between the herbs predicted by the model and the symptoms and the actual relationship.

[0077] The specific loss function is:

[0078]

[0079] where D is the training dataset, y ij is the actual relationship label, and p ij is the relationship probability predicted by the model.

[0080] Then the Adam optimization algorithm is used to optimize the model parameters to minimize the loss function.

[0081] Furthermore, during the training process, the heterogeneous attention relationship network (HAR-Net) adopts batch normalization technology and dropout technology to improve the generalization ability of the model.

[0082] Further, during the training process of the Heterogeneous Attention Relationship Network (HAR-Net), an early stopping strategy is adopted, that is, the training is stopped when the performance on the validation set no longer improves, to prevent overfitting.

[0083] Further, during the training process of the Heterogeneous Attention Relationship Network (HAR-Net), a learning rate decay strategy is adopted to gradually reduce the learning rate and improve the stability of model convergence.

[0084] Further, during the training process of the Heterogeneous Attention Relationship Network (HAR-Net), a data augmentation technique is adopted to randomly perturb the training data to improve the robustness of the model.

[0085] Implementably, the application scenario of this method is a traditional Chinese medicine recommendation system: the trained HAR-Net model is applied to the traditional Chinese medicine recommendation system, and according to the input symptom information, the model can output a list of related herbal medicine recommendations.

[0086] The recommendation process includes the following steps: input symptom information and extract the features of symptom nodes. Calculate the attention scores between symptom nodes and herbal medicine nodes through the HAR-Net model. Aggregate relevant information according to the attention scores to generate a list of herbal medicine recommendations.

[0087] Implementably, the context-dependent relationship model adopts a multi-layer perceptron (MLP) structure, and the multi-layer perceptron receives the enhanced node representations as inputs and outputs the association strength between herbal medicines and symptoms.

[0088] Further, the traditional Chinese medicine recommendation system recommends herbal medicines that match the symptoms according to the association strength output by the context-dependent relationship model. The recommendation process includes: for a given symptom, query the herbal medicine with the highest association strength output by the model; output the query result as the recommended herbal medicine.

[0089] Further, the traditional Chinese medicine recommendation system includes a user feedback module for collecting user feedback on the recommendation results and adjusting the model parameters according to the feedback information to continuously optimize the recommendation effect.

[0090] Embodiment 2

[0091] As Figure 1 shown, the Heterogeneous Attention Relationship Network (HAR-Net) constructed in this embodiment includes the following main modules:

[0092] Input layer: Receive the initial feature representations of herbal medicines and symptoms.

[0093] Heterogeneous attention layer: Calculate the attention scores between different types of nodes (herbal medicines and symptoms).

[0094] Information aggregation layer: Aggregate the information of neighbor nodes according to the attention scores.

[0095] Output layer: Generate the enhanced node representations for subsequent recommendation tasks.

[0096] Furthermore, the input layer:

[0097] The input layer receives the initial feature representations of herbs and symptoms. Suppose there are (N_H) herbs and (N_S) symptoms, and each herb and symptom is represented by a vector h i and s j respectively. These vectors can be obtained through pre-trained embedding models or handcrafted feature extraction.

[0098] Furthermore, the heterogeneous attention layer:

[0099] The heterogeneous attention layer is responsible for calculating the attention scores between different types of nodes. The specific steps are as follows:

[0100] Edge type definition: Define three types of edges: herb-herb (H-H), herb-symptom (H-S), and symptom-symptom (S-S).

[0101] Attention score calculation: For each type of edge, use a different attention mechanism to calculate the attention scores. For example, for the H-H type of edge, the attention score can be calculated by the following formula:

[0102]

[0103] where a H-H is the learnable parameter vector for the H-H type of edge; ⊕ represents the vector concatenation operation, which is used to combine the feature vectors of node i and node j; represents the set of neighbor herbs of herb i.

[0104] Similarly, the attention scores for the H-S and S-S types and can be calculated, and the formulas are as follows:

[0105]

[0106] where a S-S is the learnable parameter vector for the S-S type of edge; represents the set of neighbor symptoms of symptom i.

[0107] Furthermore, the information aggregation layer:

[0108] According to the calculated attention scores, aggregate the information of neighbor nodes. For herb node i, its enhanced representation can be h′ iCalculated by the following formula:

[0109]

[0110] where σ is the activation function used to introduce non - linear characteristics, and common activation functions include ReLU; represents the set of neighboring herbs of herb i; represents the set of neighboring symptoms of herb i; is the attention score between herb i and herb j; is the attention score between herb i and symptom j; h j is the original feature representation of herb j; s j is the original feature representation of symptom j.

[0111] Furthermore, the output layer:

[0112] The output layer generates enhanced node representations, which can be used for subsequent recommendation tasks, such as herb recommendation, symptom prediction, etc.

[0113] Example Three

[0114] Application scenario example:

[0115] Such as Figure 2 shown, HAR - Net can be integrated into the traditional Chinese medicine recommendation system. The specific steps are as follows:

[0116] Data input: The system receives the user's symptom information and converts it into the initial feature representation of the symptom node.

[0117] Model inference: Use the HAR - Net model to calculate the attention scores between the symptom node and the herb node, and aggregate the information to generate enhanced node representations.

[0118] Recommendation generation: According to the enhanced node representations, recommend the herbs most relevant to the user's symptoms.

[0119] Symptom prediction:

[0120] HAR - Net can also be used for symptom prediction tasks. The specific steps are as follows:

[0121] Data input: The system receives the known herb information and converts it into the initial feature representation of the herb node.

[0122] Model inference: Use the HAR - Net model to calculate the attention scores between the herb node and the symptom node, and aggregate the information to generate enhanced node representations.

[0123] Prediction generation: According to the enhanced node representations, predict the possible symptoms.

[0124] Through the detailed description of the above embodiments, those skilled in the art can understand and implement the method for modeling the relationship between herbs and symptoms based on the heterogeneous attention mechanism of the present invention. By dynamically calculating the attention scores based on edge types, this method significantly enhances the representation ability of nodes, overcomes the limitations of traditional single-modal relationship learning, and provides more accurate feature representations for traditional Chinese medicine recommendation and symptom prediction.

[0125] Embodiment 4

[0126] This embodiment also provides a system for modeling the relationship between herbs and symptoms based on the heterogeneous attention mechanism. Based on the above method, it includes: a heterogeneous network construction module, an attention score acquisition module, a node representation enhancement module, and a herb recommendation module;

[0127] The heterogeneous network construction module is used to construct a heterogeneous attention relationship network based on the graph neural network structure; the heterogeneous attention relationship network includes herb nodes, symptom nodes, and edges connecting the nodes, and the edge types connecting the nodes include herb-herb edges, herb-symptom edges, and symptom-symptom edges;

[0128] The attention score acquisition module is used to obtain the attention score of each node based on the edge type connecting the nodes;

[0129] The node representation enhancement module is used to aggregate the information of homogeneous nodes and heterogeneous nodes based on the attention score of each node to obtain an enhanced node representation;

[0130] The herb recommendation module is used to construct a context-dependent model between herbs and symptoms based on the enhanced node representation for herb recommendation.

[0131] Embodiment 5

[0132] This embodiment also provides a computer device, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the steps of the above method.

[0133] Embodiment 6

[0134] This embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the above method.

[0135] Embodiment 7

[0136] This embodiment also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the steps of the above method.

[0137] The above are only the preferred specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for modeling the relationship between herbs and symptoms based on a heterogeneous attention mechanism, characterized in that, It includes the following steps: Based on the graph neural network structure, construct a heterogeneous attention relationship network; The heterogeneous attention relationship network includes herb nodes, symptom nodes and edges connecting the nodes. The edge types of the connecting nodes include herb-herb edges, herb-symptom edges and symptom-symptom edges; Based on the edge types of the connecting nodes, obtain the attention scores of each node; Based on the attention scores of each node, aggregate the information of homogeneous nodes and heterogeneous nodes to obtain enhanced node representations; Based on the enhanced node representations, construct a context dependence model between herbs and symptoms for herb recommendation.

2. The method according to claim 1, wherein It also includes the process of training the heterogeneous attention relationship network, which includes: Using the labeled herb-symptom relationship data, optimize the network parameters through the backpropagation algorithm; adopt the cross-entropy loss function to evaluate the network performance, and update the network weights through the gradient descent method.

3. The method according to claim 1, wherein The process of obtaining the attention scores of each node based on the edge types of the connecting nodes includes: Based on the edge types of the connecting nodes, assign an initial attention weight to each edge; based on the multi-head attention mechanism module, combine the original feature vectors of the corresponding nodes and the initial attention weights of the corresponding edges to obtain the attention scores of each node.

4. The method according to claim 3, wherein The calculation formula of the attention score is as follows: Among them, a ij is the attention score between node i and node j, e ij is the type of the edge from i to j, h i and h j are the attribute information of node i and node j respectively, N(i) is the set of neighbor nodes of node i, f is a non-linear function, e ik is the type of the edge from i to k, h k is the attribute information of node k, and k is an element belonging to N(i).

5. The method according to claim 3, wherein The process of aggregating the information of homogeneous nodes and heterogeneous nodes based on the attention scores of each node to obtain enhanced node representations includes: Based on the attention scores of each node, weighted-aggregate the feature vectors of neighbor nodes; Fuse the aggregated feature vectors with the original feature vectors of the corresponding nodes to obtain enhanced node representations.

6. The method according to claim 4, wherein The calculation formula of the enhanced node representation is as follows: where h i ' is the representation of the enhanced node i.

7. A system for modeling the relationship between herbs and symptoms based on a heterogeneous attention mechanism, characterized in that, Based on the method described in any one of claims 1-6, it includes: a heterogeneous network construction module, an attention score acquisition module, a node representation enhancement module and a herb recommendation module; The heterogeneous network construction module is used to construct a heterogeneous attention relationship network based on the graph neural network structure; the heterogeneous attention relationship network includes herb nodes, symptom nodes and edges connecting the nodes. The edge types of the connecting nodes include herb-herb edges, herb-symptom edges and symptom-symptom edges; The attention score acquisition module is used to obtain the attention scores of each node based on the edge types of the connecting nodes; The node representation enhancement module is used to aggregate the information of homogeneous nodes and heterogeneous nodes based on the attention scores of each node to obtain enhanced node representations; The herb recommendation module is used to construct a context dependence model between herbs and symptoms based on the enhanced node representations for herb recommendation.

8. A computer device, comprising a memory, a processor, and a computer program stored on the memory, characterized in that, The processor executes the computer program to implement the steps of the method described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method described in any one of claims 1-6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • A Chinese herbal medicine recipe recommendation system based on integrated neural network

    CN113782142B

  • Intelligent recommendation system for traditional Chinese medicine prescriptions

    CN116543869A