A Method for Constructing a Knowledge Graph Relationship Between Syndrome and Effective Components of Traditional Chinese Medicine
By constructing a knowledge graph linking syndromes and effective components of traditional Chinese medicine, the problem of integrating heterogeneous data and dynamically updating traditional Chinese medicine knowledge graphs was solved. This enabled efficient integration of traditional Chinese medicine knowledge and improved the depth and accuracy of causal relationships, thereby enhancing the scalability and scientific nature of the knowledge graph.
Patent Information
- Application Number
- CN202511658228.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-11-17
AI Technical Summary
In existing technologies, TCM knowledge graphs suffer from problems such as difficulty in integrating heterogeneous data, lack of causal reasoning ability in traditional knowledge graph construction methods, weak dynamic updating ability, and inconsistency with the theoretical logic of TCM.
By generating an embedded vector set through feature extraction and mapping, a heterogeneous directed graph is constructed. An improved graph neural network is used to perform causal path inference, and a knowledge graph is constructed by combining a path scoring mechanism to ensure the consistency of causal logic and semantics in traditional Chinese medicine.
It has achieved efficient integration and dynamic updating of TCM knowledge, enhanced the scalability and cross-modal fusion capability of the knowledge graph, improved the depth, accuracy and interpretability of causal relationships, and ensured the scientific nature and practical guiding value of the knowledge graph.
Smart Images

