Traditional Chinese medicine auxiliary diagnosis method and system combining knowledge graph and thinking chain
By combining knowledge graphs and thought chains, this approach addresses the shortcomings of traditional Chinese medicine (TCM) big language models in terms of school of thought adaptation and diagnostic logic recognition. It constructs personalized knowledge graphs to generate logically clear and credible TCM auxiliary diagnostic suggestions, thereby improving the adaptability and accuracy of TCM diagnosis and treatment.
Patent Information
- Application Number
- CN202511670785.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-03-03
AI Technical Summary
The existing TCM big language model lacks diagnostic and treatment data from different schools of thought, resulting in a singular diagnostic and treatment approach, an inability to identify the underlying logical structure in TCM clinical problems, and a lack of personalized diagnostic and treatment thinking.
By combining knowledge graphs and thought chains, a large-scale language model is used to process TCM documents and clinical cases to generate medical logic triples and thought chain triples. Similar medical logic triples are retrieved, mapped to TCM document sets, and textual reasoning processes from questions to answers are generated. Entities and relationships are extracted to form a personalized knowledge graph, and model parameters are optimized to generate TCM-assisted diagnostic decision-making.
It improves the comprehensiveness and focus of TCM big language model in terms of school of thought adaptation and retrieval, constructs personalized knowledge graphs, makes up for the lack of medical reasoning data and personalized diagnosis and treatment thinking in the knowledge base, and generates logically clear and credible TCM auxiliary diagnosis suggestions.
Smart Images

