Intelligent traditional Chinese medicine auxiliary diagnosis system based on knowledge graph retrieval enhanced generation

The intelligent TCM auxiliary diagnosis system addresses the inefficiencies of traditional Chinese medicine diagnosis and search engines by utilizing a knowledge graph retrieval and enhanced generation method to provide fast and reliable TCM information, enhancing its integration into modern medical systems.

CN119170258AActive Publication Date: 2024-12-20UNIV OF SCI & TECH OF CHINA

Patent Information

Application Number
CN202411344767.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2024-12-20
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

Traditional Chinese medicine diagnosis and treatment processes are time-consuming and incompatible with modern society's demand for fast and standardized medical services, and traditional search engines struggle to accurately retrieve and provide reliable TCM information due to keyword-based limitations and the proliferation of false information.

Method used

An intelligent TCM auxiliary diagnosis system using a knowledge graph retrieval and enhanced generation approach, incorporating a vector and graph knowledge base, and an online reasoning module to accurately identify user needs and provide relevant information through human-computer interaction.

Benefits of technology

The system efficiently retrieves and provides accurate TCM information, overcoming traditional search engine limitations and integrating TCM into modern medical systems by leveraging professional knowledge and intelligent information retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119170258A_ABST
    Figure CN119170258A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent traditional Chinese medicine auxiliary diagnosis system based on knowledge graph retrieval enhanced generation, the system comprises a knowledge base and an online reasoning module, the knowledge base comprises a vector knowledge base and a graph knowledge base, and the graph knowledge base is obtained by performing knowledge extraction and entity recognition on a traditional Chinese medicine original text data set through a large language model LLM; vectorizing entities in the map knowledge base to obtain a vector knowledge base; the online reasoning module adopts a large language model LLM to perform named entity recognition on a user question to obtain entities related to traditional Chinese medicine, a triple containing the most related entities is inquired in a graph knowledge base, the inquired triple serves as known knowledge, and the triple and the user question are spliced together to serve as cue words to be input to the large language model LLM. According to the system, professional traditional Chinese medicine knowledge is used as a knowledge base, a large model is used as a tool for knowledge arrangement and summarization, and user requirements are accurately recognized in a man-machine interaction mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of TCM auxiliary diagnosis systems, and in particular to an intelligent TCM auxiliary diagnosis system based on knowledge graph retrieval-argumented generation (RAG). Background Art

[0002] Traditional Chinese medicine has a profound historical heritage and unique treatment concepts. Its diagnosis and treatment methods, such as acupuncture, herbal medicine, and massage, have been widely recognized and applied not only in China but also around the world. Traditional Chinese medicine emphasizes the holistic concept and the balance of yin and yang. Its personalized treatment plans and emphasis on disease prevention provide a valuable supplement to the modern medical system. However, the complexity of the diagnosis and treatment process of traditional Chinese medicine, such as the traditional diagnosis method of "looking, smelling, asking, and palpating", and the reliance on the doctor's personal experience and intuition, make it incompatible with the modern society's pursuit of high-efficiency medical environment. Although this personalized and empirical diagnosis and treatment method can provide patients with meticulous care, it also leads to a time-consuming treatment process and scattered resources, which is difficult to meet the modern society's demand for fast and standardized medical services. In addition, the inheritance and popularization of traditional Chinese medicine knowledge also face challenges, because its profound theoretical and practical skills require a long period of study and practice to master.

[0003] With the rapid development of Internet technology and information technology, data and information resources in the field of traditional Chinese medicine have achieved unprecedented growth. The emergence of resources such as professional websites of traditional Chinese medicine, online databases and e-books has provided a new platform for the dissemination and application of traditional Chinese medicine knowledge. The establishment of these digital resources has undoubtedly opened up new ways for the inheritance and development of traditional Chinese medicine culture, allowing more people to easily obtain and learn traditional Chinese medicine knowledge.

