Knowledge graph-based typhoid theory teaching method
By using classical Chinese contextual semantic modeling and comparative learning, a knowledge graph-based teaching method for the Treatise on Febrile Diseases was constructed. This method solved the problem of conflicting multi-source data fusion in the teaching of the classic Chinese medicine text, the Treatise on Febrile Diseases, and achieved terminology disambiguation and logical consistency detection. It also generated dynamic teaching paths, thereby improving teaching quality and learning experience.
Patent Information
- Application Number
- CN202511611450.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-03-24
AI Technical Summary
Existing knowledge graph technology has limitations in its application to the teaching of the classic Chinese medicine text "Shang Han Lun". It lacks sufficient modeling capabilities, cannot effectively resolve conflicts in the fusion of multi-source data, and lacks deep knowledge reasoning capabilities, resulting in teaching resources being unable to dynamically adapt to the generation of personalized paths for different scenarios.
By using classical Chinese contextual semantic modeling and comparative learning, a knowledge graph-based teaching method for the Treatise on Febrile Diseases is constructed. This method achieves terminology disambiguation and semantic conflict detection. Furthermore, version tracing and confidence propagation strategies are introduced to optimize the quality and reliability of the knowledge graph and generate a logically sound teaching path chain.
It achieves precise disambiguation of terms in ancient Chinese medicine texts, reduces knowledge errors caused by polysemy, improves the quality and reliability of knowledge graphs, enables clear tracing of knowledge sources, provides an immersive and reasoning-based intelligent teaching experience, and significantly enhances the effectiveness of clinical thinking training.
Smart Images

