Traditional Chinese medicine prescription generation method and system based on knowledge graph retrieval enhancement
Through the search enhancement method based on knowledge graph, the problems of incomplete information acquisition and data integration in traditional Chinese medicine prescription generation are solved, the accurate generation and interpretability of traditional Chinese medicine prescriptions are achieved, and the accuracy and efficiency of prescription generation are improved.
Patent Information
- Application Number
- CN202510053730.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-02-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional Chinese medicine prescription generation methods face problems such as incomplete information acquisition, difficulty in data integration and lack of interpretability, and it is difficult to effectively correlate patient medical record information with data in the knowledge graph to generate accurate Chinese medicine prescriptions.
Using a search enhancement method based on knowledge graph, the steps of realizing the traditional Chinese medicine prescriptions through knowledge extraction and construction, patient medical record information extraction, knowledge graph association and prescription generation, knowledge enhancement, and improving prescription interpretability and establishing feedback mechanisms. Accurate generation.
It improves the accuracy and efficiency of traditional Chinese medicine prescription generation, enhances the system's interpretability, enables doctors and patients to clearly understand the basis for generating results, and has good adaptability and the ability to provide personalized treatment plans.
Smart Images

Figure CN119479985A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data and artificial intelligence technology, and in particular to a method and system for generating traditional Chinese medicine prescriptions based on knowledge graph retrieval enhancement. Background Art
[0002] As an important part of traditional Chinese medicine, TCM contains rich cultural connotations and therapeutic wisdom. The generation of TCM prescriptions not only depends on the doctor's experience and knowledge, but also requires a comprehensive analysis of the patient's specific symptoms, signs and medical records. However, traditional prescription generation methods often face problems such as incomplete information acquisition, difficulty in data integration and lack of interpretability. These challenges limit the application and promotion of TCM in the modern medical system.
[0003] With the development of big data and artificial intelligence technology, especially the rise of large language models (LLM) and knowledge graphs, new opportunities have been provided for the generation of TCM prescriptions. Knowledge graphs can structure information such as symptoms, tongue coating, pulse, Chinese herbal medicine, and examinations in the field of TCM, thus forming a comprehensive knowledge system. This structured information not only helps to improve the accuracy of prescription generation, but also enhances the interpretability of the system, allowing doctors to better understand the basis for the generated results.
[0004] However, in practical applications, how to effectively associate the patient's medical record information with the data in the knowledge graph to generate accurate TCM prescriptions is still an urgent problem to be solved. In addition, existing retrieval methods mostly focus on a single information source and lack the ability to comprehensively process multiple data types. Therefore, the TCM prescription generation method and system based on knowledge graph retrieval enhancement can not only improve the efficiency of information retrieval, but also realize the in-depth analysis and integration of complex medical record information, providing more solid technical support for the development of traditional Chinese medicine.
[0005] The present invention aims to develop a method and system for generating TCM prescriptions based on knowledge graph retrieval enhancement, which will bring innovative solutions to the field of TCM, help improve the level of TCM diagnosis and treatment, and promote the application and development of traditional medicine in the modern medical system. Summary of the invention
[0006] The present invention currently aims to provide a method and system for generating traditional Chinese medicine prescriptions based on knowledge graph retrieval enhancement to solve the technical problems mentioned in the background technology.
[0007] To achieve the above object, the present invention provides the following technical solutions: A method for generating traditional Chinese medicine prescriptions based on knowledge graph retrieval enhancement, the method comprising: S1, knowledge extraction and knowledge graph construction; S2, patient medical record information extraction; S3, knowledge graph association and prescription generation; S4, prescription generation based on knowledge enhancement; S5. Improve the interpretability of prescriptions and establish a feedback mechanism.
[0008] As a further technical solution of the present invention, in step S1, the steps of knowledge extraction and knowledge graph construction include: S1.1. Literature data preparation: Collect and organize literature materials related to traditional Chinese medicine, including modern medical guidelines, classic medical records and ancient texts; Qwen72B is used to process the literature and identify entity information, including symptoms, tongue coating, pulse, Chinese herbal medicine, prescription and other entities; natural language processing technology is used to convert the entity information into structured data; S1.2. Build a knowledge graph: Store the extracted entities and their relationships in the Neo4j database to form a multi-level knowledge graph, where each node represents an entity and each edge represents the relationship between entities; The relationship in the knowledge graph can be expressed by the following formula: ; Where R represents all relations, Representing Entities and The relationship between.
[0009] As a further technical solution of the present invention, in step S2, the patient medical record information extraction step includes: After building the knowledge graph, the system will input the patient's medical record information and perform the following operations: Qwen72B is used to analyze the patient's medical records and extract key information, including symptoms, tongue coating, pulse, etc. This process also relies on named entity recognition technology; The extracted information is structured as follows: ; Where P represents all the key information in the patient's medical record, Indicates the i-th symptom or sign.
[0010] As a further technical solution of the present invention, in step S3, the knowledge graph association and prescription generation step includes: After obtaining the patient's medical record information, we first performed association and reasoning on the knowledge graph, using BM25 and vector retrieval methods to complement each other to improve the accuracy and efficiency of TCM prescription generation; S3.1, BM25 search: The score calculation formula of BM25 is: ; in: It's a document. is a query, Yes word In the documentation The frequency in is the inverse document frequency, and is the adjustment parameter, is the document length, is the average length of all documents; S3.2, vector search: Vector retrieval usually involves the following steps: first, documents and queries are converted into high-dimensional vectors, and a large language model (such as Qwen72B) is used to encode the text and generate its corresponding vector representation. Each word or phrase is mapped into an n-dimensional space to form a sparse or dense vector. Second, the similarity between the query vector and the document vector is calculated using cosine similarity, Euclidean distance or other distance measurement methods. Combining BM25 with vector search can give full play to the advantages of both.
[0011] As a further technical solution of the present invention, in step S4, the step of generating a prescription based on knowledge enhancement includes: S4.1. Comprehensive information analysis: The system will combine the information retrieved from the knowledge graph and the inference results to conduct a comprehensive analysis of the patient's medical records and generate personalized prescriptions, which can be expressed as: ; in, represents the generated prescription, is a function that combines patient information And the inference results ; S4.2. Prescription generation: Based on the analysis results, the system will generate a prescription containing Chinese herbal medicines and their usage.
[0012] As a further technical solution of the present invention, in step S5, the steps of improving the interpretability of prescriptions and establishing a feedback mechanism include: Each generated prescription will be accompanied by corresponding evidence, including the symptoms, relevant medical records, and recommended treatments, so that doctors and patients can clearly understand the logic behind the prescription. The interpretable output can be expressed as: ; in, Indicates explanatory information, including symptoms , corresponding medical records , and prescriptions Detailed description ; Establish a feedback mechanism to continuously optimize the knowledge graph and generate models based on the feedback from doctors and patients on the effects of prescriptions. This process can be expressed by the following formula: ; Here, O represents the optimized output and F is the feedback information.
[0013] Another object of the present invention is to provide a system for generating traditional Chinese medicine prescriptions based on knowledge graph retrieval enhancement, the system comprising: Knowledge graph construction module, used for knowledge extraction and knowledge graph construction; Medical record information extraction module, used to extract patient medical record information; Prescription generation module, used for knowledge graph association and prescription generation; Prescription enhancement module, used for prescription generation based on knowledge enhancement; Feedback optimization module, used to improve prescription interpretability and establish feedback mechanism.
[0014] Compared with the prior art, the present invention has the following beneficial effects: The TCM prescription generation method based on knowledge graph retrieval enhancement has many advantages. First, by constructing a TCM knowledge graph, the method structures and stores information such as symptoms, tongue coating, pulse, Chinese herbal medicine, and prescriptions to form a comprehensive knowledge system. This structured information not only improves the efficiency of data retrieval, but also enhances the accuracy of generated prescriptions, allowing the system to quickly locate medical records and treatment plans related to the patient's medical records.
[0015] Secondly, using large language models (such as Qwen72B) to extract patient medical records can effectively identify key information and ensure that the generation process fully considers the patient's specific situation. By combining the BM25 retrieval algorithm, the system can efficiently retrieve relevant information from the knowledge graph, further improving the speed and quality of prescription generation.
[0016] In addition, this method pays special attention to the interpretability of the generated results. Each generated prescription is accompanied by detailed evidence, including the symptoms and related medical records, so that doctors and patients can clearly understand the generation logic. This transparency not only enhances users' trust in the system, but also provides important support for clinical decision-making.
[0017] Finally, the method has good adaptability and can automatically adjust the generation strategy according to the medical records of different patients to provide personalized treatment plans. These advantages make the TCM prescription generation method based on knowledge graph retrieval enhancement show great potential in practical applications and provide strong technical support for the development and inheritance of TCM. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is the overall framework diagram of the TCM prescription generation method based on knowledge graph retrieval enhancement. DETAILED DESCRIPTION
[0019] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0020] See also Figure 1 , an embodiment of the present invention provides a method for generating a traditional Chinese medicine prescription based on knowledge graph retrieval enhancement, the method comprising: S1, knowledge extraction and knowledge graph construction; S1.1. Literature data preparation: Collect and organize literature materials related to traditional Chinese medicine, including modern medical guidelines, classic medical records and ancient texts; Qwen72B is used to process the literature and identify entity information, including symptoms, tongue coating, pulse, Chinese herbal medicine, prescription and other entities; natural language processing technology is used to convert the entity information into structured data; For example, for symptom recognition, named entity recognition (NER) technology can be used, which can be formulated as follows: ; Where E represents all entities extracted from the text, represents the i-th entity; S1.2. Build a knowledge graph: Store the extracted entities and their relationships in the Neo4j database to form a multi-level knowledge graph, where each node represents an entity and each edge represents the relationship between entities; The relationship in the knowledge graph can be expressed by the following formula: ; Where R represents all relations, Representing Entities and The relationship between.
[0021] S2, patient medical record information extraction; After building the knowledge graph, the system will input the patient's medical record information and perform the following operations: Qwen72B is used to analyze the patient's medical records and extract key information, including symptoms, tongue coating, pulse, etc. This process also relies on named entity recognition technology; The extracted information is structured as follows: ; Where P represents all the key information in the patient's medical record, Indicates the i-th symptom or sign.
[0022] S3, knowledge graph association and prescription generation; After obtaining the patient's medical record information, we first performed association and reasoning on the knowledge graph, using BM25 and vector retrieval methods to complement each other to improve the accuracy and efficiency of TCM prescription generation; S3.1, BM25 search: BM25 (Best Match 25) is a widely used text retrieval algorithm that mainly achieves information retrieval by calculating the relevance score between documents and queries. The score calculation formula of BM25 is: ; in: It's a document. is a query, Yes word In the documentation The frequency in is the inverse document frequency, and is the adjustment parameter, is the document length, is the average length of all documents; BM25 dynamically adjusts the relevance score by considering word frequency and document length, effectively handling long queries and improving the relevance of search results; S3.2, vector search: In addition to BM25, the system also uses vector retrieval methods to better handle semantic similarity and fuzzy queries. Vector retrieval usually involves the following steps: First, documents and queries are converted into high-dimensional vectors, and large language models (such as Qwen72B) are used to encode the text and generate its corresponding vector representation. Each word or phrase is mapped to an n-dimensional space to form a sparse or dense vector. Second, cosine similarity, Euclidean distance or other distance measurement methods are used to calculate the similarity between the query vector and the document vector; for example, the calculation formula for cosine similarity is:
[0023] in, and are two vectors, and is their norm.
[0024] Combining BM25 with vector retrieval can give full play to the advantages of both. BM25 performs well in processing structured keywords, while vector retrieval is more advantageous in capturing semantic relationships. This combination method enables the system to provide more accurate and comprehensive information support in complex TCM prescription generation scenarios, thereby improving the overall effect. Through this multi-level information retrieval strategy, the present invention can effectively improve the quality and efficiency of TCM prescription generation.
[0025] S4, prescription generation based on knowledge enhancement; In the stage of prescription generation based on knowledge enhancement, the system will generate interpretable prescriptions based on reasoning results. The specific implementation plan is as follows: S4.1. Comprehensive information analysis: The system will combine the information retrieved from the knowledge graph and the inference results to conduct a comprehensive analysis of the patient's medical records and generate personalized prescriptions, which can be expressed as: ; in, represents the generated prescription, is a function that combines patient information And the inference results ; S4.2. Prescription generation: Based on the analysis results, the system will generate a prescription containing Chinese herbal medicines and their usage. For example, a generated prescription may include:
[0026] Each drug is accompanied by the corresponding dosage and usage.
[0027] S5. Improve the interpretability of prescriptions and establish a feedback mechanism.
[0028] In order to improve the interpretability of the generated results, this system will implement the following functions: Each generated prescription will be accompanied by corresponding evidence, including the symptoms, relevant medical records, and recommended treatments, so that doctors and patients can clearly understand the logic behind the prescription. The interpretable output can be expressed as: ; in, Indicates explanatory information, including symptoms , corresponding medical records , and prescriptions Detailed description ; The system will establish a feedback mechanism to continuously optimize the knowledge graph and generate models based on the feedback from doctors and patients on the effects of prescriptions. This process can be expressed by the following formula: ; Here, O represents the optimized output and F is the feedback information.
[0029] Another object of the present invention is to provide a system for generating traditional Chinese medicine prescriptions based on knowledge graph retrieval enhancement, the system comprising: Knowledge graph construction module, used for knowledge extraction and knowledge graph construction; Medical record information extraction module, used to extract patient medical record information; Prescription generation module, used for knowledge graph association and prescription generation; Prescription enhancement module, used for prescription generation based on knowledge enhancement; Feedback optimization module, used to improve prescription interpretability and establish feedback mechanism.
[0030] It should be noted that, in this article, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0031] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for generating traditional Chinese medicine prescriptions based on knowledge graph retrieval enhancement, characterized in that: The method comprises: S1, knowledge extraction and knowledge graph construction; S2, patient medical record information extraction; S3, knowledge graph association and prescription generation; S4, prescription generation based on knowledge enhancement; S5. Improve the interpretability of prescriptions and establish a feedback mechanism.
2. The method for generating traditional Chinese medicine prescriptions based on knowledge graph retrieval enhancement according to claim 1, characterized in that: In step S1, the steps of knowledge extraction and knowledge graph construction include: S1.
1. Literature data preparation: Collect and organize literature materials related to traditional Chinese medicine, including modern medical guidelines, classic medical records and ancient texts; Qwen72B is used to process the literature and identify entity information, including symptoms, tongue coating, pulse, Chinese herbal medicine and prescriptions; natural language processing technology is used to convert the entity information into structured data; S1.
2. Build a knowledge graph: Store the extracted entities and their relationships in the Neo4j database to form a multi-level knowledge graph, where each node represents an entity and each edge represents the relationship between entities; The relationship in the knowledge graph is expressed by the following formula: ; Where R represents all relations, Representing Entities and The relationship between.
3. The method for generating traditional Chinese medicine prescriptions based on knowledge graph retrieval enhancement according to claim 1 is characterized in that: In step S2, the patient medical record information extraction step includes: After building the knowledge graph, the system will input the patient's medical record information and perform the following operations: Qwen72B was used to analyze the patient's medical records and extract key information, including symptoms, tongue coating, and pulse. The extracted information is structured as follows: ; Where P represents all the key information in the patient's medical record, Indicates the i-th symptom or sign.
4. The method for generating traditional Chinese medicine prescriptions based on knowledge graph retrieval enhancement according to claim 1, characterized in that: In step S3, the knowledge graph association and prescription generation steps include: After obtaining the patient's medical record information, we first performed association and reasoning on the knowledge graph, using BM25 and vector retrieval methods to complement each other; S3.1, BM25 search: The score calculation formula of BM25 is: ; in: It's a document. is a query, Yes word In the documentation The frequency in is the inverse document frequency, and is the adjustment parameter, is the document length, is the average length of all documents; S3.2, vector search: Vector retrieval involves the following steps: first, documents and queries are converted into high-dimensional vectors, and a large language model is used to encode the text to generate its corresponding vector representation. Each word or phrase is mapped into an n-dimensional space to form a sparse or dense vector. Second, a distance metric method is used to calculate the similarity between the query vector and the document vector. Combine BM25 with vector search to take advantage of both.
5. The method for generating traditional Chinese medicine prescriptions based on knowledge graph retrieval enhancement according to claim 1, characterized in that: In step S4, the steps of generating a prescription based on knowledge enhancement include: S4.
1. Comprehensive information analysis: The system will combine the information retrieved from the knowledge graph and the inference results to conduct a comprehensive analysis of the patient's medical records and generate a personalized prescription, which is expressed as: ; in, represents the generated prescription, is a function that combines patient information And the inference results ; S4.
2. Prescription generation: Based on the analysis results, a prescription containing Chinese herbal medicines and their usage is generated.
6. The method for generating traditional Chinese medicine prescriptions based on knowledge graph retrieval enhancement according to claim 1, characterized in that: In step S5, the steps of improving prescription interpretability and establishing a feedback mechanism include: Each generated prescription will be accompanied by corresponding evidence, including the symptoms, relevant medical records and recommended treatment methods, so that doctors and patients can clearly understand the logic behind the prescription. The interpretable output is expressed as: ; in, Indicates explanatory information, including symptoms , corresponding medical records , and prescriptions Detailed description ; A feedback mechanism is established to continuously optimize the knowledge graph and generate models based on the feedback from doctors and patients on the effects of prescriptions. This process is expressed by the following formula: ; Here, O represents the optimized output and F is the feedback information.
7. A TCM prescription generation system based on knowledge graph retrieval enhancement, characterized in that: The system comprises: Knowledge graph construction module, used for knowledge extraction and knowledge graph construction; Medical record information extraction module, used to extract patient medical record information; Prescription generation module, used for knowledge graph association and prescription generation; Prescription enhancement module, used for prescription generation based on knowledge enhancement; Feedback optimization module, used to improve prescription interpretability and establish feedback mechanism.
Citation Information
Patent Citations
Traditional Chinese medicine clinical decision support system and method
CN113077873A
Traditional Chinese medicine prescription recommendation method based on knowledge graph
CN116680412A
Retrieval enhancement generation system based on medical knowledge graph
CN118394952A
Hospital guidance method and equipment based on large model, medium and product
CN119252449A
Quantum computing program generation method and system based on retrieval enhancement generation technology
CN119293140A