[0004] However, traditional search engines have shown obvious limitations when processing this professional information of traditional Chinese medicine. The search mechanism based on keyword matching often cannot accurately understand the user's query intention, resulting in a large amount of irrelevant or redundant information in the search results. When faced with massive amounts of data, it is difficult for users to quickly find truly valuable information, which not only increases the user's cognitive burden, but also reduces the efficiency of information retrieval. In addition, the proliferation of false information on the Internet makes it difficult for users to distinguish the authenticity and reliability of traditional Chinese medicine information when obtaining it. This is undoubtedly a huge challenge for the field of traditional Chinese medicine, which is highly professional and requires accurate information.

[0005] In summary, the importance of TCM culture in modern society is self-evident, but the complexity of its diagnosis and treatment process and the contradiction with the efficiency requirements of modern medicine, as well as the limitations of traditional search engines in processing TCM information, have restricted TCM's ability to adapt to modern society. In order to overcome these challenges, we need to explore more efficient and intelligent information retrieval technologies, as well as innovate TCM diagnosis and treatment models, so that it can be better integrated into the modern medical system and play its unique value and role. Summary of the invention

[0006] The purpose of the present invention is to provide an intelligent TCM auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation. The system uses professional TCM knowledge as the knowledge base and a large model as a tool for knowledge organization and summary. It accurately identifies user needs through human-computer interaction and quickly returns answers that meet the requirements, thus overcoming the shortcomings of traditional search engines.

[0007] The objective of the present invention is achieved through the following technical solutions:

[0008] An intelligent TCM auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation, the system includes a knowledge base and an online reasoning module, wherein:

[0009] The knowledge base includes a vector knowledge base and a graph knowledge base. The graph knowledge base is obtained by performing knowledge extraction and entity recognition on the original text data set of traditional Chinese medicine through the large language model LLM through prompt engineering;

[0010] Among them, there are 13 types of entities: drugs, drug ingredients, diseases, symptoms, syndromes, disease groups, foods, food groups, populations, drug groups, drug dosage forms, drug properties and flavors, and Chinese medicine efficacy;

[0011] The large language model LLM outputs a list of triples based on the relationship between related entities in the original text corpus. Each element in the triple list includes an entity, another entity, and the relationship between the two entities.

[0012] Then, the entities in the graph knowledge base are vectorized using the fine-tuned M3E-large vector embedding model, and the vectors are clustered using the approximate nearest neighbor search algorithm ANN to speed up the vector retrieval speed, and finally a vector knowledge base is obtained; wherein, M3E-large is a general-purpose vector embedding model;

[0013] The online reasoning module uses a large language model LLM to perform named entity recognition on user questions to obtain entities related to traditional Chinese medicine, uses a fine-tuned M3E-large vector embedding model to vectorize the extracted entities related to traditional Chinese medicine, and then performs a cosine similarity query with the vectors in the vector knowledge base to obtain the top K entities most relevant to the disease in the user question; then searches the graph knowledge base for all triples containing these entities, sorts these triples at multiple scales, and uses the triples with the highest scores as known knowledge, which are spliced ​​together with the user question as instructions and input to the large language model LLM, and the large language model LLM outputs the corresponding query results.

[0014] It can be seen from the technical solution provided by the present invention that the system uses professional Chinese medicine knowledge as a knowledge base and a large model as a tool for knowledge organization and summary. It accurately identifies user needs through human-computer interaction and quickly returns answers that meet the requirements, thus overcoming the shortcomings of traditional search engines. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0016] Figure 1 A schematic diagram of the overall structure of an intelligent TCM auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation provided by an embodiment of the present invention;

[0017] Figure 2 This is a schematic diagram of the overall design framework of the intelligent TCM auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation according to an embodiment of the present invention;

[0018] Figure 3 For Figure 2 Schematic diagram of the framework after adding an intelligent retrieval mechanism on the basis of the invention framework. DETAILED DESCRIPTION

[0019] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, which does not constitute a limitation of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] like Figure 1The figure shows the overall structure of the intelligent TCM auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation provided by an embodiment of the present invention. The system includes a knowledge base and an online reasoning module, wherein:

[0021] The knowledge base includes a vector knowledge base and a graph knowledge base. The graph knowledge base is obtained by extracting knowledge and identifying entities from the original text data set of traditional Chinese medicine through a large language model (LLM) through prompt engineering; it contains 13 types of entities: drugs, drug ingredients, diseases, symptoms, syndromes, disease groups, foods, food groups, populations, drug groups, drug dosage forms, drug properties and flavors, and Chinese medicine efficacy;

[0022] In the specific implementation, the above-mentioned original text datasets of traditional Chinese medicine are derived from "Terms of Clinical Diagnosis and Treatment of Traditional Chinese Medicine", CPubMed-KG, and TCM-SD syndrome differentiation datasets in the field of traditional Chinese medicine; "Terms of Clinical Diagnosis and Treatment of Traditional Chinese Medicine" includes three parts: diseases, syndromes, and treatment methods of traditional Chinese medicine, which respectively stipulate the basic terms and concepts of common diseases, syndromes, treatment principles and treatment methods in clinical practice of traditional Chinese medicine, and its content is highly authoritative and accurate; CPubMed-KG is currently the largest fully open Chinese medical knowledge graph in China. The knowledge mined comes from more than 2 million high-quality Chinese core medical journals under the Chinese Medical Association, and is updated in a timely manner. Its relationship and entity specifications are compatible with mainstream Chinese medical specifications. The sources of entities and relationships are clear, traceable, and easy to identify, and the scale of disease-centered triples has reached 3.9 million; TCM-SD syndrome differentiation dataset in the field of traditional Chinese medicine is the first public and real-life scenario-collected syndrome differentiation dataset of traditional Chinese medicine, and each entry in it is taken from a consultation record in a real scenario.

[0023] The large language model LLM outputs a list of triples based on the relationship between related entities in the original text corpus. Each element in the triple list includes an entity, another entity, and the relationship between the two entities.

[0024] For example, this application combines multiple existing TCM knowledge graph surveys and studies, as well as the characteristics of the data set, to determine that the TCM knowledge graph entities of the present invention include 13 types, as shown in Table 1 below:

[0025] Table 1 Examples of knowledge graph entities

[0026]

[0027] Then, the large language model LLM is used to complete the task of converting the original text corpus into a knowledge graph using the prompt engineering method, namely Text2Graph. For example, in the Text2Graph task, the instruction prompt words input to the large language model are:

[0028] Step 1: As you go through each sentence, think about the key entities mentioned in it. Entities may include objects, places, organizations, people, acronyms, documents, services, concepts, etc.

[0029] Step 2: Think about how these entities correspond to other entities. Entities mentioned in the same sentence or paragraph are usually related to each other. Entity types are limited to drugs, drug ingredients, diseases, symptoms, syndromes, disease groups, foods, food groups, populations, drug groups, drug dosage forms, drug properties, and Chinese medicine effects. If other types of entities are extracted, please filter them automatically.

[0030] Step 3: Find the relationship between each pair of related entities. Finally, format the output as a json list. Each element in the list contains a pair of entities and the relationship between them, as follows: "node_1": "concept extracted from the extracted entity" "node_2": "related concept extracted from the extracted entity" "edge": the relationship between the two concepts of node1 and node2 in one or two sentences.

[0031] The text that needs to be converted is as follows: {Traditional Chinese Medicine Text}.

[0032] Through the above prompt words, the text "Heart Yin Blood Deficiency Syndrome is caused by Yin deficiency and blood deficiency, and the heart and mind are not nourished. The clinical symptoms are palpitations, dizziness, irritability, easy to be startled, insomnia, dreaminess, forgetfulness, red tongue, thin and rapid pulse, accompanied by pale complexion, red cheeks, and night sweats." is converted into knowledge graph triples, and the results are as follows, where "node_1" and "node_2" represent entities in the triple, and "edge" represents the relationship between two entities:

[0033] {"node_1":"Heart Yin Blood Deficiency Syndrome","node_2":"Palpitations","edge":"Accompanying symptoms"},{"node_1":"Heart Yin Blood Deficiency Syndrome","node_2":"Dizziness","edge":"Accompanying symptoms"},{"node_1":"Heart Yin Blood Deficiency Syndrome","node_2":"Upset","edge":"Accompanying symptoms"},{"node_1":"Heart Yin Blood Deficiency Syndrome","node_2":"Easy to startle","edge":"Accompanying symptoms"},{"node_1":"Heart Yin Blood Deficiency Syndrome","node_2":"Insomnia","edge":"Accompanying symptoms"},{"node_1":"Heart Yin Blood Deficiency Syndrome","node_2":"Dreaming","edge":"Accompanying symptoms"},{"node_1":"Heart Yin Blood Deficiency Syndrome","node_2":"Forgetfulness",

[0034] "edge":"Associated symptoms"},{"node_1":"Heart Yin Blood Deficiency","node_2":"Red tongue","edge":"Tongue characteristics"},{"node_1":"Heart Yin Blood Deficiency","node_2":"Weak and rapid pulse","edge":"Pulse characteristics"}"},{"node_1":"Heart Yin Blood Deficiency","node_2":"Pale complexion","edge":"Facial features"},{"node_1":"Heart Yin Blood Deficiency","node_2":"Red cheekbones","edge":"Facial features"},{"node_1":"Heart Yin Blood Deficiency","node_2":"Night sweats","edge":"Associated symptoms"}

[0035] Then, the entities in the graph knowledge base are vectorized using the fine-tuned M3E-large (Moka Massive Mixed Embedding model-large) vector embedding model, and the vectors are clustered using the approximate nearest neighbor search algorithm ANN (Approximate Nearest Neighbor) to speed up vector retrieval, and finally a vector knowledge base is obtained; wherein, M3E-large is a general-purpose vector embedding model;

[0036] In the specific implementation, in order to make the M3E-large vector embedding model achieve better results on the traditional Chinese medicine dataset, this application uses contrastive learning for fine-tuning. Contrastive learning fine-tuning requires labeled positive and negative samples, but there is currently no public dataset that meets the requirements. Therefore, this article uses the In-batch negatives method based on the "Terminology of Clinical Diagnosis and Treatment of Traditional Chinese Medicine" to construct 5,000 samples. Each sample contains a question and its correct answer (i.e., positive sample) and an incorrect answer (negative sample). The specific approach is that since the same section of the "Terminology of Clinical Diagnosis and Treatment of Traditional Chinese Medicine" contains the same category of diseases and their explanations, this application tries to put the diseases in the same section in the same batch of samples when constructing fine-tuning data; then for the construction of positive and negative samples, this application rewrites the explanation of the disease into a question, sets the disease as the positive sample answer, and then sets the positive samples of other samples in the same batch as the negative samples of the disease question, i.e., the In-batch negatives strategy, thereby constructing all positive and negative samples; in the training stage, this application uses the triplet loss function commonly used in contrastive learning (Triplet Loss) is used as the loss function, that is, the learning goal is to make the distance between the positive sample and the sample's problem smaller, and the distance between the negative sample and the problem larger, so as to achieve better sample differentiation effect; in order to speed up the retrieval efficiency, this application uses the approximate nearest neighbor search algorithm ANN to cluster and store the vectors of the vector knowledge base, that is, vectors with similar distances are classified into one category. In the subsequent retrieval stage, the target vector only needs to calculate the distance with the cluster centers of all classes in the vector knowledge base first, and then it can quickly locate the class closest to it.

[0037] The online reasoning module uses a large language model LLM to perform named entity recognition on user questions to obtain entities related to traditional Chinese medicine, namely the 13 entities in Table 1, and uses the fine-tuned M3E-large vector embedding model to vectorize the extracted traditional Chinese medicine-related entities, and then performs a cosine similarity query with the vectors in the vector knowledge base to obtain the top K entities most relevant to the disease in the user question; then, all triples containing these entities are queried in the graph knowledge base, these triples are sorted at multiple scales, and the triples with the highest scores are taken as known knowledge, spliced ​​together with the user question as instructions input to the large language model LLM, and the large language model LLM outputs the corresponding query results.