Figure CN121724017A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of sampling devices, in particular to a teaching method for Treatise on Febrile Diseases based on a knowledge graph. BACKGROUND
[0002] As a Chinese medicine classic, the teaching and research of Treatise on Febrile Diseases has long been facing the following challenges: Version ambiguity: Different understandings and annotations of the provisions by annotators of different dynasties form multi-source heterogeneous data, and single-version teaching may lead to one-sided knowledge. Term polysemy: The same symptom term (such as "fussy" and "dizzy") in ancient Chinese has different meanings in different contexts, and traditional methods are difficult to accurately represent, which may cause misunderstandings of learners. Knowledge inconsistency: There are potential logical conflicts between knowledge items from different sources (such as incompatible prescription and syndrome, and incompatible pulse and symptoms), which are difficult to correct manually and may be easily overlooked. Teaching path solidification: Existing digital teaching resources lack deep knowledge reasoning ability, and cannot dynamically generate personalized paths for different teaching scenarios (such as self-study, review, and examination) according to the internal logic of knowledge.
[0003] Existing knowledge graph technology makes it possible to represent Chinese medicine knowledge in a structured way, but there are still bottlenecks in direct application: First, there is a lack of modeling ability for specific semantic environment of ancient Chinese; second, the conflict problem in multi-source data fusion has not been effectively solved; finally, the constructed graph cannot efficiently support teaching applications with stable reasoning process and explainability. Therefore, the present application provides a teaching method for Treatise on Febrile Diseases based on a knowledge graph. SUMMARY
[0004] In view of the above technical deficiencies, the present application provides a teaching method for Treatise on Febrile Diseases based on a knowledge graph, which realizes accurate disambiguation of Chinese medicine ancient book terms through ancient Chinese context semantic modeling and contrastive learning, reduces knowledge errors caused by polysemy of a word; through an automatic detection mechanism for logical consistency constraint, it can effectively find and assist in correcting knowledge conflicts in multi-source data fusion, improving the quality and reliability of the knowledge graph; version tracing and belief propagation optimization strategy enables the finally constructed knowledge graph not only to integrate the essence of multiple versions, but also to clearly trace the knowledge source and evaluate the knowledge credibility; the teaching path chain generated based on the graph can dynamically simulate the whole process of Chinese medicine syndrome differentiation and treatment, providing learners with immersive and reasoning intelligent teaching experience; the technical problems raised in the background technology are solved.
[0005] To solve the above technical problems, the present application adopts the following technical scheme: The present application provides a teaching method for Treatise on Febrile Diseases based on a knowledge graph, comprising: S1: Multi-version data acquisition and standardization: acquiring the provisions and annotation data of multiple versions of Treatise on Febrile Diseases, structuring the data, and establishing a standardized raw data pool; S2: Ancient Chinese context semantic unit construction: Sentence segmentation and word segmentation are performed on the provisions, and context semantic units are constructed for representing symptoms, pulse terms in sentence or specific context window units; S3: Term semantic disambiguation based on contrastive learning: A neural network model is used to learn the vector representation of the same term in different context semantic units, and the specific sense of the term is distinguished and labeled through a contrastive learning strategy, completing the semantic disambiguation of the term; S4: Semantic conflict detection based on consistency constraints: Define the logical consistency constraint rules between prescriptions, syndromes and pulse, automatically detect semantic conflicts and mismerges that violate these rules during graph construction, and mark the conflict points; S5: Multi-source information fusion and graph optimization: Fuse the disambiguated terms and conflict information detected in S4, introduce a version tracing mechanism to record the source of the knowledge points, and use a confidence propagation algorithm to optimize and adjust the entity relationship weights in the conflict area, realizing multi-source graph alignment; S6: Teaching path generation: Based on the optimized knowledge graph, the semantic relationships and weights are used to automatically generate a teaching path chain with logical rationality and explainability, which is applied to simulated diagnosis and treatment teaching and self-adaptive evaluation control.
[0006] Preferably, the way of collecting provisions and annotation data of multiple versions of Shang Han Lun in S1 includes the following: Digital text acquisition: Obtain original text from professional databases, authoritative e-books or scanned PDFs through OCR; Application programming interface: Grab through API interface provided by the source party by programming; Manual input and proofreading: Manually input and proofread by domain experts; In S1, the data is structured and a standardized raw data pool is established; Specifically, the following steps are included: S11: Data cleaning and preprocessing: Standardize the text content, process variant characters and standardize punctuation marks; S12: General structured labeling: Use a custom XML tag set to deeply label the text; S13: Data storage and association: Establish a relational database or NoSQL database to store the standardized data.
[0007] Preferably, the specific process of S2 is as follows: S21: Target term identification and positioning: Based on the pre-defined core symptom and pulse word list of Shang Han Lun, scan and locate the occurrence position of all target terms in the XML content labeled in S12; S22: Context windowing: the entire sentence or a complete clause where the target term is located is taken as the minimum context window; if the basic unit information is insufficient, it is expanded to the entire article; S23: Structured information extraction of semantic units: a semantic unit is a structured JSON object.
[0008] Preferably, the specific process of S3 is as follows: S31: Building a semantic encoder: the backbone network uses a pre-trained language model as the basis; the key information in the semantic unit is spliced into a sequence text; the hidden state corresponding to the token is taken as the vector representation of the entire semantic unit; S32: Construction of positive and negative sample pairs: Construction of positive sample pairs: two different instances under the same sense of the same term; Construction of negative sample pairs: two instances of different senses of the same term or completely different term instances; S33: Contrastive loss function: using InfoNCE Loss as the contrastive loss function, maximizing the similarity of positive sample pairs and minimizing the similarity of negative sample pairs; S34: Clustering sense and generating dictionary: S341: Using the trained encoder to generate semantic vectors for all term instances; S342: Unsupervised clustering is performed on each semantic vector, and each clustering cluster corresponds to a potential sense of the term; S343: Check the co-occurring entities of the instances in each clustering cluster, extract the most common and most significant features as the automatic label of the sense; provide an interface for TCM experts to review the clustering results, modify the automatic label to a professional term, and merge or split unreasonable clusters; S344: Each sense uses the centroid of all vectors in its clustering cluster as the prototype vector of the sense, and stores it in the term sense dictionary; S35: Term disambiguation: when encountering a new term, use S2 to construct a structured semantic unit for the new term; use the trained encoder to encode the structured semantic unit into a vector $v_{\text{new}}$; calculate the similarity between $v_{\text{new}}$ and the prototype vectors of all senses of the term in the "term sense dictionary"; select the sense with the highest similarity as the disambiguation result.
[0009] Preferably, the specific process of S4 is as follows: S41: Define the prescription-evidence consistency constraint: if prescription A is indicated for syndrome B, then the probability of the appearance of prescription A in the context of syndrome B should be extremely high; on the contrary, if a prescription A is contraindicated in syndrome C, then the two should not have an indication relationship; S42: Define the pulse-symptom consistency constraint: A specific symptom must be associated with a specific range of pulse symptoms; S43: Avoiding drug-formula functional conflicts: The overall efficacy of a formula should be roughly consistent with the medicinal properties of its constituent drugs; S44: Employ a rule-based reasoning engine based on Datalog or graph queries to write formalized rules into query statements that the engine can execute; S45: For each consistency constraint rule, perform the following loop to check: Scan the graph to find all combinations of entities and relationships that satisfy the preconditions of the rules; for each instance found, check whether the consequent of the rule is true; if not, mark it as a conflict; record the conflict information in detail in the conflict report. S46: Utilize the semantic vectors generated by S3; if the cosine similarity of the context semantic vectors of two merged entities is lower than the threshold, it indicates that a "false merger" may have occurred; or check whether the main relational neighbors of the merged entities are significantly different. If the difference is significant, it indicates that a "false merger" may have occurred.
[0010] Preferably, the specific process of S5 is as follows: S51: Construct a version tracing mechanism: In the graph schema design, add a source attribute to each entity and relationship; this attribute records all tracing versions that support this fact and their frequency of occurrence; S52: Develop a confidence propagation strategy: S521: Define the knowledge graph as a factor graph, which includes variable nodes and factor nodes; variable nodes represent facts for calculating confidence; factor nodes represent consistency constraint rules, connect related variable nodes, and define the logical relationships between variable nodes. S53: Assign an initial confidence level to each variable node based on version traceability information; S54: Message passing mechanism: The variable node sends its current confidence level to the connected factor node; the factor node calculates a new set of confidence level messages based on its logical constraints and sends them back to its connected variable node. S55: Update mechanism: Variable nodes update their confidence values based on all messages received from factor nodes; S56: Iterative convergence: Repeat steps S54 and S55 until the confidence change of all nodes is less than the critical value, which is a constant close to zero. S57: Confidence-based decision-making and resolution: After confidence propagation is completed, the graph is cleaned up for the final stage. S58: Storage and display of optimized post-map.
[0011] Preferably, the specific process of S6 is as follows: Define the path cost function (f(n) = g(n) + h(n)); Where g(n) is defined as the number of steps already traversed; h(n): A heuristic function is designed using the semantic distance between nodes in the knowledge graph, as follows: If two nodes are on the same knowledge branch, they are relatively close; the closeness of the relationship is determined by the number of common neighbors between nodes; the minimum number of hops between nodes is pre-calculated as an estimate.
[0012] The beneficial effects of this invention are as follows: This invention achieves precise disambiguation of terms in ancient Chinese medical texts through contextual semantic modeling and comparative learning, reducing knowledge errors caused by polysemy. An automatic detection mechanism based on logical consistency constraints effectively identifies and assists in correcting knowledge conflicts in multi-source data fusion, improving the quality and reliability of the knowledge graph. Version tracing and confidence propagation optimization strategies ensure that the final knowledge graph not only integrates the essence of multiple versions but also clearly traces the source of knowledge and assesses its credibility. The teaching path chain generated based on the graph dynamically simulates the entire process of TCM syndrome differentiation and treatment, providing learners with an immersive and reasoning-based intelligent teaching experience, significantly improving the effectiveness of clinical thinking training. Attached Figure Description
[0013] 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.
[0014] Figure 1 A flowchart illustrating a knowledge graph-based teaching method for the Treatise on Febrile Diseases, provided as an embodiment of the present invention. Detailed Implementation
[0015] 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. Example
[0016] like Figure 1 As shown, this invention provides a knowledge graph-based teaching method for the Treatise on Febrile Diseases, including: S1: Multi-version data collection and standardization: Collect text and annotation data from multiple versions of the "Treatise on Febrile Diseases", perform structured processing on the data, and establish a standardized raw data pool; S2: Construction of Classical Chinese Contextual Semantic Units: Segment and word segment the text, and construct contextual semantic units to represent symptoms and pulse diagnosis terms, using sentences or specific context windows as units; S3: Term semantic disambiguation based on contrastive learning: Using a neural network model, the vector representation of the same term in semantic units of different contexts is learned. Through contrastive learning strategy, the specific meanings of the term are distinguished and labeled to complete the semantic disambiguation of the term. S4: Semantic conflict detection based on consistency constraints: Define logical consistency constraint rules between prescription, syndrome, and pulse, automatically detect semantic conflicts and mis-merging that violate these rules during the graph construction process, and mark the conflict points; S5: Multi-source information fusion and graph optimization: The disambiguation terms of the fusion terms are fused with the conflict information detected by S4. A version tracing mechanism is introduced to record the source of knowledge points, and a confidence propagation algorithm is used to optimize and adjust the entity relationship weights in the conflict areas to achieve multi-source graph alignment. S6: Teaching Path Generation: Based on the optimized knowledge graph, using its semantic relationships and weights, a teaching path chain with logical rationality and interpretability is automatically generated, which is applied to simulated diagnosis and treatment teaching exercises and adaptive assessment and control.
[0017] Through semantic modeling and comparative learning of classical Chinese context, precise disambiguation of terms in ancient Chinese medicine texts was achieved, reducing knowledge errors caused by polysemy. An automatic detection mechanism based on logical consistency constraints effectively identified and assisted in correcting knowledge conflicts in multi-source data fusion, improving the quality and reliability of the knowledge graph. Version tracing and confidence propagation optimization strategies ensured that the final knowledge graph not only integrated the essence of multiple versions but also clearly traced the source of knowledge and assessed its credibility. The teaching path chain generated based on the graph dynamically simulated the entire process of TCM syndrome differentiation and treatment, providing learners with an immersive and reasoning-based intelligent teaching experience, significantly improving the effectiveness of clinical thinking training.
[0018] Furthermore, the methods used in S1 to collect textual and annotation data from multiple versions of the *Shanghan Lun* include the following: Digital text acquisition: Obtaining original text from professional databases, e-books from authoritative publishers, or through OCR and scanned PDFs; professional databases include classics such as the Basic Chinese Ancient Books Database and the Chinese Medical Encyclopedia; Application Programming Interface (API): Data is retrieved programmatically from APIs provided by the source. Manual data entry and proofreading: For a small number of scarce resources, data is entered manually and then proofread a second time by domain experts; Structured processing of the data is performed in S1 to establish a standardized original data pool; specifically, it includes the following: S11: Data cleaning and preprocessing: Unify the complexity and simplicity of the text content, process variant Chinese characters, and standardize punctuation marks; S12: General structured markup: Use a custom XML tag set to deeply annotate the text; Key tag explanations: · <Article ID>: The unique identifier for each article, including version information; · <Original text>: Wraps the original content of Zhang Zhongjing's articles; · <Number>: Article serial number; · <Content>: Text content; · <Annotation>: Annotations by later medical experts, indicating the annotator with the source attribute; · <Prescription>: Prescription composition and decoction method; · <Traditional Chinese medicine>, <Dosage>: Mark the drug name and dosage; · Internal tags: In <Content>, use embedded tags such as <Prescription>, <Symptom>, <Pulse condition> to preliminarily mark key entities to facilitate subsequent knowledge extraction.
[0019] S13: Data storage and association: Establish a relational database, such as MySQL / PostgreSQL or a NoSQL database, to store the standardized data; examples are as follows: Data table design: · Article main table (Article ID, version source, original text, XML after annotation) · Annotation table (Annotation ID, Article ID, annotator, annotation content) · Prescription table (Prescription ID, Article ID, prescription name, composition JSON, decoction method) · Drug table (Drug ID, drug name, standardized name).
[0020] Furthermore, the specific process of S2 is as follows: S21: Target term identification and location: Based on the predefined core symptom and pulse condition vocabulary of Treatise on Febrile Diseases, scan and locate the occurrence positions of all target terms in the XML content annotated in S12; for example, in the article <Content>... Those who sweat <Symptom>have aversion to wind< / Symptom>, Cinnamon Twig Decoction plus Aconite is the master formula;< / Content>, the term "aversion to wind" is located.
[0021] S22: Context window definition: The entire sentence or a complete clause containing the target term is used as the minimum context window; if the information content of the basic unit is insufficient, it is expanded to the entire article, that is: the content within the <original text> tag); for terms whose meaning is highly dependent on the annotations, the corresponding <annotation> content can also be included in the context.
[0022] S23: Structured Information Extraction of Semantic Units: A semantic unit is a structured JSON object containing the following fields: json { "target_term": "bad wind", / / Target term "original_text": "In cases of Taiyang disease, if sweating occurs but leakage does not stop, and the patient experiences aversion to wind, difficulty urinating, and slight stiffness in the limbs making it difficult to bend or stretch, Guizhi Jia Fuzi Tang (Cinnamon Twig Decoction with Aconite) is the main treatment." / / The complete original text "context_snippet": "The person experiences aversion to wind, difficulty urinating, and slight limb stiffness", / / nearest context snippet "co_occurrence_entities": { / / Co-occurrence entities (extracted from XML tags and NLP) "symptoms": ["profuse sweating", "difficulty urinating", "slight stiffness in limbs, difficulty bending and stretching"], / / co-occurring symptoms "pulse": [], / / Co-occurring pulse characteristics (not found in this entry) "formulas": ["Guizhi Jia Fuzi Tang"], / / Co-occurring formulas "syndrome_patterns": ["Taiyang disease with yang deficiency and spontaneous sweating syndrome"], / / Co-occurring syndromes (can be annotated using posterior knowledge) "pathomechanism": ["Deficiency of exterior qi and lack of consolidation, deficiency of yang and depletion of body fluids"] / / Co-occurring pathogenesis (can be annotated using posterior knowledge) }, "source_document": { / / Source information "text_id": "S21", "version": "Song edition", "line_number": 21 }, "syntax_relation": [] / / Syntactic relations (optional advanced features, such as obtaining the modification relations between the target term and verbs and negations through dependency parsing) }
[0023] Furthermore, the specific process of S3 is as follows: S31: Construct a semantic encoder: The backbone network uses a pre-trained language model as the basis, such as BERT and RoBERTa; splice the key information in the semantic unit into a sequence text; for example: [CLS] Target term: aversion to wind [SEP] Context: The person has aversion to wind, difficult urination, and slightly cramped limbs [SEP] Co-occurring prescription: Guizhi plus Fuzi Decoction [SEP] Pathogenesis: deficiency of superficial resistance; take the hidden state corresponding to the token as the vector representation of the entire semantic unit; S32: Construction of positive and negative sample pairs: Construction of positive sample pairs: Two different instances under the same sense of the same term; for defining the same sense: in an unsupervised or weakly supervised setting, we assume that instances with highly similar co-occurring entities are more likely to belong to the same sense; for example, two instances of "vexation" both having "Zhizi Chi Decoction" form a positive sample pair; Construction of negative sample pairs: Two instances of different senses of the same term or instances of completely different terms; for example, one "vexation" co-occurring with "Zhizi Chi Decoction" and one "vexation" co-occurring with "Wuling Powder" form a negative sample pair; or for example, one instance of "vexation" and one instance of "syncope"; S33: Contrastive loss function: Use InfoNCE Loss as the contrastive loss function to maximize the similarity of positive sample pairs and minimize the similarity of negative sample pairs; Its formula: $L = -\log \frac{\exp(\text{sim}(v_i, v_j) / \tau)}{\sum_{k=1}^{N} \exp(\text{sim}(v_i, v_k) / \tau)}$ Where: · $v_i$ (anchor) and $v_j$ (positive) are the vectors of the positive sample pair; · $\text{sim}$ is the cosine similarity function; · $\tau$ is the temperature hyperparameter that controls the sharpness of the distribution; · The denominator term contains the similarities of one anchor and multiple negative samples.
[0024] S34: Cluster senses and generate a dictionary: S341: Use the trained encoder to generate semantic vectors for all term instances; S342: Perform unsupervised clustering on each semantic vector, such as using the DBSCAN or K-means algorithm, and each cluster corresponds to a potential sense of the term; S343: Examine the common entities of instances within each cluster, such as prescriptions and pathogenesis; extract the most common and prominent features as automatic labels for the meaning, such as "irritability related to Gardenia and Fermented Soybean Decoction"; provide an interface for TCM experts to review the clustering results, correct the automatic labels to professional terms, such as "irritability due to deficiency", and merge or split unreasonable clusters. S344: Each sense uses the centroid of all vectors in its cluster, i.e., the average vector, as the prototype vector of that sense and stores it in the term sense dictionary. S35: Term Disambiguation: When encountering a new term, the S2 method is used to construct a structured semantic unit for the new term; the trained encoder is used to encode the structured semantic unit into a vector $v_{\text{new}}$; the similarity between $v_{\text{new}}$ and the prototype vectors of all senses of the term in the "Term Sense Dictionary" is calculated; the sense with the highest similarity is selected as the disambiguation result.
[0025] Furthermore, the specific process of S4 is as follows: S41: Define the consistency constraint between prescription and syndrome: If prescription A is indicated for syndrome B, then prescription A should have a very high probability of appearing in the context of a clause that indicates syndrome B; conversely, if a clause explicitly states that prescription A is contraindicated for syndrome C, then the two should not be established as indicative of each other. Example of conflict: A commentary states that "Guizhi Tang can be used to treat Yangming disease"; however, according to the core theory, Guizhi Tang is the main prescription for Taiyang disease with exterior deficiency syndrome, while Yangming disease is an interior heat excess syndrome, and the two diseases have opposite characteristics; this knowledge will trigger a conflict alert. • Formalizing the rules: • IF: (Formula A) - [Indications] -> (Symptom B) AND (Article C) - [Contains] -> (Symptom B) THEN: (Article C) should most likely [Contain] (Formula A); • IF: (Formula A) - [Contraindications] -> (Symptom B) THEN: NOT (Formula A) - [Indications] -> (Symptom B); S42: Define the pulse-symptom consistency constraint: a specific symptom must be associated with a specific range of pulse characteristics; for example, floating pulses are often seen in the three Yang diseases, while deep pulses are often seen in the three Yin diseases. A strong, forceful pulse should not be seen in a deficiency-cold syndrome. Example of a conflict: A passage describing "Shaoyin Yin deficiency and Yin excess syndrome" (Si Ni Tang syndrome) states "floating pulse." This seriously conflicts with the basic principles of "Shaoyin disease, weak and thready pulse, and drowsiness" and "deep pulse." The system should identify this as a potential error or an anomaly requiring special explanation. • Formalizing the rules: • IF: (Symptom A) - [with typical pulse characteristics] -> (Pulse Characteristics B) THEN: In the text where (Symptom A) appears, there should be a high probability that (Pulse Characteristics B) or a similar pulse is mentioned; • IF: (Symptom A) - [with typical pulse characteristics] -> (Pulse characteristics B) AND (Symptom A) - [NOT with typical pulse characteristics] -> (Pulse characteristics C) THEN: (Article D contains syndrome A) and (Article D mentions pulse characteristics C) occurring simultaneously is a low-probability event, triggering a conflict.
[0026] S43: Avoiding functional conflicts between drugs and prescriptions: The overall efficacy of a prescription should be roughly consistent with the properties of its constituent drugs; for example, a prescription labeled as "clearing heat" should contain mostly cold drugs and should not contain a large number of warm drugs. • Conflict example: A formula marked as having the effect of clearing heat and promoting body fluid production contains a large number of hot herbs such as "acupuncture" and "dried ginger", but lacks core heat-clearing herbs such as "gypsum" and "anemarrhena", thus triggering a conflict; • Formalizing the rules: • IF: (Formula A) - [Efficacy] -> (Efficacy B) AND (Traditional Chinese Medicine C) - [Belongs to] -> (Formula A) THEN: The [Medicinal Properties] of (Traditional Chinese Medicine C) should not conflict with (Efficacy B).
[0027] S44: Employ a rule-based reasoning engine based on Datalog or graph queries to write formalized rules into query statements that the engine can execute; S45: For each consistency constraint rule, perform the following loop to check: Scan the graph to find all combinations of entities and relationships that satisfy the preconditions of the rules. For example, for the formula-symptom rule, find all (formula)-[indication]->(symptom) relationship pairs. For each instance found, check whether the consequent of the rule is true; if not, mark it as a conflict; for example, check whether there is strong evidence from authoritative sources to support the relationship (Guizhi Tang) - [Indications] -> (Yangming Disease), or whether there is evidence of contraindication. Record conflict information in detail in the conflict report; each conflict record should include the following information: json { "conflict_id": "CONF-20231027-001", "rule_violated": "Evidence-proof consistency constraint rule (Rule_FZ_01)", "conflicting_entities": {"id": "F-001", "name": "Guizhi Decoction", "type": "Formula", "source": "Version X, Annotation Y"}, {"id": "S-202", "name": "Yangming Disease", "type": "Syndrome", "source": "Version X, Annotation Y"} , "conflicting_relation": {"from": "F-001", "to": "S-202", "type": "主治"}, "evidence": { "counter_evidence": ["Article YYY in Song Edition states that Guizhi Decoction is contraindicated in...", "Authoritative annotator ZZZ believes that..."], "supporting_evidence": ["Original text citation from Annotation Y of Version X"] }, "severity_level": "HIGH" / / Severity level of the conflict (HIGH, MEDIUM, LOW) } S46: Utilize the semantic vectors generated by S3; if the cosine similarity of the context semantic vectors of two merged entities, such as two different versions of "restlessness of mind", is lower than the threshold, it indicates that "incorrect merging" may have occurred; Or check whether the main relationship neighbors of the merged entities are significantly different. If they are significantly different, it indicates that "incorrect merging" may have occurred; for example, one version of "restlessness of mind" is mainly associated with "Zhizi Chi Decoction", while the other version of "restlessness of mind" is mainly associated with "Wuling Powder", then these two "restlessness of mind" should not be merged.
[0028] Furthermore, the specific process of S5 is as follows: S51: Build a version tracing mechanism: In the graph pattern design, add a source attribute to each entity and relationship; this attribute records all the traced versions that support this fact and their occurrence frequencies; For example: "sources": { "Song Edition": 1, "Annotated Treatise on Cold Damage Disorders": 1, "Collection of Commentaries on Cold Damage Disorders": 1}; It immediately provides a measure of support; a relationship supported by numerous authoritative versions naturally has a higher initial credibility. S52: Develop a confidence propagation strategy: S521: Define the knowledge graph as a factor graph, which contains variable nodes and factor nodes; the variable nodes represent facts for calculating confidence, such as whether the relation "R: (Guizhi Tang) - [Indications] -> (Taiyang Zhongfeng Syndrome)" is true; Factor nodes represent consistency constraint rules, connect related variable nodes, and define the logical relationships between variable nodes; S53: Assign an initial confidence level to each variable node based on version tracing information; for example, a relation supported by 3 versions has an initial confidence level of 0.9, while a relation supported by only 1 marginal version has an initial confidence level of 0.3. S54: Message passing mechanism: The variable node sends its current confidence level to the connected factor node; the factor node calculates a new set of confidence level messages based on its logical constraints and sends them back to its connected variable node. For example, a "formula-symptom consistency" factor node receives a high confidence level for "formula A treats syndrome B" and a high confidence level for "syndrome B has pulse C", but receives a medium confidence level for "article D contains syndrome B and mentions pulse C". According to the rules, this factor node will lower the confidence level of the third fact and raise the confidence level of the first two facts as support.
[0029] S55: Update mechanism: Variable nodes update their confidence values based on all messages received from factor nodes; S56: Iterative convergence: Repeat steps S54 and S55 until the confidence change of all nodes is less than the critical value, which is a constant close to zero. In this embodiment, the constant is set to 0.01. S57: Confidence-based decision-making and resolution. After confidence propagation is completed, the graph is cleaned up in the final stage, as follows: High confidence retention: Relationships with confidence levels higher than a set threshold (e.g., 0.8) are retained as core knowledge in the backbone graph; Low confidence removal: For relationships with extremely low confidence (e.g., <0.2), they are directly removed from the backbone plot or marked as deprecated; Medium confidence level handling: For conflicting knowledge with medium confidence (e.g., 0.4-0.7), instead of simply deleting it, a more advanced strategy is adopted: Entity split: If the conflict stems from the “mistaken merger” mentioned in S3, then entity split is performed; For example, the single node "anxiety" can be split into two nodes: "anxiety (heat)" and "anxiety (water retention)," and relationships from different sources can be assigned to them respectively; Additional evidence annotation: Record detailed information about both conflicting parties in the relationship attribute. For example, on the relationship (Guizhi Tang) - [Indications?] -> (Yangming Disease), add `conflicting_evidence: True` and link it to the detailed conflict report generated by S4. This presents academic disputes transparently to the user.
[0030] S58: Optimized storage and display of the post-map. Examples of node attributes: json { "id": "Symptom-1024", "name": "feeling upset" "type": "Symptom", "semantic_cluster_id": "VEX-01", / / Points to the S3 semantic ID "source_attribution": {"Song edition": 5, "Kangping edition": 3, "Annotations on the Treatise on Cold Damage": 4}, "confidence_score": 0.95 } • Example of edge relationship attributes: json { "from": "Formula-001", "to": "Syndrome-202", "type": "Indications", "source_attribution": {"Song edition": 1, "Annotations on the Treatise on Febrile Diseases": 1}, / / Supported by two sources "confidence_score": 0.75, / / Score after confidence propagation "conflict_flag": false, "additional_notes": "This relationship is also found in 'XX Medical Cases'...".
[0031] Furthermore, the specific process of S6 is as follows: Define the path cost function (f(n) = g(n) + h(n)); Where g(n) is defined as the number of steps already traversed; h(n): A heuristic function is designed using the semantic distance between nodes in the knowledge graph, as detailed below: If two nodes are on the same knowledge branch, they are relatively close; the closeness of the relationship is determined by the number of common neighbors between nodes; the minimum number of hops between nodes is pre-calculated as an estimate.
[0032] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A teaching method for the Treatise on Febrile Diseases based on knowledge graphs, characterized in that, include: S1: Multi-version data collection and standardization: Collect text and annotation data from multiple versions of the "Treatise on Febrile Diseases", perform structured processing on the data, and establish a standardized raw data pool; S2: Construction of Classical Chinese Contextual Semantic Units: Segment and word segment the text, and construct contextual semantic units to represent symptoms and pulse diagnosis terms, using sentences or specific context windows as units; S3: Term semantic disambiguation based on contrastive learning: Using a neural network model, the vector representation of the same term in semantic units of different contexts is learned. Through contrastive learning strategy, the specific meanings of the term are distinguished and labeled to complete the semantic disambiguation of the term. S4: Semantic conflict detection based on consistency constraints: Define logical consistency constraint rules between prescription, syndrome, and pulse, automatically detect semantic conflicts and mis-merging that violate these rules during the graph construction process, and mark the conflict points; S5: Multi-source information fusion and graph optimization: The disambiguation terms of the fusion terms are fused with the conflict information detected by S4. A version tracing mechanism is introduced to record the source of knowledge points, and a confidence propagation algorithm is used to optimize and adjust the entity relationship weights in the conflict areas to achieve multi-source graph alignment. S6: Teaching Path Generation: Based on the optimized knowledge graph, using its semantic relationships and weights, a teaching path chain with logical rationality and interpretability is automatically generated, which is applied to simulated diagnosis and treatment teaching exercises and adaptive assessment and control.
2. The teaching method for Treatise on Febrile Diseases based on knowledge graphs as described in claim 1, characterized in that, The methods for collecting textual and annotation data from multiple versions of the *Shanghan Lun* in S1 include the following: Digital text acquisition: Obtaining original text from professional databases, e-books from authoritative publishers, or through OCR and scanned PDFs; Application Programming Interface (API): Data is retrieved programmatically from APIs provided by the source. Manual data entry and proofreading: Data is entered manually and then proofread a second time by domain experts; S1 performs structured processing on the data to establish a standardized raw data pool; specifically, this includes the following: S11: Data cleaning and preprocessing: unifying simplified and traditional Chinese text content, handling variant characters, and standardizing punctuation marks; S12: General Structured Markup: Deep annotation of text using a custom set of XML tags; S13: Data storage and association: Establish relational databases or NoSQL databases to store standardized data.
3. The teaching method for Treatise on Febrile Diseases based on knowledge graphs as described in claim 2, characterized in that, The specific process of S2 is as follows: S21: Target term identification and localization: Based on the predefined list of core symptoms and pulse patterns in the Treatise on Febrile Diseases, scan and locate the occurrence of all target terms in the XML content annotated in S12; S22: Context window definition: The entire sentence or a complete clause containing the target term is used as the minimum context window; if the information content of the basic unit is insufficient, it is expanded to the entire clause; S23: Structured information extraction of semantic units: A semantic unit is a structured JSON object.
4. The teaching method for Treatise on Febrile Diseases based on knowledge graphs as described in claim 3, characterized in that, The specific process of S3 is as follows: S31: Constructing a semantic encoder: The backbone network uses a pre-trained language model as its foundation; key information in the semantic units is concatenated into a sequence of text; the hidden state corresponding to the label is taken as the vector representation of the entire semantic unit; S32: Construction of positive and negative sample pairs: Positive sample pair construction: two different instances of the same term under the same meaning; Negative sample pair construction: two instances of different meanings of the same term or completely different instances of the term; S33: Contrastive Loss Function: InfoNCE Loss is used as the contrastive loss function to maximize the similarity of positive sample pairs and minimize the similarity of negative sample pairs; S34: Clustering Entries and Dictionary Generation S341: Use the trained encoder to generate semantic vectors for all term instances; S342: Perform unsupervised clustering on each semantic vector, with each cluster corresponding to a potential meaning of the term; S343: Examine the common entities of instances within each cluster, extract the most common and prominent features as the automatic label for that meaning; provide an interface for TCM experts to review the clustering results, correct the automatic labels to professional terminology, and merge or split unreasonable clusters; S344: Each sense uses the centroid of all vectors within its cluster as the prototype vector of that sense and stores it in the term sense dictionary; S35: Term Disambiguation: When encountering a new term, the S2 method is used to construct a structured semantic unit for the new term; the trained encoder is used to encode the structured semantic unit into a vector $v_{\text{new}}$; the similarity between $v_{\text{new}}$ and the prototype vectors of all senses of the term in the "Term Sense Dictionary" is calculated; the sense with the highest similarity is selected as the disambiguation result.
5. The teaching method for Treatise on Febrile Diseases based on knowledge graphs as described in claim 1, characterized in that, The specific process of S4 is as follows: S41: Define the consistency constraint between prescription and syndrome: If prescription A is indicated for syndrome B, then prescription A should have a very high probability of appearing in the context of a clause that indicates syndrome B; conversely, if a clause explicitly states that prescription A is contraindicated for syndrome C, then the two should not be established as indicative of each other. S42: Define the pulse-symptom consistency constraint: A specific symptom must be associated with a specific range of pulse symptoms; S43: Avoiding drug-formula functional conflicts: The overall efficacy of a formula should be roughly consistent with the medicinal properties of its constituent drugs; S44: Employ a rule-based reasoning engine based on Datalog or graph queries to write formalized rules into query statements that the engine can execute; S45: For each consistency constraint rule, perform the following loop to check: Scan the graph to find all combinations of entities and relationships that satisfy the preconditions of the rules; for each instance found, check whether the consequent of the rule is true; if not, mark it as a conflict; record the conflict information in detail in the conflict report. S46: Utilize the semantic vectors generated by S3; if the cosine similarity of the context semantic vectors of two merged entities is lower than the threshold, it indicates that a "false merger" may have occurred; or check whether the main relational neighbors of the merged entities are significantly different. If the differences are significant, it indicates that a "false merger" may have occurred.
6. The teaching method for Treatise on Febrile Diseases based on knowledge graphs as described in claim 1, characterized in that, The specific process of S5 is as follows: S51: Construct a version tracing mechanism: In the graph schema design, add a source attribute to each entity and relationship; this attribute records all tracing versions that support this fact and their frequency of occurrence; S52: Develop a confidence propagation strategy: S521: Define the knowledge graph as a factor graph, which includes variable nodes and factor nodes; variable nodes represent facts for calculating confidence; factor nodes represent consistency constraint rules, connect related variable nodes, and define the logical relationships between variable nodes. S53: Assign an initial confidence level to each variable node based on version traceability information; S54: Message passing mechanism: The variable node sends its current confidence level to the connected factor node; the factor node calculates a new set of confidence level messages based on its logical constraints and sends them back to its connected variable node. S55: Update mechanism: Variable nodes update their confidence values based on all messages received from factor nodes; S56: Iterative convergence: Repeat steps S54 and S55 until the confidence change of all nodes is less than the critical value, which is a constant close to zero. S57: Confidence-based decision-making and resolution: After confidence propagation is completed, the graph is cleaned up for the final stage. S58: Storage and display of optimized post-map.
7. The teaching method for Treatise on Febrile Diseases based on knowledge graphs as described in claim 1, characterized in that, The specific process of S6 is as follows: Define the path cost function (f(n) = g(n) + h(n)); Where g(n) is defined as the number of steps already traversed; h(n): A heuristic function is designed using the semantic distance between nodes in the knowledge graph, as follows: If two nodes are on the same knowledge branch, they are relatively close; the closeness of the relationship is determined by the number of common neighbors between nodes; the minimum number of hops between nodes is pre-calculated as an estimate.
Citation Information
Cited By
Medical agent generation method, response method and device
CN121981151A