Ophthalmic intelligent question answering method, system, storage medium, and electronic device based on graph retrieval enhancement.
By constructing an ophthalmology knowledge graph and combining it with multi-hop graph retrieval and context enhancement techniques, the problems of illusion and knowledge limitation in ophthalmology clinical dialogues by large language models have been solved, and a highly accurate, deep reasoning and interpretable intelligent question-answering system has been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU MULE TECH CO LTD
- Filing Date
- 2026-02-10
- Publication Date
- 2026-06-30
AI Technical Summary
Existing large language models suffer from hallucination problems and domain knowledge limitations in ophthalmological clinical dialogues, making it difficult to provide accurate, in-depth reasoning, and interpretable intelligent question answering.
We construct a knowledge graph in the field of ophthalmology, and generate accurate response text by combining multi-hop graph retrieval and context enhancement techniques with a pre-trained language model. We also provide knowledge tracing paths to enhance interpretability.
It significantly improves the accuracy and safety of ophthalmological clinical dialogues, reduces the incidence of hallucinations, provides in-depth reasoning and personalized suggestions, and supports dynamic updates of the knowledge base and multi-scenario applications.
Smart Images

Figure CN122309650A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical information processing technology, specifically relating to an ophthalmic intelligent question-answering method, system, storage medium, and electronic device based on graph retrieval enhancement generation. Background Technology
[0002] In recent years, Large Language Models (LLMs) have made significant progress in the field of natural language processing, demonstrating their potential to improve doctor-patient communication in medical dialogues. Ophthalmology, as a highly specialized and conceptually complex discipline, often involves detailed explanations of anatomy, pathology, and treatment plans in its clinical communication, demanding extremely high accuracy and efficiency. Traditional outpatient clinics have limited time, making it difficult to achieve sufficient communication, which can easily lead to insufficient patient understanding and decreased compliance.
[0003] However, directly applying general-purpose large language models to ophthalmological clinical dialogue faces two major challenges. First, there's the "illusion" problem, where the model may generate inaccurate or even completely erroneous information. In the high-risk field of medicine, any inaccurate information could mislead doctors' clinical decisions or patients' health management, posing a serious safety hazard. Second, there's the limitation of domain knowledge; general-purpose models lack a deep, structured understanding of specific medical fields (such as ophthalmology), resulting in poor performance when dealing with complex clinical problems requiring multi-step reasoning.
[0004] To address the aforementioned issues, Retrieval-Augmented Generation (RAG) technology has been proposed. This technique enhances the model's input by retrieving relevant information from external knowledge bases, thereby improving the accuracy and reliability of the generated content. However, traditional RAG methods mostly rely on unstructured text block retrieval based on semantic similarity, which has limitations when dealing with complex medical problems. For example, it struggles to capture the deep logical relationships between different medical concepts (such as diseases, drugs, and anatomical structures), easily introduces irrelevant or redundant information as noise, and performs poorly in complex scenarios requiring multi-hop reasoning.
[0005] Therefore, there is an urgent need for a new technical solution that can overcome the illusion problem and knowledge limitations of general large language models, while surpassing the shallow retrieval mode of traditional RAG methods, and providing an intelligent question-answering system for ophthalmic clinical dialogue that is both safe and accurate, and has deep reasoning capabilities and good interpretability. Summary of the Invention
[0006] The purpose of this invention is to solve the aforementioned technical problems in the prior art and to provide an ophthalmic intelligent question-answering method, system, storage medium, and electronic device based on graph retrieval enhancement. By constructing a domain-specific ophthalmic knowledge graph and utilizing graph structure for multi-hop reasoning and contextual retrieval, the clinical accuracy, security, and interpretability of the dialogue content are significantly improved, enabling high-quality and personalized communication support for doctors and patients.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0008] An ophthalmology intelligent question answering method based on graph retrieval enhancement includes the following steps:
[0009] Step 1: Construct a knowledge graph. From one or more ophthalmology clinical guideline documents, use natural language processing technology to automatically extract entities and their relationships in the ophthalmology field, and construct a structured ophthalmology knowledge graph.
[0010] Step 2: Receive and analyze queries. Receive query requests input by users in natural language and parse out the key entities and user intent.
[0011] Step 3: Perform graph retrieval. Starting with key entities as nodes, perform multi-hop retrieval in the ophthalmology knowledge graph to generate a contextual subgraph containing relevant entities and relationships.
[0012] Step 4: Enhance the context by pruning information and extracting key points from the context subgraph, and combine the extracted results with the original query to construct enhanced prompts for input into the large language model.
[0013] Step 5: Dialogue generation and output. The enhanced prompts are input into a pre-trained large language model, which generates the final response text and outputs it to the user.
[0014] Furthermore, in step one, a pre-trained language model combined with prompting engineering is used to perform entity recognition and relation extraction on ophthalmology clinical guideline documents.
[0015] Furthermore, in step three, the depth and breadth of multi-hop retrieval are dynamically adjusted based on the complexity of the user's query semantics.
[0016] Furthermore, the method also includes: during the process of generating the response text, optionally providing the tracing path consisting of the corresponding entities and their relationships in the ophthalmology domain knowledge graph on which the response is based, in order to enhance the interpretability for teaching or clinical purposes.
[0017] Furthermore, the method also includes: receiving the user's vision screening result data, mapping the data to examination result entities in the ophthalmology domain knowledge graph, and performing multi-hop retrieval in the ophthalmology domain knowledge graph based on the examination result entity and / or the key entities parsed in step two as starting nodes to generate personalized risk assessment and health intervention suggestions.
[0018] Furthermore, the method also includes: acquiring the patient's electronic medical record data and extracting ophthalmology-related clinical entities from it; in step three, using the clinical entities and the key entities parsed in step two as starting nodes to perform multi-hop retrieval in the ophthalmology domain knowledge graph.
[0019] A system for implementing an ophthalmic intelligent question-answering method based on graph retrieval enhancement, as described above, includes a knowledge graph construction module, a graph retrieval module, a context enhancement module, and a dialogue generation module.
[0020] The knowledge graph construction module is used to automatically extract entities and relationships in the ophthalmology field from one or more ophthalmology clinical guideline documents using natural language processing technology, and construct a structured ophthalmology field knowledge graph.
[0021] The graph retrieval module is used to receive natural language queries input by users and perform multi-hop retrieval in the ophthalmology knowledge graph to retrieve a subgraph containing multiple related entities and relationships as the initial context.
[0022] The context enhancement module processes the initial context subgraph output by the graph retrieval module, extracts key knowledge points, and integrates them with the user's original query to build enhanced suggestions.
[0023] The dialogue generation module is used to input the enhanced prompts generated by the context enhancement module into a pre-trained large language model, which then generates user-oriented response text based on the enhanced prompts.
[0024] Furthermore, the question-answering system also includes a user interface module, which receives natural language queries input by users and displays the generated response text.
[0025] Furthermore, the knowledge graph construction module includes: a document processing unit, used to parse and segment the input clinical guideline documents; an entity relation extraction unit, which uses a pre-trained language model to process text blocks to identify and extract ophthalmological entities and semantic relations between entities; and a graph construction unit, used to construct a preliminary graph structure by using the extracted entities as nodes and relations as edges, and then generate a structured ophthalmology domain knowledge graph through deduplication and fusion processing.
[0026] Furthermore, entities in the knowledge graph construction module include at least one of the following: disease, anatomical structure, diagnostic procedure, treatment method, drug, examination result, risk factor, and medical device.
[0027] Furthermore, the relationships in the knowledge graph construction module include causal relationships, association relationships, or hierarchical relationships.
[0028] Furthermore, the knowledge graph construction module also includes an incremental update mechanism, which is used to dynamically integrate new clinical guidelines or knowledge sources into the ophthalmology knowledge graph without interrupting system services.
[0029] Furthermore, the graph retrieval module is configured to use key entities identified from the user's natural language query as the starting point for retrieval, and adaptively adjust the depth and breadth of the retrieval based on the semantic complexity of the user's query, in order to achieve a balance between comprehensiveness of response and conciseness of information.
[0030] Furthermore, the dialogue generation module is configured to selectively provide knowledge tracing information when generating response text. This knowledge tracing information includes entity nodes, relation edges, and their corresponding original clinical guideline clauses in the knowledge graph on which the response is based.
[0031] Furthermore, the system also includes a query parsing module, which performs syntactic and semantic analysis on the user's natural language query to identify the user's intent and the key entities involved in the query.
[0032] Furthermore, the system supports integration with electronic medical record systems. In remote ophthalmology consultation scenarios, ophthalmology-related clinical entities can be extracted from patients' historical medical data, and these clinical entities can be used as one of the starting nodes for graph retrieval.
[0033] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the aforementioned ophthalmic intelligent question-answering method based on graph retrieval enhancement generation.
[0034] An electronic device includes one or more processors and a memory storing a computer program. When the computer program is executed by one or more processors, the electronic device enables the ophthalmic intelligent question-answering method based on graph retrieval enhancement generation as described above.
[0035] The present invention, by adopting the above-described technical solution, has the following beneficial effects:
[0036] This invention significantly improves accuracy and suppresses model hallucinations. By firmly anchoring the dialogue generation process to a knowledge graph constructed from authoritative clinical guidelines, this invention fundamentally restricts the free expression of large language models, ensuring that the generated content is verifiable. Experiments have shown that this system can drastically reduce the incidence of hallucinations in clinical dialogues from 30% in the baseline model to 3.3%, greatly enhancing the safety of medical dialogues.
[0037] This invention enables deep reasoning and provides comprehensive recommendations. Leveraging the graph structure of knowledge graphs, this system can perform complex multi-hop reasoning, connecting seemingly disparate medical concepts. For example, when dealing with complex cases of glaucoma, cataracts, and diabetes, this system can comprehensively consider the interplay of these conditions, providing integrated lifestyle and treatment management recommendations—something traditional RAG methods struggle to achieve.
[0038] This invention enhances interpretability and reliability. Because all responses originate from specific nodes and relationships within a knowledge graph, the system can trace any generated conclusion back to the original clinical guideline provisions. This "white-box" nature not only increases clinicians' trust in the system's output but also enables subsequent auditing, validation, and medical education.
[0039] This invention offers high flexibility and scalability. Its system architecture supports dynamic incremental updates to the knowledge graph, enabling rapid absorption of the latest medical research and clinical guidelines, thus maintaining the knowledge base's cutting-edge nature. Furthermore, by expanding the knowledge graph's content and adjusting the interaction logic, this system can be flexibly applied to various scenarios such as vision screening, telemedicine, and medical education, demonstrating broad application prospects.
[0040] This invention improves the efficiency and quality of doctor-patient communication. By providing accurate, easy-to-understand, and personalized explanations of medical conditions and health management suggestions, this system can serve as a powerful assistant to clinicians, improving communication efficiency within limited outpatient hours, enhancing patients' right to know and participation, thereby improving doctor-patient relationships and clinical outcomes. Attached Figure Description
[0041] The present invention will be further described below with reference to the accompanying drawings:
[0042] Figure 1 This is an architecture diagram of the ophthalmology intelligent question-answering system of the present invention;
[0043] Figure 2 This is a flowchart of the knowledge graph construction process in this invention;
[0044] Figure 3 This is a flowchart of the ophthalmology intelligent question-answering method based on graph retrieval enhancement according to the present invention;
[0045] Figure 4This is a schematic diagram of the application process of the present invention in a vision screening scenario. Detailed Implementation
[0046] Example 1: An Ophthalmic Intelligent Question Answering Method Based on Graph Retrieval Enhancement
[0047] like Figure 3 As shown, this invention provides an ophthalmic intelligent question-answering method based on graph retrieval enhancement, comprising the following steps:
[0048] Step 1: Construct a knowledge graph. From one or more ophthalmology clinical guideline documents, use natural language processing technology to automatically extract entities and their relationships in the ophthalmology field, and construct a structured ophthalmology knowledge graph (OphthaKG). Entities include, but are not limited to, diseases, anatomical structures, diagnostic procedures, treatment methods, drugs, examination results, risk factors, and medical devices. Relationships represent the causal, associative, or hierarchical connections between these entities.
[0049] This invention employs a pre-trained language model (such as GPT-4o-mini) combined with prompting engineering to perform entity recognition and relation extraction on clinical guideline documents. Specifically, this includes: parsing and segmenting the input document; using a large language model to perform semantic understanding on the text blocks, identifying ophthalmology-related entities and the relationships between them (e.g., "glaucoma causes optic nerve damage"); and finally, using the extracted entities as nodes and relationships as edges to construct a preliminary graph structure, which is then processed through deduplication, conflict resolution, and knowledge fusion to generate a high-quality OphthaKG.
[0050] Step 2: Receive and analyze queries. Receive user query requests in natural language (e.g., "What might be the cause of blurred vision in diabetic patients?"), perform syntactic and semantic analysis on the query requests to parse out the user's intent and key entities involved (e.g., "diabetic retinopathy", "OCT examination", etc.), providing a starting point for subsequent graph retrieval.
[0051] Step 3: Perform graph retrieval. Using the key entities parsed in Step 2 as starting nodes, perform multi-hop retrieval in OphthaKG to generate a context subgraph containing related entities and relationships.
[0052] The retrieval process can adaptively adjust its depth (number of hops) and breadth (number of branches) based on the complexity of the user's query semantics. For example, simple queries (such as "What medications are used for glaucoma?") require only 1–2 hops, while complex reasoning queries (such as "What might cause blurred vision in diabetic patients?") can be extended to 3 hops or more to achieve a balance between comprehensiveness of response and conciseness of information.
[0053] The system introduces a dual-level retrieval strategy from the Lightweight Retrieval Enhancement Generative Framework (LightRAG) to achieve adaptive control over the depth and breadth of the retrieval, specifically including the following two modes: Low-level request handling: When the user inputs a specific ophthalmology entity query (e.g., "What are the symptoms of diabetic retinopathy"), the system identifies it as a low-level request. In this case, the search breadth (Top-K) focuses on related anatomical structures and pathological nodes, and the search depth is controlled within 2 hops to ensure the accuracy of the answer and clinical safety. High-level request handling: When the user inputs a comprehensive consultation or a vague complaint (such as "What should I do if my vision deteriorates"), the system automatically identifies it as a high-level request. At this time, the system calls the global summary index built by LightRAG to perform a broad search across multiple disease clusters and increases the search depth to cover the potential impact of systemic diseases such as hypertension and diabetes on the eyes.
[0054] This adaptation is not random, but rather a dynamic routing based on semantic clustering granularity, which solves the problem of missed diagnosis risk caused by information gaps in complex clinical decision-making.
[0055] In addition, the retrieval process supports multiple source start nodes. In specific scenarios, the following additional start nodes can be used in combination:
[0056] The vision screening results data provided by the user (such as visual acuity value and axial length) can be mapped to the "examination results" type entity;
[0057] Ophthalmology-related clinical entities (such as previous diagnoses and medication records) extracted from patients' electronic medical records (EMRs) can also serve as starting nodes, thereby enabling personalized, context-aware retrieval.
[0058] Step 4: Enhance the context by pruning the context subgraph (removing redundant or low-relevance paths) and extracting key points (retaining high-confidence, clinically relevant knowledge paths) to form a set of structured key knowledge points. These knowledge points are then integrated with the original user query to construct an enhanced prompt rich in domain knowledge, guiding the large language model to generate accurate and interpretable answers.
[0059] Information pruning and key point extraction are implemented through the following process: After obtaining the context subgraph, the system performs clinical relevance projection to optimize the quality of the context, specifically as follows: First, paths that conflict with the current patient's medical record (if any) are eliminated through vector similarity to avoid generating medical advice that contradicts the patient's actual situation; Second, using the key-point extraction algorithm, redundant guideline text chunks are simplified into structured "evidence triples" (e.g., [diabetes, leading to, macular edema]), retaining only nodes that are decisive for diagnosis, thereby improving the accuracy, conciseness, and clinical interpretability of the response.
[0060] Step 5: Dialogue generation and output. The enhanced prompts are input into a pre-trained large language model, which generates natural, fluent, clinically accurate and easy-to-understand response text, which is then presented to the user through the user interface.
[0061] During the generation process, the system may selectively provide knowledge tracing paths: that is, to label the specific entities, relationships and corresponding original clinical guideline provisions in the OphthaKG on which the response is based, in order to enhance clinical interpretability or medical education value.
[0062] The method of this invention can be flexibly applied to various intelligent ophthalmic service scenarios:
[0063] 1. Personalized Q&A scenario for vision screening:
[0064] like Figure 4 As shown, the user's vision screening results (such as visual acuity, refractive error, and axial length) are mapped to the "examination results" entity in OphthaKG. Starting from this, a graph retrieval is performed to generate personalized risk assessments (such as the risk of myopia progression), health intervention suggestions (such as adjustments to eye habits and follow-up examination cycles), and interpretations of the screening report.
[0065] 2. Remote ophthalmology consultation scenario:
[0066] By combining ophthalmological clinical entities in the patient's electronic medical record (such as diagnosis records, medication history, and surgical history), it supports continuous and multi-round intelligent consultation services such as initial symptom screening, long-term management of chronic eye diseases (such as glaucoma and AMD), and postoperative rehabilitation guidance.
[0067] 3. Ophthalmology medical education scenario:
[0068] Aimed at medical students or primary care physicians, it provides functions such as diagnostic reasoning training based on real cases, quick access to clinical guidelines, and comparison of treatment plans. It also enhances teaching effectiveness and evidence-based thinking by visually displaying the knowledge traceability path.
[0069] To illustrate more specifically how the above methods work in actual clinical scenarios, three application scenario examples are provided below:
[0070] Application Scenario Example 1: Complex Comorbidity Management Scenario (Glaucoma Combined with Diabetes)
[0071] Scenario description: The user is an elderly patient with glaucoma, age-related cataracts, and type 2 diabetes. The question is: "What lifestyle changes should I make to manage my eye disease and diabetes simultaneously?"
[0072] System processing flow:
[0073] Query analysis: Identify key entities "glaucoma", "cataract", "type 2 diabetes" and intent "lifestyle management";
[0074] Graph retrieval and reasoning:
[0075] Locate the aforementioned entity nodes in OphthaKG;
[0076] Through multi-hop reasoning, the following progression was observed: "Diabetes management" → "Blood pressure control" → "Retinal perfusion pressure" → "Glaucoma progression";
[0077] The search returned the node "Healthy Eating and Lifestyle", which was also associated with "Controlling Blood Sugar" (reducing the risk of retinopathy) and "Controlling Weight / BMI" (beneficial for intraocular pressure management).
[0078] Enhanced prompt construction: Extracting structured pathways: "Diabetes → Controlling blood sugar / blood pressure → Blood pressure affects optic nerve blood supply in glaucoma → Common intervention points: low-salt, low-fat diet, moderate aerobic exercise";
[0079] Final response generated:
[0080] This invention delivers the following: clearly points out the dual significance of controlling blood pressure in preventing the progression of diabetic retinopathy and protecting the optic nerve in glaucoma; recommends moderate aerobic exercise (such as walking) and avoids strenuous anaerobic exercise (which may increase intraocular pressure); and emphasizes a diet of low glycemic index foods.
[0081] Comparative results: Traditional RAG only returns dietary recommendations for diabetes and medication information for glaucoma separately, failing to establish a deep correlation between metabolism and intraocular pressure. It usually only gives general advice such as "please consult a general practitioner", lacking integration and operability.
[0082] Application scenario example 1 demonstrates the technical effect of this invention in the comprehensive management of multiple coexisting diseases: by leveraging the multi-hop reasoning capability of knowledge graphs, cross-disease mechanism connections are revealed, and collaborative intervention plans are generated.
[0083] Application Scenario Example 2: Decision-making on the Timing of Surgery (Cataract with Systemic Diseases)
[0084] Scenario description: The user is a male with age-related cataracts in both eyes, and a history of uncontrolled hypertension, cirrhosis, and pneumoconiosis. He asks, "Do I need immediate cataract surgery?"
[0085] System processing flow:
[0086] Entity extraction: Identify "senile cataract", "hypertension (uncontrolled)", "cirrhosis", and "pneumoconiosis";
[0087] Graph traversal:
[0088] Search for the "cataract surgery" node and associate it with "overall health status";
[0089] Search results for "hypertension" → "intraoperative bleeding risk"; "pneumoconiosis" → "decreased tolerance to surgery in supine position";
[0090] The search returned "decreased vision" → "fall risk in the elderly" → "fractures";
[0091] Enhanced context: Integrating the necessity of surgery (improving vision, reducing the risk of falls) with contraindications for surgery (uncontrolled hypertension, poor respiratory function);
[0092] Final response generated:
[0093] This invention suggests "postponing surgery," prioritizing blood pressure control and assessing anesthesia tolerance through medical evaluation, and then scheduling surgery electively after the patient's overall condition has stabilized.
[0094] Comparative results: Current technology determines surgical indications based solely on ophthalmological indicators (such as visual acuity <0.3), ignoring systemic risks, which may lead to serious perioperative complications.
[0095] Application scenario example 2 demonstrates that the present invention can comprehensively consider eye diseases and overall health status in perioperative risk assessment, thereby improving the comprehensiveness of the assessment.
[0096] Application Scenario Example 3: Explanation of Disease Progression Mechanisms (Diabetic Retinopathy)
[0097] Scenario description: The user has a 15-year history of type 2 diabetes and proliferative diabetic retinopathy with tractional retinal detachment in the right eye. Question: "How does controlling diabetes affect the progression of my fundus disease?"
[0098] System processing flow:
[0099] Image search: Starting with "diabetes control (HbA1c)" and "retinal neovascularization";
[0100] Path discovery:
[0101] In OphthaKG, we traced the DCCT (Diabetes Control and Complications Trial) study node and extracted quantitative evidence that "HbA1c ≤7% can significantly reduce the risk of microvascular complications";
[0102] The search result for the term "tractional retinal detachment" suggests the need for surgical intervention (such as vitrectomy).
[0103] Final response generated:
[0104] This invention provides an explanation of the mechanism of microvascular damage caused by hyperglycemia, and uses DCCT data to illustrate that blood sugar control can delay early lesions. However, for "tractional retinal detachment," it emphasizes that fundus surgery must be performed as soon as possible at this stage, otherwise irreversible blindness may result.
[0105] Comparative results: Traditional models are prone to creating illusions, such as false promises that "retinal detachment can recover on its own as long as blood sugar is controlled," which may have an adverse effect on patient health management.
[0106] The above application scenario example 3 highlights the technological advancement of this invention in accurate disease staging and intervention strategy matching, effectively avoiding the risk of misdiagnosis and mistreatment caused by model illusion.
[0107] The above application scenario examples 1, 2, and 3 demonstrate how the system of the present invention utilizes the multi-hop reasoning capability of knowledge graphs to handle complex clinical problems involving multiple coexisting diseases, overall condition assessment, disease mechanism and treatment stage judgment, and achieves intelligent question answering that is both safe and accurate and has in-depth comprehensive analysis capabilities.
[0108] Experimental verification:
[0109] To verify the effectiveness of the system of the present invention (hereinafter referred to as EyeRAG), the present invention constructed an OphthaKG containing 12,393 entity nodes and 13,731 relations based on 94 authoritative ophthalmology clinical guidelines, and tested it using real desensitized clinical datasets from multiple hospitals.
[0110] For ease of description and comparison, the following four typical methods in the prior art will be referred to as:
[0111] Baseline Model A: General Large Language Model (without integration of external knowledge retrieval mechanisms);
[0112] Baseline Model B: A retrieval enhancement generation method based on the semantic similarity of flat text blocks;
[0113] Baseline Model C: Hypothesis-based retrieval enhancement method;
[0114] Baseline Model D: A multi-granularity retrieval enhancement method based on document hierarchy.
[0115] The comparative experimental results shown in Tables 1 to 3 below (see Tables 1 to 3 for details) demonstrate that, compared with existing technologies, the present invention has significant improvements in clinical accuracy, safety, completeness, and practicality.
[0116] Table 1: Overall Ranking of Response Quality by Method
[0117]
[0118] Table 2: Comparison of the incidence of "hallucinations" in the models ("hallucinations" refer to the generation of factual errors or content that contradicts clinical guidelines).
[0119]
[0120] Table 3: Detailed Comparison of Ophthalmologist Scores (Maximum 3 points)
[0121]
[0122] The experimental results above show that by introducing a structured knowledge graph and a multi-hop reasoning mechanism, the present invention can significantly reduce the incidence of hallucinations in clinical dialogues from 30% in the general large language model to 3.3%, and demonstrates a clear advantage in dealing with complex clinical problems that require multi-step reasoning and comprehensive judgment.
[0123] Example 2: Ophthalmology Intelligent Question-Answering System
[0124] like Figure 1 As shown, the present invention also provides a question-answering system for implementing the above-described question-answering method, comprising the following modules:
[0125] The user interface module is used to receive natural language queries input by the user and display the generated response text.
[0126] The query parsing module is used to perform syntactic and semantic analysis on users' natural language queries, and to identify user intent and key entities involved in the query.
[0127] The knowledge graph construction module is used to automatically extract entities and relationships in the ophthalmology field from one or more ophthalmology clinical guideline documents using natural language processing technology, and construct a structured OphthaKG. Entities include at least one of diseases, anatomical structures, diagnostic procedures, treatment methods, drugs, examination results, risk factors, and medical devices, and relationships include causal relationships, association relationships, or hierarchical relationships.
[0128] like Figure 2 As shown, the knowledge graph construction module further includes:
[0129] The document processing unit parses and segments the input clinical guideline documents. It receives one or more authoritative ophthalmology clinical guideline documents in PDF format as input. First, the unit parses the documents, dividing them into smaller text blocks (e.g., each text block contains approximately 1000 lexical units) to facilitate subsequent refined information extraction. This segmentation approach helps improve the efficiency and accuracy of entity recognition and relation extraction.
[0130] The entity relation extraction unit processes text blocks using a pre-trained language model to identify and extract ophthalmological entities and their semantic relationships. This unit utilizes a pre-trained language model (such as GPT-4o-mini) to process the text blocks. Through carefully designed prompt engineering to optimize model performance, the model can efficiently identify and extract key entities in the ophthalmology field, such as disease names (e.g., "glaucoma"), anatomical structures (e.g., "retina"), and treatment methods (e.g., "vitrectomy"). Furthermore, the model can identify semantic relationships between these entities, such as "glaucoma leads to optic nerve damage," thus forming a rich and structured knowledge representation.
[0131] The graph construction unit is used to build a preliminary graph structure by using extracted entities as nodes and relations as edges. After deduplication and fusion processing, a structured OphthaKG is generated. The graph construction unit is responsible for integrating the entities and relations obtained from the entity and relation extraction unit. First, it constructs a preliminary graph structure using these entities as nodes and relations as edges. Then, through a deduplication and merging process, it merges identical or similar information from different text blocks, optimizing the graph structure and reducing redundant information. This process ultimately generates a compact, efficient, and comprehensive Ophthalmology Knowledge Graph. This graph stores a massive amount of ophthalmology expertise in a structured form and supports a dynamic incremental update mechanism. This allows for the dynamic integration of new clinical guidelines or knowledge sources into the existing knowledge graph without interrupting system services, ensuring the timeliness of the knowledge base.
[0132] The graph retrieval module receives natural language queries input by the user and performs multi-hop retrieval in OphthaKG to retrieve a subgraph containing multiple related entities and relations as the initial context. The graph retrieval module is configured to adaptively adjust the depth (number of hops) and breadth (number of branches) of the retrieval based on the semantic complexity of the user query to achieve a balance between the comprehensiveness and conciseness of the answer.
[0133] In specific application scenarios, the graph retrieval module also supports multi-source starting nodes: in addition to the key entities obtained from query parsing, users' vision screening results data (such as visual acuity value and axial length) can be mapped to the "examination results" type entity in OphthaKG, or ophthalmology-related clinical entities (such as previous diagnoses, medication history, and surgical records) extracted from the patient's electronic medical record system can be used as additional starting nodes to jointly participate in graph retrieval, thereby realizing personalized and context-aware question-and-answer services;
[0134] The context enhancement module processes the initial context subgraph output by the graph retrieval module, extracts key knowledge points, and integrates them with the user's original query to build enhanced suggestions.
[0135] The dialogue generation module takes the enhanced prompts generated by the context enhancement module and inputs them into a pre-trained large language model. The large language model then generates user-oriented response text based on these prompts. This module also selectively provides knowledge tracing information, including entity nodes, relation edges, and their corresponding original clinical guideline provisions in the knowledge graph. This knowledge tracing information is implemented through an entity-text mapping index established during the knowledge graph construction phase. Each entity node and relation edge is associated with its source clinical guideline document ID, chapter, and original text fragment, ensuring that the response content can be traced back to authoritative sources.
[0136] The system supports integration with electronic medical record systems. In remote ophthalmology consultation scenarios, it can obtain patients' historical medical data with their authorization and automatically extract ophthalmology-related clinical entities from the data as one of the starting nodes for graph retrieval. This enables continuous, multi-round intelligent consultation services such as symptom screening, chronic disease management, and postoperative rehabilitation guidance.
[0137] The system of this invention (EyeRAG) was compared with several mainstream baseline methods, including baseline model A, baseline model B, baseline model C, and baseline model D. Experimental results show that the system of this invention significantly outperforms other baseline methods in overall ranking of response quality, incidence of hallucinations, and detailed scores from ophthalmologists across multiple assessment dimensions (see Tables 1, 2, and 3). The advantages of this invention are particularly evident in complex reasoning scenarios involving multiple coexisting diseases. For example, in the scenario of deciding on the timing of surgery, this invention can comprehensively consider the patient's overall health status, providing a more comprehensive and accurate assessment plan, while most existing technologies only focus on ophthalmological indicators, ignoring the fatal impact of systemic diseases on surgical safety.
[0138] Example 3: Computer-readable storage medium
[0139] The present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned ophthalmic intelligent question-answering method based on graph retrieval enhancement generation.
[0140] Example 4: Electronic Equipment
[0141] The present invention provides an electronic device, including one or more processors and a memory. The memory stores a computer program. When the computer program is executed by one or more processors, the electronic device enables the above-mentioned ophthalmic intelligent question answering method based on graph retrieval enhancement generation.
[0142] This invention achieves a unified approach to high accuracy, strong interpretability, and deep reasoning capabilities by deeply integrating the generation capabilities of large language models with an ophthalmological knowledge graph built upon authoritative clinical guidelines. On the one hand, it significantly suppresses model illusions, ensuring clinically reliable answers; on the other hand, it supports multi-hop associative reasoning and personalized context awareness, providing comprehensive diagnostic and treatment recommendations. Simultaneously, the system possesses dynamic knowledge updates, flexible adaptation to multiple scenarios, and answer tracing capabilities, not only improving the efficiency and trust in doctor-patient communication but also laying a solid foundation for the large-scale application of intelligent ophthalmological question answering in screening, telemedicine, and medical education.
[0143] The above are merely specific embodiments of the present invention, but the technical features of the present invention are not limited thereto. Any simple changes, equivalent substitutions, or modifications made based on the present invention to solve essentially the same technical problems and achieve essentially the same technical effects are all covered within the protection scope of the present invention.
Claims
1. An ophthalmic intelligent question and answer method based on graph search enhancement generation, characterized in that, The steps include the following: Step 1: Construct a knowledge graph. From one or more ophthalmology clinical guideline documents, use natural language processing technology to automatically extract entities and their relationships in the ophthalmology field, and construct a structured ophthalmology knowledge graph. Step 2: Receive and analyze queries. Receive query requests input by users in natural language and parse out the key entities and user intent. Step 3: Perform graph retrieval. Using the key entity as the starting node, perform multi-hop retrieval in the ophthalmology knowledge graph to generate a context subgraph containing related entities and relationships. Step 4: Enhance the context by pruning information and extracting key points from the context subgraph, and combine the extracted results with the original query to construct enhanced prompts for input into the large language model. Step 5: Dialogue generation and output. The enhanced prompts are input into a pre-trained large language model, which generates the final response text and outputs it to the user.
2. The ophthalmology intelligent question answering method based on graph search enhanced generation according to claim 1, characterized in that: In step one, a pre-trained language model combined with prompting engineering is used to perform entity recognition and relation extraction on ophthalmology clinical guideline documents.
3. The ophthalmology intelligent question answering method based on graph search enhanced generation according to claim 1, characterized in that: In step three, the depth and breadth of multi-hop retrieval are dynamically adjusted based on the complexity of the user's query semantics.
4. The ophthalmology intelligent question answering method based on graph search retrieval enhancement generation of claim 1, wherein: The method further includes: during the process of generating the response text, selectively providing the tracing path consisting of the corresponding entities and their relationships in the ophthalmology knowledge graph on which the response is based, in order to enhance the interpretability for teaching or clinical purposes.
5. The ophthalmology intelligent question answering method based on graph search retrieval enhancement generation of claim 1, wherein: The method further includes: receiving the user's vision screening result data, mapping the data to examination result entities in the ophthalmology domain knowledge graph, and performing multi-hop retrieval in the ophthalmology domain knowledge graph based on the examination result entities and / or the key entities parsed in step two as starting nodes to generate personalized risk assessment and health intervention suggestions.
6. The ophthalmology intelligent question answering method based on graph search retrieval enhancement generation of claim 1, wherein: The method further includes: acquiring the patient's electronic medical record data and extracting ophthalmology-related clinical entities from it; in step three, the clinical entities and the key entities parsed in step two are used together as starting nodes to perform multi-hop retrieval in the ophthalmology domain knowledge graph.
7. A question-answering system implementing the ophthalmic intelligent question-answering method based on graph search enhancement generation according to any one of claims 1 to 6, characterized in that, include: The knowledge graph construction module is used to automatically extract entities and relationships in the ophthalmology field from one or more ophthalmology clinical guideline documents using natural language processing technology, and construct a structured ophthalmology field knowledge graph. The graph retrieval module is used to receive natural language queries input by the user and perform multi-hop retrieval in the ophthalmology knowledge graph to retrieve a subgraph containing multiple related entities and relationships as the initial context. The context enhancement module processes the initial context subgraph output by the graph retrieval module, extracts key knowledge points, and integrates them with the user's original query to build enhanced suggestions. The dialogue generation module is used to input the enhanced prompts generated by the context enhancement module into a pre-trained large language model, which then generates user-oriented response text based on the enhanced prompts.
8. The question answering system based on the ophthalmic intelligent question answering method of graph search enhanced generation according to claim 7, characterized in that: The question-and-answer system also includes a user interface module, which receives natural language queries input by users and displays the generated response text.
9. The question answering system based on the ophthalmic intelligent question answering method of graph search enhanced generation according to claim 7, characterized in that: The knowledge graph construction module includes: The document processing unit is used to parse and segment the input clinical guideline documents. The entity relationship extraction unit uses a pre-trained language model to process text blocks in order to identify and extract ophthalmological entities and semantic relationships between entities; The graph construction unit is used to construct a preliminary graph structure by using extracted entities as nodes and relationships as edges. After deduplication and fusion processing, a structured knowledge graph in the ophthalmology field is generated.
10. The question answering system based on the ophthalmic intelligent question answering method of graph search enhanced generation according to claim 9, characterized in that: The knowledge graph construction module also includes an incremental update mechanism, which dynamically integrates new clinical guidelines or knowledge sources into the ophthalmology knowledge graph without interrupting system services.
11. The question answering system based on the ophthalmic intelligent question answering method of graph search enhanced generation according to claim 7, characterized in that: The graph retrieval module is configured to use key entities identified from the user's natural language query as the starting point for retrieval, and adaptively adjust the depth and breadth of the retrieval based on the semantic complexity of the user's query.
12. The question answering system based on the ophthalmic intelligent question answering method of graph search enhanced generation according to claim 7, characterized in that: The dialogue generation module is configured to selectively provide knowledge tracing information when generating response text. The knowledge tracing information includes entity nodes, relation edges, and their corresponding original clinical guideline clauses in the knowledge graph on which it is based.
13. The question answering system based on graph search enhanced generation of ophthalmology intelligent question answering method according to claim 7, characterized in that: The system also includes a query parsing module, which performs syntactic and semantic analysis on the user's natural language query to identify the user's intent and key entities involved in the query.
14. The question answering system based on the ophthalmic intelligent question answering method of graph search enhanced generation according to claim 7, characterized in that: The system supports integration with electronic medical record systems. In remote ophthalmology consultation scenarios, it extracts ophthalmology-related clinical entities from patients' historical medical data and uses these clinical entities as one of the starting nodes for graph retrieval.
15. A computer readable storage medium having stored thereon a computer program, characterized in that: When the computer program is executed by the processor, it implements the ophthalmic intelligent question-answering method based on graph retrieval enhancement generation as described in any one of claims 1 to 6.
16. An electronic device, comprising: include: One or more processors; A memory storing a computer program, which, when executed by the one or more processors, causes the electronic device to implement the ophthalmic intelligent question-answering method based on graph retrieval enhancement generation as described in any one of claims 1 to 6.