Figure CN123117271A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graphs, and more particularly to a method for constructing a knowledge graph linking syndromes and effective components of traditional Chinese medicine. Background Technology
[0002] Knowledge graphs, as a structured knowledge representation method, can organize complex traditional Chinese medicine (TCM) knowledge into nodes and edges, revealing the intrinsic relationships between syndromes, Chinese herbal medicines, and their effective components. This provides data support for precision diagnosis and treatment, pharmacodynamic mechanism research, and new drug development in TCM. A method for constructing a syndrome-effective component association knowledge graph integrates multi-source heterogeneous data and utilizes technologies such as natural language processing, knowledge extraction, and graph databases to provide strong support for precision diagnosis and treatment and pharmacodynamic mechanism research in TCM. With the advancement of artificial intelligence and big data technologies, the construction of syndrome-effective component knowledge graphs will inject new vitality into the inheritance and innovation of TCM and provide an important tool for promoting the scientific and international development of TCM.
[0003] However, the existing methods mentioned above still have problems such as difficulty in integrating heterogeneous data, lack of causal reasoning ability in traditional knowledge graph construction methods, weak dynamic updating ability of knowledge graphs, inability to adapt to the evolution of TCM knowledge, and graph structure construction that does not conform to the theoretical logic of TCM. Summary of the Invention
[0004] This invention provides a method for constructing a knowledge graph linking syndromes and effective components of traditional Chinese medicine, in order to solve the problems of inconsistent data semantics and large differences in data formats, which lead to low efficiency in knowledge integration and association analysis. General knowledge graph construction methods do not impose semantic constraints on traditional Chinese medicine theories, which easily leads to the problem of "drugs inferring syndromes". Traditional knowledge graphs are mostly static structures, which are difficult to adapt to the dynamic updates of new data. The update process relies on manual intervention, which is time-consuming and error-prone.
[0005] The present invention provides a method for constructing a knowledge graph relating syndromes to effective components of traditional Chinese medicine, comprising the following steps: S1. Extract features from the syndrome data in the collected syndrome dataset and the effective components data in the Chinese herbal medicine dataset to obtain the semantic feature vector of the syndrome and the molecular fingerprint feature vector of the effective components of Chinese herbal medicine; map the semantic feature vector of the syndrome and the molecular fingerprint feature vector of the effective components of Chinese herbal medicine to obtain the embedding vector set; construct a heterogeneous directed graph based on the embedding vector set. S2. Based on heterogeneous directed graphs, output a set of causal paths through a causal path inference algorithm; construct a knowledge graph based on the set of causal paths; update the knowledge graph based on the new TCM clinical record data obtained.
[0006] Preferably, S1 specifically includes: Based on the embedding vectors in the embedding vector set, calculate the cosine similarity; based on the cosine similarity, obtain the neighboring nodes of the node.
[0007] Preferably, S1 specifically includes: Based on neighbor nodes, a heterogeneous directed graph is constructed. The nodes of the heterogeneous directed graph are embedded vectors in the set of embedded vectors, the edges are the neighbor relationships between nodes and their neighboring nodes, and the edge weights are cosine similarity.
[0008] Preferably, S2 specifically includes: In the causal path deduction algorithm, based on a heterogeneous directed graph, the node representations are updated through an improved graph neural network to obtain the set of node representations after the improved graph neural network propagation.
[0009] Preferably, S2 specifically includes: Based on the set of node representations after propagation from a heterogeneous directed graph and an improved graph neural network, a set of candidate paths is output.
[0010] Preferably, S2 specifically includes: Based on the candidate path set and the node representation set after propagation by the improved graph neural network, for each path, the updated node representations of the start and end points are extracted, and the dot product similarity is calculated.
[0011] Preferably, S2 specifically includes: Based on dot product similarity, a path score is calculated; based on the path score, a set of causal paths is output.
[0012] Preferably, S2 specifically includes: A knowledge graph is constructed by using the set of causal paths as the set of edges and the set of embedded vectors as the set of nodes.
[0013] The beneficial effects of the technical solution of the present invention are: 1. By using the BERT model to extract semantic features from syndrome data and combining this with molecular fingerprint feature vectors of effective components of traditional Chinese medicine generated by the RDKit cheminformatics tool, heterogeneous data of natural language and chemical structure were successfully converted into a unified vector form. Furthermore, by mapping to a unified semantic space using a multilayer perceptron, semantic alignment was achieved, effectively overcoming the gap between the ambiguity of TCM semantic expression and the precision of chemical structure. This allows data from different fields to be compared and fused in the same semantic coordinate system, laying the foundation for graph structure construction and enhancing the scalability and cross-modal fusion capabilities of the knowledge graph.
[0014] 2. Cosine similarity is used as the edge weight, and the direction of the edges is strictly limited. For example, only "syndrome → syndrome", "syndrome → effective components of traditional Chinese medicine", and "effective components of traditional Chinese medicine → effective components of traditional Chinese medicine" are allowed, while "effective components of traditional Chinese medicine → syndrome" is not allowed. This forms a heterogeneous directed graph with sparse structure and restricted direction. This not only ensures computational efficiency but also ensures the authenticity of the causal reasoning logic of traditional Chinese medicine and prevents interference from "reverse causal" paths. It provides a semantically reasonable topological foundation for subsequent causal path extraction.
[0015] 3. By using an improved graph neural network for multi-layer information propagation and aggregation, the features of neighboring nodes are aggregated while retaining their own information. This not only captures direct relationships but also identifies potential multi-hop indirect relationships, significantly improving the depth, accuracy, and interpretability of causal relationships in the knowledge graph.
[0016] 4. By using a path scoring mechanism, the average dot product similarity of all effective paths between syndrome nodes and effective component nodes of traditional Chinese medicine is calculated. Based on the scoring threshold, only paths with high semantic consistency and reasonable path direction are retained. The path scoring mechanism retains high-quality causal paths while filtering out low-relevance or logically inconsistent paths, thereby improving the reliability, scientificity and practical guidance value of the knowledge graph. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the method for constructing a knowledge graph linking syndromes and effective components of traditional Chinese medicine, as described in this invention. Detailed Implementation
[0018] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. 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.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0020] The following describes in detail, with reference to the accompanying drawings, a specific scheme for constructing a knowledge graph relating syndromes and effective components of traditional Chinese medicine provided by the present invention.
[0021] See attached document Figure 1 The diagram illustrates a flowchart of a method for constructing a syndrome-effective component association knowledge graph according to an embodiment of the present invention. The method includes the following steps: S1. Extract features from the syndrome data in the collected syndrome dataset and the effective component data of traditional Chinese medicine in the effective component dataset to obtain the semantic feature vector of the syndrome and the molecular fingerprint feature vector of the effective component of traditional Chinese medicine; map the semantic feature vector of the syndrome and the molecular fingerprint feature vector of the effective component of traditional Chinese medicine to obtain the embedding vector set; construct a heterogeneous directed graph based on the embedding vector set.
[0022] Data was collected from TCM databases, such as TCM clinical records, and chemical databases, such as PubChem, to obtain syndrome datasets and TCM effective component datasets. The syndrome data in the collected syndrome datasets are natural language text, such as the text description of "Yin deficiency and internal heat". The TCM effective component data in the collected TCM effective component datasets are chemical molecular structures, such as the molecular structure data of baicalein, represented by the string SMILES.
[0023] For the syndrome data in the collected syndrome dataset, a pre-trained BERT model is used to extract semantic features and output the semantic feature vector of the syndrome.
[0024] For the effective components of traditional Chinese medicine in the collected dataset, the Morgan fingerprint is generated using the RDKit cheminformatics tool. The Morgan fingerprint generates molecular fingerprint feature vectors of effective components of traditional Chinese medicine by analyzing the atomic and chemical bond structure of molecules.
[0025] A multilayer perceptron (MLP) is used to map the semantic feature vectors of syndromes and the molecular fingerprint feature vectors of effective components of traditional Chinese medicine into a unified semantic space. The MLP consists of two fully connected layers, each followed by a ReLU activation function. Through linear transformations and nonlinear activations, the feature space is unified and semantically aligned, outputting a set of embedding vectors in a unified semantic space. ,in, , indicating the first Each embedding vector is accompanied by a type label, such as "syndrome" or "effective ingredient of traditional Chinese medicine". The total number of semantic feature vectors representing syndromes and molecular fingerprint feature vectors representing effective components of traditional Chinese medicine is used to describe the number of nodes in the knowledge graph. The number of semantic feature vectors representing the syndrome. This represents the number of molecular fingerprint feature vectors of the effective components of traditional Chinese medicine.
[0026] By mapping the semantic feature vectors of syndromes and the molecular fingerprint feature vectors of effective components of traditional Chinese medicine to a unified semantic space, the semantic gap is eliminated, providing a consistent node representation for the construction of knowledge graphs.
[0027] Based on the set of embedded vectors in a unified semantic space, a sparse knowledge graph topology, namely a heterogeneous directed graph, is constructed.
[0028] The process of constructing a heterogeneous directed graph is as follows: For each pair of nodes, i.e., two embedding vectors, calculate the cosine similarity, which serves as the weight of the edge. The cosine similarity is obtained by dividing the vector dot product by the product of their respective magnitudes, as shown in the following formula: , in, For the first The node and the first The cosine similarity of each node is used to measure semantic relevance, and its numerical range is [value missing]. The closer the cosine similarity is to 1, the more related the meanings are; the closer the cosine similarity is to 0, the less related the meanings are; and the closer the cosine similarity is to -1, the more contradictory the meanings are. Indicates the first The _th embedding vector, i.e. the _th ... One node; Indicates the first The _th embedding vector, i.e. the _th ... One node; and They represent the first The node and the first The modulus of each node.
[0029] Select the node with the highest cosine similarity. Each neighbor node forms a set of neighbor nodes. Specifically, the K-nearest neighbors algorithm is used to sort all nodes by their cosine similarity, and the top-ranked nodes are selected. Each node serves as a neighbor node. When selecting a neighbor node, the edge type constraint must be satisfied: only edges of "syndrome → syndrome", "syndrome → effective components of traditional Chinese medicine" or "effective components of traditional Chinese medicine → effective components of traditional Chinese medicine" are allowed, while edges of "effective components of traditional Chinese medicine → syndrome" are prohibited. This ensures that the heterogeneous directed graph reflects the causal logic of traditional Chinese medicine, that is, the syndrome is the cause and the effective components of traditional Chinese medicine are the result. For example, "yin deficiency and internal heat" can be connected to "qi deficiency" or "baicalin", but "baicalin" cannot be connected in reverse to "yin deficiency and internal heat".
[0030] Based on neighbor nodes, a heterogeneous directed graph is constructed. The nodes of the heterogeneous directed graph are embedded vectors, the edges are the neighbor relationships determined by the K-nearest neighbor algorithm, and the edge weights are cosine similarity.
[0031] S2. Based on heterogeneous directed graphs, output a set of causal paths through a causal path inference algorithm; construct a knowledge graph based on the set of causal paths; update the knowledge graph based on the new TCM clinical record data obtained.
[0032] Based on heterogeneous directed graphs, a set of causal paths is output through a causal path inference algorithm.
[0033] The causal path inference algorithm uses an improved graph neural network to perform multi-layer information aggregation, resulting in a set of node representations after the improved graph neural network propagation.
[0034] The improved graph neural network iteratively aggregates information from neighboring nodes, updates the representation of each node, and captures the direct or indirect correlation between syndromes and the effective components of traditional Chinese medicine.
[0035] The improved graph neural network propagation process is as follows: Initially, each node The representation of is ,in, Indicates the first The node representation initialized by each node; Each layer of the improved graph neural network aggregates the representations of neighboring nodes. The aggregation process is as follows: for each neighboring node's representation, multiply it by the corresponding edge weight, i.e., cosine similarity, and introduce a structure modulation factor to consider differences in structural importance. If a neighboring node is more important than the current node (i.e., has more connections and higher degrees), then the structure modulation factor is larger, and the neighbor information is amplified; conversely, the neighbor information is suppressed. Then multiply by a learnable weight matrix to obtain the neighbor contribution. After summing all the neighbor contributions, add the representation of the current node and multiply by the self-loop coefficient to balance the self information and the neighbor information. Finally, perform a nonlinear transformation through the ReLU activation function to obtain the updated node representation.
[0036] The update formula for the node representation is: , in, Indicates the first The node at the th Layer node representation; This represents an activation function used to introduce nonlinearity, enhance representational power, and suppress negative features. It represents the contribution of neighbors and is used to aggregate information from all neighboring nodes to capture semantic relationships. Indicates the first The set of neighboring nodes of a node; Indicates the first The learnable weight matrix of each layer represents the parameters of the improved graph neural network. After initializing the weight matrix using a uniform or normal distribution, the parameters of each layer, including the learnable weight matrix, are continuously adjusted using backpropagation and gradient descent, leveraging a structural loss function such as path scoring, to minimize the task-defined loss function. This enhances the inference, representation, and path evaluation capabilities of the graph neural network. The values range from [value missing in original text]. ; Indicates the first The node at the th Layer node representation; A linear transformation representing the representation of neighboring nodes, used to adjust the features of neighboring nodes and enhance semantic expression; This represents the self-loop coefficient, used to control the degree to which its own information is retained, balancing its own information with that of its neighbors. It is recommended to set it to 1.0. Indicates the first The node at the th Layer node representation; This represents the weighted representation of the node itself, used to preserve the original information of the node and prevent neighbor information from becoming overly dominant. The structure modulation factor is used to perform a nonlinear transformation based on the degree difference between neighboring nodes and the node itself. If the structure centrality of a neighboring node is higher than that of the node itself, the structure modulation factor approaches 1, indicating that neighbor information should be emphasized; conversely, the structure modulation factor approaches 0. The formula for calculating the structure modulation factor is: , in, This represents the adjustment coefficient, selected through cross-validation, and its value range is [value range missing]. ; Indicates the first The degree of the nth node is used to reflect the degree of the nth node. The structural centrality of a node, i.e., the structural centrality of its neighboring nodes; Indicates the first The degree of the nth node is used to reflect the degree of the nth node. Structural centrality of each node ; Indicates the first The node and the first The degree difference of each node.
[0037] Repeat the improved graph neural network propagation process described above. Next, complex semantic associations are captured, such as "Yin deficiency with internal heat → Qi deficiency → Blood stasis → Baicalein", to obtain the node representation set after the improved graph neural network propagation.
[0038] Furthermore, based on the heterogeneous directed graph and the node representation set after propagation by the improved graph neural network, a breadth-first search algorithm is used. Starting from each node labeled "syndrome," that is, from each syndrome node, the algorithm traverses through several intermediate nodes to reach the node labeled "effective components of traditional Chinese medicine," that is, the effective components of traditional Chinese medicine node. This process iterates through all possible paths in the heterogeneous directed graph, with a length not exceeding [a certain value]. and guarantee ,in, This represents the maximum allowed path length from the syndrome node to the effective component node of traditional Chinese medicine. Determined through expert experience; This represents the maximum number of layers in the improved graph neural network. The path types are determined through expert experience. During the traversal, the start and end point types of the path are checked to ensure that the start point is a syndrome node and the end point is a node containing effective components of traditional Chinese medicine. Intermediate nodes can be either syndrome nodes or nodes containing effective components of traditional Chinese medicine. A set of candidate paths is output, where each path is a sequence of nodes from a syndrome node to a node containing effective components of traditional Chinese medicine.
[0039] Based on the candidate path set and the node representation set after propagation by the improved graph neural network, for each path, the updated node representations of the start and end points are extracted, and the dot product similarity is calculated. The dot product similarity is calculated using the vector inner product and reflects the semantic relevance of the two updated nodes after propagation. For example, a high dot product similarity between "yin deficiency and internal heat" and "baicalin" may indicate a strong pharmacological association. For paths connecting the same syndrome-effective component pair of traditional Chinese medicine, the average dot product similarity is calculated to obtain the path score. The formula for calculating the path score is: , in, Indicates the first The node to the first The path score for each node, i.e., the path score from the starting point to the end point; Indicates the first Path; , They represent the first The node and the first The node at the th Layer node representation; Indicates the first The dot product similarity of the paths is used to quantify the semantic relevance from the starting point to the ending point; This represents the total number of paths connecting the same syndrome-effective component pair in traditional Chinese medicine. .
[0040] Set a scoring threshold; paths with scores higher than the threshold are retained; output a set of causal paths. ,in, Indicates the first The node to the first The path of each node. Indicates the first The type marker of each node, Indicates the first The type marker of each node, This indicates the scoring threshold, which is set based on expert experience.
[0041] By using type constraints and path scoring mechanisms, invalid paths, such as "effective components of traditional Chinese medicine → syndrome", are eliminated to ensure that the paths conform to pharmacological logic and improve the scientific nature of the knowledge graph.
[0042] A knowledge graph is constructed by using the paths in the causal path set as the edge set and the embedded vector set as the node set. When a new batch of TCM clinical records arrives, the aforementioned steps are immediately invoked to perform semantic mapping and path deduction on the new data, generating a new node set and a new edge set. The original node set and the new node set are then joined to obtain an expanded node set. Simultaneously, the original edge set and the new edge set are joined to form an expanded edge set. This union operation simulates the "cumulative growth" of knowledge, reflecting the openness and inclusiveness of the TCM knowledge system.
[0043] In summary, a method for constructing a knowledge graph linking syndromes and effective components of traditional Chinese medicine has been completed.
[0044] The order of the embodiments is for illustrative purposes only and does not represent the superiority or inferiority of the embodiments. The processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0045] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0046] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for constructing a syndrome-traditional Chinese medicine effective component association knowledge graph, characterized in that, Includes the following steps: S1. Extract features from the syndrome data in the collected syndrome dataset and the effective components data in the Chinese herbal medicine dataset to obtain the semantic feature vector of the syndrome and the molecular fingerprint feature vector of the effective components of Chinese herbal medicine; map the semantic feature vector of the syndrome and the molecular fingerprint feature vector of the effective components of Chinese herbal medicine to obtain the embedding vector set; construct a heterogeneous directed graph based on the embedding vector set. S2. Based on heterogeneous directed graphs, output a set of causal paths through a causal path inference algorithm; construct a knowledge graph based on the set of causal paths; update the knowledge graph based on the new TCM clinical record data obtained. 2.The method of claim 1, wherein, S1 specifically includes: Based on the embedding vectors in the embedding vector set, calculate the cosine similarity; based on the cosine similarity, obtain the neighboring nodes of the node.
3. The method for constructing a syndrome-effective component association knowledge graph according to claim 2, characterized in that, S1 specifically includes: Based on neighbor nodes, a heterogeneous directed graph is constructed. The nodes of the heterogeneous directed graph are embedded vectors in the set of embedded vectors, the edges are the neighbor relationships between nodes and their neighboring nodes, and the edge weights are cosine similarity.
4. The method for constructing a syndrome-effective component association knowledge graph according to claim 1, characterized in that, S2 specifically includes: In the causal path deduction algorithm, based on a heterogeneous directed graph, the node representations are updated through an improved graph neural network to obtain the set of node representations after the improved graph neural network propagation.
5. The method for constructing a syndrome-effective component association knowledge graph according to claim 4, characterized in that, S2 specifically includes: Based on the set of node representations after propagation from a heterogeneous directed graph and an improved graph neural network, a set of candidate paths is output.
6. The method for constructing a syndrome-effective component association knowledge graph according to claim 5, characterized in that, S2 specifically includes: Based on the candidate path set and the node representation set after propagation by the improved graph neural network, for each path, the updated node representations of the start and end points are extracted, and the dot product similarity is calculated.
7. The method for constructing a syndrome-effective component association knowledge graph according to claim 6, characterized in that, S2 specifically includes: Based on dot product similarity, a path score is calculated; based on the path score, a set of causal paths is output.
8. The method for constructing a syndrome-effective component association knowledge graph according to claim 7, characterized in that, S2 specifically includes: A knowledge graph is constructed by using the set of causal paths as the set of edges and the set of embedded vectors as the set of nodes.