[0038] like Figure 2Shown is a schematic diagram of the overall design framework of the intelligent TCM auxiliary diagnosis system based on the knowledge graph described in the embodiment of the present invention. In the specific implementation, in the practice of TCM, the treatment method usually includes three key elements: population, syndrome, and symptoms. For different patient groups, even if they show similar disease characteristics, the treatment strategies may be very different. For example, the treatment plan for children's colds and fevers is often different from that for adults; similarly, due to the different parts of the body where the discomfort occurs, the treatment methods will also be different, such as shoulder and back pain and eye pain, and the treatment methods are also completely different. Therefore, when screening triples, the present application needs to consider the importance of the entity type in the triple. In the triple screening link of the online reasoning module, a multi-scale fusion scoring method is used, and the scores after the fusion of different features are used to sort out the triples with the highest scores;

[0039] Specifically, by calculating the cosine similarity distance between the TCM-related entities in the user's question and the entities in the vector knowledge base, we find the top K entities with the smallest distance, and then find the triples containing these entities in the graph knowledge base, which are defined as candidate triples. Since there are a large number of retrieved triples, further screening is required to find the triples with the strongest relevance to the user's question. First, the candidate triples are concatenated into sentences and then vectorized using the fine-tuned M3E-large model. The cosine similarity is calculated with the user's question that has been vectorized. The cosine similarity result is the initial score of the triple.

[0040] Depending on the type of entity contained in the triple, the score of the triple will be multiplied by different weights. When the user's question contains a population entity, a syndrome entity, or a symptom entity, the score weight of the triple containing these three entities will also be reduced (the smaller the score, the greater the relevance to the user's question);

[0041] Finally, sort the triples by scores from small to large, and delete the bottom 25% of the triples to complete the search;

[0042] The retrieved triples are concatenated into sentences as known knowledge that can be used by the large language model to answer user questions. They are concatenated with the user questions as instructions and input into the large language model LLM, which then outputs the answer.

[0043] In the specific implementation, the instruction template for the question to be answered by the large language model is as follows:

[0044] Please answer the user's question based on your known knowledge: {triples}: {user question}.

[0045] In a simple scenario, Figure 2The embodiment system shown can already meet the requirements. However, in some special cases, such as when facing general questions that are not related to traditional Chinese medicine, it is impossible to find the answer by searching the knowledge base; when facing complex questions, multiple rounds of searching are required to get the answer. Therefore, the embodiment of the present invention designs an intelligent retrieval mechanism, which allows the system to select the appropriate retrieval method according to the different intentions of the user's questions and the difficulty of the questions, such as Figure 3 As shown in the framework diagram, the system also includes a general intention recognition module and a self-reflection module.

[0046] The intent recognition module is used to directly skip the retrieval module when the user question retrieved is irrelevant to the content of the knowledge base and is judged to be a general intent question. The large language model LLM will answer based on the corpus learned in the pre-training stage, thereby improving the retrieval efficiency. Setting this module can also prevent the information with poor relevance to the question from "misleading" the large language model, causing it to have "hallucinations" and reducing the reliability of the answer.

[0047] The intent recognition module is implemented through a classifier: when completing the named entity recognition task, the large language model LLM is asked to additionally answer the entity type. If the entity type belongs to one of the 13 entities, it is judged to be a question related to traditional Chinese medicine; if not, the user's question is judged to be a general intent question.

[0048] In addition, if Figure 3 As shown, the system also includes a self-reflection module, which is used to add a discriminator for judging the relevance of the answer to the user's question before the large language model LLM outputs the answer when the answer generated by a single round of retrieval cannot contain all the knowledge to answer the user's question in the face of complex questions. If it is judged to be irrelevant, similar entities are added to perform another iterative retrieval, which dynamically expands the entity list and increases the number of candidate triples. Specifically:

[0049] The relevance discriminator is completed by the large language model LLM through prompt engineering. For example, the instruction template is: "The known user question is: {user question}; your output: {output of the large language model LLM}. Does your output answer the user question?" If the answer is no, a second round of retrieval is performed;

[0050] The formula for dynamically expanding triples is shown in formula (1) and (2). Given a graph knowledge base KG, in the i-th round of retrieval, based on the entity list {e i}Get all the graph knowledge base KG containing {e i Triplet i ,Right now:

[0051] Triplet i =KG(Triplet i |{e i}) (1)

[0052] Among them, KG() means retrieval from the graph knowledge base;

[0053] In the Triplet i In the above example, we get the triplet Triplet i All entities contained in the query are used as the search source for the i+1th round of search, that is:

[0054] Triplet i+1 =KG(Triplet i+1 |GetEntity(Triplet i )) (2)

[0055] Finally, the triplet obtained by formulas (1) and (2) is i+1 It is the triple result after dynamic expansion;

[0056] The use of this relevance discriminator gives the system a self-reflection mechanism, which can continuously optimize its own answers.

[0057] It is worth noting that the contents not described in detail in the embodiments of the present invention belong to the prior art known to professional and technical personnel in the field.

[0058] In summary, the system described in the embodiment of the present invention has the following advantages:

[0059] 1. The system described in the embodiment of the present invention does not pre-train the large model, but obtains relevant TCM knowledge through the knowledge graph retrieval enhancement generation method, inputs it into the large language model LLM, and the large language model LLM summarizes and generates the user's reply. The advantage of this design is that with the development of TCM technology, the newly added knowledge and cases can be learned by the large language model LLM without pre-training or fine-tuning, which can greatly save the computing power and time cost of pre-training;

[0060] 2. This application uses knowledge graph triples to perform knowledge distillation on the original TCM text, and replaces the original vector knowledge base with a combination of graph knowledge base and vector knowledge base, so as to achieve the purpose of converting the knowledge base from unstructured data to structured data, so as to help the large language model LLM better capture the key information in the prompt words;

[0061] 3. This application uses an intelligent retrieval mechanism that allows the system to select an appropriate retrieval method based on the different intentions and difficulty of the user's questions.

[0062] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims. The information disclosed in the background technology section of this article is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as an admission or in any form that the information constitutes prior art known to those skilled in the art.

Claims

1. An intelligent TCM auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation, characterized in that: The system includes a knowledge base and an online reasoning module, wherein: The knowledge base includes a vector knowledge base and a graph knowledge base. The graph knowledge base is obtained by performing knowledge extraction and entity recognition on the original text data set of traditional Chinese medicine through the large language model LLM through prompt engineering; Among them, there are 13 types of entities: drugs, drug ingredients, diseases, symptoms, syndromes, disease groups, foods, food groups, populations, drug groups, drug dosage forms, drug properties and flavors, and Chinese medicine efficacy; The large language model LLM outputs a list of triples based on the relationship between related entities in the original text corpus. Each element in the triple list includes an entity, another entity, and the relationship between the two entities. Then, the entities in the graph knowledge base are vectorized using the fine-tuned M3E-large vector embedding model, and the vectors are clustered using the approximate nearest neighbor search algorithm ANN to speed up the vector retrieval speed, and finally a vector knowledge base is obtained; wherein, M3E-large is a general-purpose vector embedding model; The online reasoning module uses a large language model LLM to perform named entity recognition on user questions to obtain entities related to traditional Chinese medicine, uses a fine-tuned M3E-large vector embedding model to vectorize the extracted entities related to traditional Chinese medicine, and then performs a cosine similarity query with the vectors in the vector knowledge base to obtain the top K entities most relevant to the disease in the user question; then searches the graph knowledge base for all triples containing these entities, sorts these triples at multiple scales, and uses the triples with the highest scores as known knowledge, which are spliced ​​together with the user question as instructions and input to the large language model LLM, and the large language model LLM outputs the corresponding query results.

2. According to claim 1, the intelligent TCM auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation is characterized in that: In the triple selection process of the online reasoning module, a multi-scale fusion scoring method is used to sort the scores after fusion of different features to select the triples with the highest scores; Among them, by calculating the cosine similarity distance between the TCM-related entities in the user's question and the entities in the vector knowledge base, the top K entities with the smallest distance are found, and then the triples containing these entities are found in the graph knowledge base and defined as candidate triples; After the candidate triples are concatenated into sentences, they are vectorized using the fine-tuned M3E-large model and the cosine similarity is calculated with the vectorized user questions. The cosine similarity result is the initial score of the triples. Depending on the entity types contained in the triple, the score of the triple will be multiplied by different weights. When the user's question contains population entities, syndrome entities, and symptom entities, the score weight of the triple containing these three entities will also be reduced; Finally, sort the triples by scores from small to large, and delete the bottom 25% of the triples to complete the search; The retrieved triples are concatenated into sentences as known knowledge that can be used by the large language model to reply to user questions. They are concatenated with the user questions as instructions and input to the large language model LLM, which then outputs the corresponding answers.

3. The intelligent TCM auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation according to claim 1 is characterized in that: The system also includes a general intent recognition module, which is used to directly skip the retrieval module when the user question retrieved is a question unrelated to the content of the knowledge base, and the large language model LLM is used to answer the question based on the corpus learned in the pre-training stage, thereby improving the retrieval efficiency; The intent recognition module is implemented through a classifier. Specifically, when completing the named entity recognition task, the large language model LLM is asked to additionally answer the entity type. If the entity type belongs to one of the 13 entities, it is judged to be a question related to traditional Chinese medicine; if not, the user's question is judged to be a general intent question.

4. According to claim 1, the intelligent TCM auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation is characterized in that: The system also includes a self-reflection module, which is used to add a discriminator for judging the relevance of the answer to the user's question before the large language model LLM outputs the answer when the answer generated by a single round of retrieval does not contain all the knowledge to answer the user's question. If it is judged to be irrelevant, similar entities are added to perform another iterative retrieval, so as to dynamically expand the entity list and increase the number of candidate triples. Specifically: The relevance discriminator is completed by the large language model LLM through prompt engineering; The formulas for dynamically expanding triples are shown in equations (1) and (2). Given a graph knowledge base KG, in the i-th round of retrieval, based on the entity list {e i }Get all the graph knowledge base KG containing {e i Triplet i ,Right now: Triplet i =KG(Triplet i {e i }) (1) Among them, KG() means retrieval from the graph knowledge base; In the Triplet i In the above example, we get the triplet Triplet i All entities contained in the query are used as the search source for the i+1th round of search, that is: Triplet i+1 =KG(Triplet i+1 |GetEntity(Triplet i )) (2) Finally, the triplet obtained by formulas (1) and (2) is i+1 It is the triple result after dynamic expansion; The use of this relevance discriminator gives the system a self-reflection mechanism, which can continuously optimize its own answers.

Citation Information

Patent Citations

  • Intelligent question-answering method based on knowledge graph embedded representation

    CN112579795A

  • Knowledge graph embedded Chinese named entity recognition method and related equipment

    CN115759099A

  • Question and answer system construction method fusing knowledge graph, knowledge base and large language model

    CN117688189A

  • Poultry health data processing method based on knowledge graph and big language model fusion reasoning

    CN118522443A

  • Large language model knowledge question-answering method and system fused with multi-modal knowledge graph

    CN118627628A

Cited By

  • CARD (chronic obstructive pulmonary disease) diagnosis method based on large model atlas retrieval enhancement

    CN119694544A

  • Psychological assessment method based on large language model Agent

    CN119833140A

  • Knowledge graph construction method and system based on Chinese medicine classics

    CN120124733A

  • Iterative retrieval reasoning enhanced knowledge graph RAG method based on introspection mechanism

    CN120216732A

  • RAG method of knowledge graph enhanced by iterative search reasoning based on introspection mechanism

    CN120216732B