Figure CN121601207A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph technology, and in particular to a method and system for auxiliary diagnosis in traditional Chinese medicine that combines knowledge graphs and thought chains. Background Technology
[0002] In recent years, general-purpose large language models have been applied in various medical specialties, demonstrating significant advantages over traditional deep learning models in medical natural language processing tasks due to their powerful semantic understanding capabilities. However, the performance of general-purpose large language models in the medical field still lags far behind expert levels, and they may output erroneous or misleading content due to "illusions." This problem is related to factors such as training data quality, model architecture, and training process, highlighting the necessity for further optimization of their performance in vertical medical fields.
[0003] Currently, the two main methods for improving the performance of large-scale language models in vertical domains are fine-tuning training and retrieval-enhanced generation (RAG). Fine-tuning training involves further training an already trained model with more data to adjust its internal parameters, making the model's output more consistent with expectations. RAG combines information retrieval and text generation, with a core process consisting of two steps: first, retrieving relevant text fragments from an external knowledge base based on user input, using vectorized representations and semantic matching with a vector database; second, inputting the user query and retrieved content as context into the large model, which then generates the final answer.
[0004] Although fine-tuning and RAG have been widely implemented in medical settings, they face numerous challenges in the field of Traditional Chinese Medicine (TCM). On the one hand, existing TCM large-scale language models lack diagnostic and treatment data from different schools of thought, making it difficult to reflect the differences between schools in clinical practice. This often results in problems such as a singular approach to diagnosis and treatment and distortion of knowledge transfer. On the other hand, TCM clinical problems contain a large amount of underlying reasoning, and the embedding model can only match superficially similar texts, failing to identify underlying logical structures and lacking medical reasoning data and personalized diagnostic and treatment thinking. Summary of the Invention
[0005] In view of the shortcomings of the prior art, the purpose of this invention is to provide a TCM-assisted diagnostic method that combines knowledge graphs and thought chains. This method addresses two main issues: First, existing TCM large-scale language models lack diagnostic and treatment data from different schools of thought, making it difficult to reflect differences in clinical practice and often resulting in a singular diagnostic approach and distorted knowledge transfer. Second, TCM clinical problems contain a large amount of underlying reasoning, and embedded models can only match superficially similar text, failing to identify underlying logical structures and lacking medical reasoning data and personalized diagnostic and treatment thinking.
[0006] A first aspect of this invention proposes a TCM-assisted diagnostic method combining knowledge graphs and thought chains, comprising:
[0007] S1: Obtain a collection of TCM documents and clinical cases.
[0008] S2: Process TCM document sets and diagnosis and treatment cases through a large language model to generate medical logic triples and thought chain triples respectively.
[0009] S3: Search for medical logic triples that are similar to the thought chain triples in the existing public knowledge graph to identify relevant triples.
[0010] S4: Through mapping operations, determine the set of TCM documents corresponding to the relevant triples to obtain the target document set.
[0011] S5: For a given question, identify relevant text fragments from the target document set.
[0012] S6: Using aligned triples in relevant text fragments and the original document as context, a large language model is used to generate the reasoning process text from question to answer.
[0013] S7: Extract entities and relationships from the reasoning process text.
[0014] S8: Integrate the extracted entities and relationships into the existing public knowledge graph to form a personalized knowledge graph.
[0015] S9: Based on a personalized knowledge graph, generate TCM auxiliary diagnostic decision suggestions for real-time input questions.
[0016] In a second aspect, this invention proposes a TCM-assisted diagnostic system that combines knowledge graphs and thought chains, comprising a processor and a memory.
[0017] The memory stores programs or instructions that can run on the processor, and when the programs or instructions are executed by the processor, they implement the steps of the TCM auxiliary diagnostic method that combines knowledge graphs and thought chains, as described in the first aspect.
[0018] A third aspect of the present invention provides a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implements the steps of the TCM auxiliary diagnostic method combining knowledge graphs and thought chains as described in the first aspect.
[0019] The beneficial effects of the technical solutions provided by the embodiments of the present invention include at least the following:
[0020] In this embodiment of the invention, a Traditional Chinese Medicine (TCM) thought chain model was trained, which solved the problem of unifying the adaptation of TCM schools of thought, the comprehensiveness of retrieval, and the focus in RAG practice, thereby improving the comprehensiveness and focus of retrieval. Simultaneously, by combining a general knowledge graph with real-world cases, a personalized knowledge graph was constructed, further improving the quality of the RAG knowledge base and compensating for the lack of medical reasoning data and personalized diagnostic and treatment thinking in the knowledge base. Attached Figure Description
[0021] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0022] Figure 1 This is a flowchart illustrating a TCM-assisted diagnostic method that combines knowledge graphs and thought chains, as provided in an embodiment of the present invention.
[0023] Figure 2 This is a schematic diagram of the structure of a TCM auxiliary diagnostic system that combines knowledge graphs and thought chains, provided by an embodiment of the present invention. Detailed Implementation
[0024] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions 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, not all embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0025] The following description, in conjunction with the accompanying drawings, details the TCM auxiliary diagnostic method combining knowledge graphs and thought chains provided by the embodiments of the present invention through specific implementations and application scenarios.
[0026] Reference manual attached Figure 1 The diagram illustrates a flowchart of a TCM-assisted diagnostic method combining knowledge graphs and thought chains, provided by an embodiment of the present invention.
[0027] This invention provides a TCM-assisted diagnostic method combining knowledge graphs and thought chains, which may include the following steps:
[0028] S1: Obtain a collection of TCM documents and clinical cases.
[0029] S2: Process TCM document sets and diagnosis and treatment cases through a large language model to generate medical logic triples and thought chain triples respectively.
[0030] Among them, large-scale language models refer to generative large-scale language models that are adapted and optimized for knowledge and logic in the field of traditional Chinese medicine.
[0031] For example, large language models (LLMs) with knowledge extraction capabilities extract These models extract structured knowledge triplets in the form of "entity-relationship-entity" (e.g., "Yang deficiency-syndrome manifestation-aversion to cold") from TCM document collections. Their core function is to transform unstructured TCM theoretical texts into structured knowledge units. Large Language Models (LLMs) are used for deconstructing thought chains. decomp These models decompose clinical reasoning logic into triple sequences (such as the multi-step relationship of "symptom-sign-syndrome") from clinical cases. Their core function is to capture the potential logical structure of TCM syndrome differentiation and treatment and transform it into explicit thought chain triples.
[0032] In one possible implementation, the formula for calculating medical logic triples is:
[0033]
[0034] Among them, g book Represents medical logic triples, LLM extract This represents a large language model with knowledge extraction capabilities, and D represents a set of TCM documents.
[0035] In one possible implementation, the formula for calculating the thought chain triple is:
[0036]
[0037] in, This represents the thought chain triple corresponding to the i-th TCM diagnosis and treatment problem, LLM. decomp A large language model representing the decomposition of thought chains, q i Let a represent the i-th TCM diagnosis and treatment problem. i This represents the standard answer to the i-th TCM diagnosis and treatment question.
[0038] In this embodiment of the invention, two types of dedicated large-scale language models each perform their respective functions: one accurately extracts general medical logic triples from TCM document sets to solidify the theoretical knowledge foundation, and the other deconstructs explicit thought chain triples from diagnosis and treatment question-and-answer pairs to capture clinical reasoning logic. This achieves efficient transformation of unstructured TCM texts and cases into structured knowledge, while taking into account both theoretical authority and clinical applicability, providing accurate and suitable core data support for subsequent knowledge matching and personalized graph construction.
[0039] S3: Search for medical logic triples that are similar to the thought chain triples in the existing public knowledge graph to identify relevant triples.
[0040] Among them, knowledge graph refers to a semantic network that presents the knowledge associations in the field of traditional Chinese medicine in a structured way, with the "entity-relationship-entity" triple as the core structure, and can clearly sort out the logical relationships between traditional Chinese medicine concepts.
[0041] In one possible implementation, S3 specifically involves: retrieving medical logic triples similar to the thought chain triples from existing publicly available knowledge graphs through vector similarity matching, and identifying relevant triples.
[0042]
[0043] in, This represents the relevant triplet corresponding to the i-th TCM diagnosis and treatment question. This indicates selecting the top k relevant triples from medical logic triples, where sim represents the cosine similarity, φ represents the vector embedding function, and t... j A single medical logic triple representing a medical logic triple. Let represent the thought chain triplet corresponding to the i-th TCM diagnosis and treatment problem.
[0044] In this embodiment of the invention, by using vector embedding and cosine similarity calculation, the top k most relevant triples to the thought chain triples are accurately selected from the medical logic triples in the public knowledge graph. This ensures both the semantic relevance and accuracy of the retrieval results, and establishes a connection between clinically relevant thought chain triples and authoritative medical theory triples. This provides knowledge support for subsequent steps that is both clinically applicable and theoretically authoritative, while avoiding interference from irrelevant triples and improving the overall process efficiency.
[0045] S4: Through mapping operations, determine the set of TCM documents corresponding to the relevant triples to obtain the target document set.
[0046] Among them, the mapping operation refers to establishing the correspondence between structured medical logic triples and original text fragments in the TCM document set through specific functions (such as M1 and M2), so as to achieve accurate association from "entity-relation-entity" triples to unstructured authoritative text.
[0047] In one possible implementation, the formula for calculating the target document and set is:
[0048]
[0049] in, This represents the document set corresponding to the i-th TCM diagnosis and treatment question. Let M1 represent the set of relevant triples corresponding to each TCM diagnosis and treatment problem, and t represent the mapping function. k Let represent a single medical logic triplet in the relevant triplet corresponding to the i-th TCM diagnosis and treatment problem.
[0050] In this embodiment of the invention, the structured relevant triples are associated with the original text fragments in the TCM document set through the mapping function M1 to achieve knowledge traceability. Then, the content of all corresponding documents is merged through the union operation, which avoids duplication and ensures comprehensive coverage. The final target document set accurately matches the relevant triples, providing textual evidence with both relevance and authority for subsequent reasoning, and enhancing the credibility of knowledge support.
[0051] S5: For a given question, identify relevant text fragments from the target document set.
[0052] In one possible implementation, the formula for calculating the relevant text fragment is:
[0053]
[0054] in, This represents the text segment corresponding to the i-th TCM diagnosis and treatment question. This represents the top k most relevant text segments selected from a set of TCM documents, where sim represents the cosine similarity. Denotes the vector embedding function, d j q represents a single text fragment in a collection of TCM documents. i Let i represent the i-th TCM diagnosis and treatment problem.
[0055] In this embodiment of the invention, by using vector embedding and cosine similarity calculation, the semantic relationship between diagnosis and treatment questions and document fragments can be deeply captured. Then, the top k most relevant fragments are selected to ensure that the fragments are strongly matched with the questions and to remove redundant information. This provides accurate and focused authoritative text support for the subsequent fusion of triples to generate reasoning data, thereby improving the pertinence and credibility of subsequent reasoning.
[0056] S6: Using aligned triples in relevant text fragments and the original document as context, a large language model is used to generate the reasoning process text from question to answer.
[0057] Specifically, large-scale language models refer to large-scale language models (LLMs) that possess the function of generating reasoning processes in Traditional Chinese Medicine. genThis model, after being fine-tuned with data supervision in the field of Traditional Chinese Medicine (TCM), is specifically designed to generate TCM diagnostic reasoning processes. It takes TCM diagnostic questions, corresponding standard answers, relevant text fragments, and a target document set as input to generate coherent reasoning text that conforms to TCM diagnostic logic (such as "symptom-sign-syndrome-treatment principle"). It relies on authoritative documents to avoid "illusions" and explicitly presents the diagnostic logic from question to answer, providing core reasoning material for subsequent personalized knowledge processing.
[0058] In one possible implementation, the calculation formula for the reasoning process text is:
[0059]
[0060] Among them, C (i) Represents an inference dataset, LLM gen This represents a large-scale language model that possesses the ability to generate reasoning processes in Traditional Chinese Medicine. i Let a represent the i-th TCM diagnosis and treatment problem. i This represents the standard answer to the i-th TCM diagnosis and treatment question. This represents the text segment corresponding to the i-th TCM diagnosis and treatment question. This represents the document set corresponding to the i-th TCM diagnosis and treatment question. It represents the union of sets.
[0061] In this embodiment of the invention, the i-th TCM diagnosis and treatment question, the corresponding standard answer, and previously obtained relevant text fragments and target document set are integrated, and an LLM specifically designed for TCM reasoning is used. gen The generated reasoning process text is based on the alignment triples and the original document as authoritative references. It can effectively avoid "illusion" output and clearly present the TCM diagnosis and treatment logic from question to answer. It has both coherence and traceability, and provides high-quality reasoning materials for subsequent personalized knowledge graph construction or model fine-tuning.
[0062] S7: Extract entities and relationships from the reasoning process text.
[0063] In this embodiment of the invention, entities and relationships are extracted from the text of TCM diagnosis and treatment reasoning process generated based on authoritative documents. This ensures that the extracted content conforms to the real dialectical logic and avoids isolation and fragmentation. At the same time, it can obtain structured knowledge units with clinical relevance value, providing accurate and suitable core materials for subsequent construction of personalized TCM knowledge graphs and optimization of model training data, and further consolidating the structured foundation of the TCM knowledge system.
[0064] S8: Integrate the extracted entities and relationships into the existing public knowledge graph to form a personalized knowledge graph.
[0065] Personalized knowledge graphs refer to those based on publicly available TCM knowledge graphs, which integrate texts derived from specific diagnostic and treatment reasoning processes.
[0066] The personalized entities and relationships extracted are used to form a structured semantic network adapted to specific TCM diagnosis and treatment needs.
[0067] In one possible implementation, the formula for calculating a personalized knowledge graph is:
[0068]
[0069] in, Personalized knowledge graph, LLM extract This refers to a large-scale language model that possesses knowledge extraction capabilities.
[0070] In this embodiment of the invention, an LLM with knowledge extraction capabilities is utilized. extract By extracting entities and relationships from the reasoning process text and integrating them into a public knowledge graph, we can break the limitations of general knowledge graphs and form personalized knowledge graphs that fit the logic of TCM diagnosis and treatment. This also ensures that the integrated knowledge has a real reasoning basis and is not isolated or fragmented. It can provide exclusive authoritative support for personalized knowledge retrieval and decision generation for subsequent real-time diagnosis and treatment, and adapt to the characteristic needs of TCM "treating different diseases with the same method".
[0071] S9: Based on a personalized knowledge graph, generate TCM auxiliary diagnostic decision suggestions for real-time input questions.
[0072] In one possible implementation, S9 specifically includes sub-steps S901 to S907:
[0073] S901: Generate a question-answer pair dataset containing the reasoning process and triples obtained by decomposing the reasoning process based on the reasoning process text.
[0074] It should be noted that by synchronously generating question-answer pairs and decomposed triples containing reasoning from authoritative reasoning process texts, we not only provide complete labeled data of "question-reasoning-answer" that can be used for model training, but also produce structured knowledge units. This takes into account the needs of text reasoning learning and structured knowledge application, and provides high-quality data support that is adapted to the logic of TCM diagnosis for subsequent model fine-tuning, personalized knowledge retrieval and other links, effectively improving the accuracy and adaptability of downstream tasks.
[0075] S902: Construct a supervised dataset based on a question-answer pair dataset containing reasoning processes and triples obtained by decomposing the reasoning processes.
[0076] Among them, supervised datasets refer to labeled data sets specifically used for supervised fine-tuning of large-scale language models.
[0077] Specifically, the formula for calculating the supervised dataset is:
[0078]
[0079] Among them, D SFT Let q represent the supervised dataset. i Let C represent the i-th real-time input question. (i) Represents the inference dataset, Represents a personalized thought chain triple, {(q i, C (i) )} represents the inference dataset set corresponding to the i-th real-time input question. Let represent the set of personalized thought chain triples corresponding to the i-th real-time input question.
[0080] It should be noted that by merging "problem-reasoning process pairs" and "problem-personalized thought chain triplet pairs" to construct the supervised dataset, it encompasses both unstructured TCM diagnostic reasoning texts and structured personalized knowledge units, simultaneously meeting the model's learning needs for both "reasoning logic expression" and "structured knowledge parsing." Furthermore, by incorporating personalized TCM diagnostic features, it provides high-quality labeled data that aligns with TCM diagnostic logic, possessing both completeness and relevance for subsequent model fine-tuning, effectively improving the model's adaptability and output accuracy in TCM clinical tasks.
[0081] S903: Use supervised datasets for domain-supervised fine-tuning to optimize the parameters of large language models and obtain specialized models.
[0082] In one possible implementation, the calculation formula for the specific model is:
[0083]
[0084] Among them, L SFT (θ) represents the specialized model, θ represents the set of parameters of the large language model to be optimized, and q i Let y represent the i-th real-time input question. i Let D represent the i-th real label. SFT P represents a supervised dataset. θ This represents the probability with model parameter θ, and log represents the logarithmic function.
[0085] It should be noted that fine-tuning using a supervised dataset that integrates personalized TCM reasoning text with structured triples can accurately optimize model parameters, enabling specialized models to deeply adapt to TCM diagnostic logic. This not only strengthens the understanding of TCM theory and clinical reasoning but also improves the accuracy of personalized diagnosis and treatment output, effectively reducing "illusions" and better meeting the needs of TCM clinical practice.
[0086] S904: Through specialized models, real-time input questions are processed to determine multi-hop inference paths.
[0087] Among them, the multi-hop reasoning path refers to the structured sequence of explicit TCM diagnosis and treatment logic formed by multiple "entity-relationship-entity" triples, which is used to fully present the multi-step reasoning process from clinical problems to diagnosis and treatment conclusions.
[0088] Specifically, the formula for calculating multi-hop inference paths is:
[0089]
[0090] in, Let s1 represent a triple in multi-hop reasoning, r1 represent the first specific concept in TCM clinical practice, o1 represent the first logical connection in TCM clinical practice, and s represent the first TCM concept in TCM clinical practice. k Let r represent the k-th specific concept in TCM clinical practice. k This represents the logical connection in the k-th TCM clinical practice, o k This represents the k-th TCM concept in clinical practice, LLM. cot This represents a specialized thought chain model that demonstrates reasoning ability in Traditional Chinese Medicine diagnosis and treatment. i This represents the i-th real-time input question.
[0091] It should be noted that the specialized model, which has been fine-tuned under the supervision of the TCM field, can accurately adapt to real-time input questions. It makes the implicit multi-step diagnosis and treatment reasoning of TCM explicit into a structured multi-hop path that connects "entity-relationship-entity". It not only fully presents the logical chain from clinical questions to conclusions, but also provides clear evidence for subsequent personalized knowledge retrieval, significantly improving the interpretability and accuracy of diagnosis and treatment reasoning.
[0092] S905: By matching semantic similarity, retrieve personalized knowledge graphs that match multi-hop reasoning paths to obtain personalized triples.
[0093] Semantic similarity matching refers to the process of achieving precise matching by quantifying the degree of similarity between two TCM language units in terms of deep semantic and logical connections.
[0094] Specifically, the formula for calculating personalized triples is as follows:
[0095]
[0096] in, This represents a personalized triplet. This means selecting the top k triples from the personalized thought chain triples that are similar to the multi-hop reasoning path. The triple represents multi-hop reasoning, φ represents the vector embedding function, and t jA single medical logic triple representing a medical logic triple.
[0097] It should be noted that semantic similarity matching can deeply capture the core diagnostic logic of multi-hop reasoning paths. Then, the top k most relevant triples are selected from the personalized knowledge graph. This ensures that the obtained personalized triples are highly consistent with the semantics of the reasoning path and can also adapt to the characteristics of the "different treatments for the same disease" school of thought in traditional Chinese medicine. This provides accurate and relevant personalized knowledge support for the subsequent generation of exclusive treatment plans, and improves the pertinence and credibility of the treatment suggestions.
[0098] S906: Through mapping operations, retrieve the TCM document set corresponding to the personalized triplet to obtain personalized text fragments.
[0099] Specifically, the formula for calculating personalized text fragments is:
[0100]
[0101] in, This represents the personalized text fragment corresponding to the i-th real-time input question. Let M2 represent the set of personalized triples corresponding to each real-time input question, and let t represent the mapping function. k This represents a single medical logic triplet in the personalized triplet corresponding to the i-th real-time input question.
[0102] It should be noted that by using the mapping function M2 to associate personalized triples with the original text in the TCM document set, the structured triples are given authoritative textual basis. Then, the union operation integrates all corresponding fragments, which avoids duplication and ensures comprehensive information. The resulting personalized text fragments accurately match the personalized features of the triples, providing traceable and highly relevant textual support for the subsequent generation of diagnosis and treatment suggestions that fit the characteristics of TCM schools, thereby improving the credibility and pertinence of the diagnosis and treatment output.
[0103] S907: Combining real-time input questions, multi-hop inference paths, and relevant personalized text fragments, it generates TCM auxiliary diagnostic decision-making suggestions through a large language model.
[0104] Specifically, the calculation formula for TCM-assisted diagnostic decision-making suggestions is as follows:
[0105]
[0106] in, This indicates suggestions for TCM-assisted diagnosis and decision-making, LLM gen This represents a large-scale language model that possesses the ability to generate reasoning processes in Traditional Chinese Medicine. i This represents the i-th real-time input question. This represents a personalized triplet. This represents the personalized text fragment corresponding to the i-th real-time input question.
[0107] It should be noted that this relies on the LLM specifically designed for Traditional Chinese Medicine. gen By deeply integrating real-time input questions, multi-hop reasoning paths, and personalized text fragments, we can ensure that the suggestions are accurate and relevant to the problem and supported by clear diagnostic logic. We can also avoid "illusions" by using personalized text as an authoritative basis. At the same time, we can adapt to the characteristics of "treating different diseases with the same method" in traditional Chinese medicine, which can greatly improve the credibility and clinical value of auxiliary diagnostic decision-making.
[0108] In this embodiment of the invention, a large language model is used to generate TCM auxiliary diagnostic decision suggestions, forming a complete closed loop of "data construction - model optimization - reasoning retrieval - suggestion generation". The model is adapted to TCM logic by using supervised datasets, accuracy is ensured by multi-hop reasoning and personalized knowledge, and authoritative evidence is provided by document fragments. Finally, TCM auxiliary diagnostic suggestions that fit the characteristics of "treating the same disease differently" are generated, with clear logic and credibility, which greatly improves the clinical practical value.
[0109] Reference manual attached Figure 2 The diagram shows a schematic representation of a TCM auxiliary diagnostic system combining knowledge graphs and thought chains, provided by an embodiment of the present invention.
[0110] This invention provides a TCM auxiliary diagnostic system 20 that combines knowledge graphs and thought chains, including: a processor 201 and a memory 202;
[0111] The memory 202 stores programs or instructions that can run on the processor 201. When the program or instructions are executed by the processor 201, they implement the steps of the above-mentioned TCM auxiliary diagnosis method combining knowledge graph and thought chain, and can achieve the same technical effect. To avoid repetition, the present invention will not elaborate further.
[0112] It should be understood that the processor 201 in this embodiment of the invention may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0113] It should also be understood that the memory 202 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM).
[0114] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0115] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0116] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0117] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0118] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0119] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0120] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0121] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0122] This invention provides a readable storage medium comprising: storing a program or instructions on the readable storage medium, wherein when the program or instructions are executed by a processor, the program or instructions implement the steps of the above-described method for TCM auxiliary diagnosis combining knowledge graphs and thought chains, and can achieve the same technical effect. To avoid repetition, this invention will not elaborate further.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. 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; and these 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. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the protection scope of the present invention.
Claims
1. A TCM-assisted diagnostic method combining knowledge graphs and thought chains, characterized in that, include: S1: Obtain a collection of TCM documents and clinical cases; S2: Process the TCM document set and the diagnosis and treatment cases using a large language model to generate medical logic triples and thought chain triples respectively; S3: Search for medical logic triples that are similar to the aforementioned thought chain triples in existing publicly available knowledge graphs to identify relevant triples; S4: Through mapping operations, determine the set of TCM documents corresponding to the relevant triples to obtain the target document set; S5: For a given question, determine relevant text fragments from the target document set; S6: Using the aligned triples in the relevant text fragments and the original document as context, generate the reasoning process text from question to answer through a large language model; S7: Extract entities and relationships from the reasoning process text; S8: Integrate the extracted entities and relationships into the existing public knowledge graph to form a personalized knowledge graph; S9: Based on the personalized knowledge graph, generate TCM auxiliary diagnostic decision suggestions for real-time input questions.
2. The TCM auxiliary diagnostic method combining knowledge graphs and thought chains according to claim 1, characterized in that, The formula for calculating the medical logic triplet is as follows: ; Among them, g book Represents medical logic triples, LLM extract This represents a large language model with knowledge extraction capabilities; D represents a set of TCM documents. The formula for calculating the mental chain triple is: ; in, This represents the thought chain triple corresponding to the i-th TCM diagnosis and treatment problem, LLM. decomp A large language model representing the decomposition of thought chains, q i Let a represent the i-th TCM diagnosis and treatment problem. i This represents the standard answer to the i-th TCM diagnosis and treatment question.
3. The TCM auxiliary diagnostic method combining knowledge graphs and thought chains according to claim 1, characterized in that, Specifically, S3 is: By using vector similarity matching, medical logic triples that are similar to the aforementioned thought chain triples are retrieved from existing public knowledge graphs to identify relevant triples.
4. The TCM auxiliary diagnostic method combining knowledge graphs and thought chains according to claim 1, characterized in that, The calculation formula for the target document and set is as follows: ; in, This represents the document set corresponding to the i-th TCM diagnosis and treatment question. Let M1 represent the set of relevant triples corresponding to each TCM diagnosis and treatment problem, and t represent the mapping function. k This represents a single medical logic triplet in the relevant triplet corresponding to the i-th TCM diagnosis and treatment problem.
5. The TCM auxiliary diagnostic method combining knowledge graphs and thought chains according to claim 1, characterized in that, The formula for calculating the relevant text fragment is: ; in, This represents the text segment corresponding to the i-th TCM diagnosis and treatment question. This represents the top k most relevant text segments selected from a collection of TCM documents, where sim represents the cosine similarity. Denotes the vector embedding function, d j q represents a single text fragment in a collection of TCM documents. i Let i represent the i-th TCM diagnosis and treatment problem.
6. The TCM auxiliary diagnostic method combining knowledge graphs and thought chains according to claim 1, characterized in that, The calculation formula for the reasoning process text is as follows: ; Among them, C (i) Represents an inference dataset, LLM gen This represents a large-scale language model that possesses the ability to generate reasoning processes in Traditional Chinese Medicine. i Let a represent the i-th TCM diagnosis and treatment problem. i This represents the standard answer to the i-th TCM diagnosis and treatment question. This represents the text segment corresponding to the i-th TCM diagnosis and treatment question. This represents the document set corresponding to the i-th TCM diagnosis and treatment question. It represents the union of sets.
7. The TCM auxiliary diagnostic method combining knowledge graphs and thought chains according to claim 1, characterized in that, The calculation formula for the personalized knowledge graph is as follows: ; in, Personalized knowledge graph, LLM extract This represents a large-scale language model with knowledge extraction capabilities. This represents the inference dataset.
8. The TCM auxiliary diagnostic method combining knowledge graphs and thought chains according to claim 1, characterized in that, S9 specifically includes: S901: Based on the reasoning process text, generate a question-answer pair dataset containing the reasoning process and triples obtained by decomposing the reasoning process; S902: Construct a supervised dataset based on the question-answer pair dataset containing the reasoning process and the triples obtained by decomposing the reasoning process; S903: Use the supervised dataset to perform domain-supervised fine-tuning, optimize the parameters of the large language model, and obtain a specialized model; S904: The real-time input problem is processed using the specialized model to determine a multi-hop inference path; S905: By semantic similarity matching, retrieve the personalized knowledge graph that matches the multi-hop reasoning path to obtain personalized triples; S906: Through mapping operations, retrieve the TCM document set corresponding to the personalized triplet to obtain personalized text fragments; S907: Combining the real-time input question, the multi-hop inference path, and the relevant personalized text fragments, the large-scale language model generates TCM auxiliary diagnostic decision suggestions.
9. The TCM auxiliary diagnostic method combining knowledge graphs and thought chains according to claim 8, characterized in that, The calculation formula for the specific model is as follows: ; Among them, L SFT (θ) represents the specialized model, θ represents the set of parameters of the large language model to be optimized, and q i Let y represent the i-th real-time input question. i Let D represent the i-th real label. SFT P represents a supervised dataset. θ This represents the probability with model parameter θ, and log represents the logarithmic function.
10. A TCM auxiliary diagnostic system combining knowledge graphs and thought chains, characterized in that, include: Processor and memory; The memory stores programs or instructions that can run on the processor, which, when executed by the processor, implement the steps of the TCM auxiliary diagnostic method combining knowledge graphs and thought chains as described in any one of claims 1 to 9.
Citation Information
Cited By
Traditional Chinese medicine diagnosis and treatment collaboration method based on knowledge graph and large model double driving
CN122245648A