Fine-tuned medical knowledge graph question answering system and device

CN122654162APending Publication Date: 2026-08-28ANHUI NORMAL UNIV WANJIANG COLLEGE
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202610774476.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-01
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

[0006]本发明的目的在于提供一种微调的医疗知识图谱问答系统及设备,以解决上述背景技术提出的目前现有技术中通常采用结构化数据构建知识图谱,或者采用已有的实体、联系来创建知识图谱,缺乏对于给定文档这种非结构化的数据进行知识图谱创建并构建问答系统的问题

Benefits of technology

(1)该微调的医疗知识图谱问答系统通过构建医疗领域的知识图谱,将非结构化的医疗文档转化为结构化的实体、关系和属性,存储于Neo4j图数据库中,在问答过程中,系统首先利用微调后的医疗大语言模型理解用户问题,进而生成Cypher查询语句从知识图谱中检索结构化知识,最终将检索结果与大语言模型的生成结果融合输出,相比纯大语言模型问答系统,有效减少了模型在医疗专业领域的“幻觉”问题,显著提高了答案的准确性、事实性和可追溯性,用户可结合知识图谱中的结构化信息验证答案的合理性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122654162A_ABST
    Figure CN122654162A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of artificial intelligence, in particular to a fine-tuned medical knowledge graph question answering system, comprising an input module, a medical Neo4j graph database module, a query module, a fine-tuned medical LLM module and an output module. The fine-tuned medical knowledge graph question answering system converts unstructured medical documents into structured entities, relationships and attributes by constructing a knowledge graph in the medical field and storing them in a Neo4j graph database. In the question answering process, the system first uses the fine-tuned medical large language model to understand the user's question, then generates a Cypher query statement to retrieve structured knowledge from the knowledge graph, and finally outputs the retrieval results and the generation results of the large language model. Compared with the pure large language model question answering system, the "hallucination" problem of the model in the medical professional field is effectively reduced, the accuracy, factuality and traceability of the answer are significantly improved, and the user can verify the rationality of the answer combined with the structured information in the knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, specifically to a fine-tuned medical knowledge graph question-answering system and device. Background Technology

[0002] Against the backdrop of the rapid development of artificial intelligence and smart healthcare, medical knowledge graph question-answering systems are gradually becoming important tools for assisting clinical decision-making, medical science popularization, and patient services. In knowledge graph question-answering systems, Named Entity Recognition (NER) is a crucial component in natural language processing tasks such as information extraction, question-answering systems, and machine translation. Its purpose is to identify three main categories in the text to be processed: entity, time, and number, as well as seven subcategories: person names, organization names, place names, time, date, currency, and percentage. A knowledge graph (KG) is a model that represents and stores knowledge through a graph structure. It uses nodes and edges to represent relationships between entities and leverages the features of the graph structure for reasoning and querying. It can not only store data but also uncover deeper data relationships through reasoning and computation. Neo4j is a graph data platform used for storing and managing data, supporting systems such as Windows and Ubuntu. Knowledge graph data storage typically uses graph databases, and Neo4j is a common example. Neo4j uses the Cypher declarative graph query language (CQL), which is designed similarly to SQL and has capabilities for creating, updating, and deleting nodes and relationships.

[0003] Existing medical question-and-answer systems are mainly divided into two categories: One type is the Knowledge Graph-based Question Answering System (KGQA). Its typical approach involves extracting entities and relationships from structured data sources (such as medical encyclopedias and electronic medical records), constructing a knowledge graph and storing it in a graph database (such as Neo4j), then using Natural Language Understanding (NLU) technology to map user questions to preset query templates, generating graph query statements such as CQL, and finally directly returning the query results to the user. For example, patent publication number CN112131393A discloses a method for constructing a medical knowledge graph question answering system based on BERT and similarity algorithms. This method includes: using Python web crawlers to crawl publicly available medical encyclopedia information and storing it in the graph database Neo4j to construct a medical knowledge graph; processing the publicly available medical question answer dataset and using the CNN-BiLSTM-CRF algorithm to achieve named entity recognition; extracting relationships using the BERT-TextCNN algorithm; matching pre-defined question query statements; and using the TF-IDF algorithm to establish a similarity model for the medical question answer dataset. Users input medical-related keywords or phrases, triggering an algorithm to retrieve relevant medical entity data and similar medical records as answers, which are then returned to the web application. This invention uses ECharts to render medical entity attribute data and inter-entity relationship data, achieving visualization of medical entity relationships and an automated medical question-and-answer system. However, methods using preset templates struggle to cover the diverse natural language expressions of users, resulting in poor question-and-answer flexibility. If a user's question deviates from the template's scope, the system cannot respond correctly. Furthermore, the answer output format is limited, lacking the ability to fuse structured information using natural language, leading to a poor user experience.

[0004] Another type is the general question-answering system based on Large Language Models (LLM). It uses LLMs pre-trained on massive general corpora (such as ChatGPT, Qwen, DeepSeek, etc.) to generate questions and answers end-to-end. Although this type of method has powerful language understanding capabilities and interactive flexibility, in the highly specialized medical field, due to the limited proportion of medical knowledge in the general corpus and the presence of noise, LLM is prone to "fact illusion", that is, generating seemingly reasonable but actually wrong answers. At the same time, the reasoning process of LLM lacks traceability and it is difficult to verify the facts of the answers, which makes it difficult to guarantee its reliability and security in the highly sensitive medical scenario.

[0005] Therefore, how to deeply integrate the flexible semantic understanding capabilities of large language models with the structured knowledge accuracy of knowledge graphs to build a medical knowledge graph question-answering system that starts from original unstructured medical documents, supports arbitrary natural language question answering, and has high accuracy and interpretability is a technical problem that urgently needs to be solved. Summary of the Invention

[0006] The purpose of this invention is to provide a fine-tuned medical knowledge graph question-answering system and device to solve the problem mentioned in the background art that the existing technology usually uses structured data to construct knowledge graphs, or uses existing entities and relationships to create knowledge graphs, and lacks the ability to create knowledge graphs and build question-answering systems for unstructured data such as given documents.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a fine-tuned medical knowledge graph question-answering system, comprising: The input module is used to receive natural language questions input by the user and extract entity, attribute and relation information from the questions; The Neo4j medical graph database module is used to store medical knowledge graphs constructed from original medical documents. The medical knowledge graphs include at least entity nodes, relation edges, and attribute information. The fine-tuned medical LLM module, obtained by fine-tuning the large language model base with labeled data in the medical field, is used to understand the question information extracted by the input module and generate the corresponding graph database query statement; The query module is used to receive the query statement generated by the fine-tuned medical LLM module, perform the query operation on the medical Neo4j graph database module, and return the structured query results. The output module is used to input the structured query results into the fine-tuned medical LLM module, which then integrates and generates a natural language answer, and outputs it to the user interface.

[0008] Preferably, the medical Neo4j graph database module is constructed in the following manner: Obtain the original medical documents and extract a summary from the documents to filter out redundant information; Perform named entity recognition from the summary to extract medical entities; perform relation extraction to obtain the semantic relationships between entities; Perform attribute completion to improve the entity's attribute information; Perform event extraction to extract relevant information such as time, location, and people involved in the event; The extracted entities are stored as nodes, relationships as edges, and attributes as attributes of nodes or edges in the Neo4j graph database.

[0009] Preferably, the medical entities include drugs, food, examination items, departments, diseases, and symptoms; the entity relationships include the relationship between disease and food, the relationship between disease and common drugs, the relationship between disease and drugs, the relationship between disease and examinations, and the relationship between manufacturers and drugs; the attributes include recommended foods, commonly used drugs, drug manufacturers, and disease examination items.

[0010] Preferably, the fine-tuned medical LLM module is generated as follows: a portion of data from the original medical document is obtained, and labeled medical question-and-answer training data is obtained through manual or automatic annotation; the labeled training data is then used to fine-tune the large language model base.

[0011] Preferably, the query statement is a Cypher query language statement; the query module provides a Cypher query interface for receiving the CQL statement generated by the fine-tuned medical LLM module and calling the medical Neo4j graph database module for retrieval.

[0012] Preferably, the medical Neo4j graph database module supports the Cypher query interface and is used to provide a structured data source for the question-and-answer system.

[0013] Preferably, the original medical document is unstructured text data in Word, PDF, Excel, or CSV format; the named entity recognition, relation extraction, attribute completion, and event extraction are all automatically executed based on a natural language processing model.

[0014] Preferably, the output module is further configured to generate and display prompt information when outputting the natural language answer, the prompt information being used to inform the user that the answer was generated by artificial intelligence, is for reference only, and needs to be verified.

[0015] A computer device includes a processor and a memory, wherein the memory stores computer-executable instructions, which, when executed by the processor, implement all functional modules of the fine-tuned medical knowledge graph question-answering system as described in any one of claims 1-8.

[0016] Compared with the prior art, the beneficial effects of the present invention are: (1) This fine-tuned medical knowledge graph question answering system transforms unstructured medical documents into structured entities, relationships and attributes by constructing a knowledge graph in the medical field and storing them in the Neo4j graph database. During the question answering process, the system first uses the fine-tuned medical big language model to understand the user's question, and then generates Cypher query statements to retrieve structured knowledge from the knowledge graph. Finally, the retrieval results are merged with the generated results of the big language model and output. Compared with the pure big language model question answering system, it effectively reduces the "illusion" problem of the model in the medical professional field and significantly improves the accuracy, factuality and traceability of the answer. Users can verify the rationality of the answer by combining the structured information in the knowledge graph.

[0017] (2) This fine-tuned medical knowledge graph question-answering system adapts the general large language model to the medical scenario through fine-tuning technology, making it more capable of understanding domain terms and reasoning in context. At the same time, combined with the dynamic updating capability of the knowledge graph, the system can support question-answering interaction of various medical entities and their complex relationships, such as drugs, diseases, symptoms, examination items, and departments. Users can input questions in natural language, and the system can output professional and fluent answers. This system not only improves the level of interactive intelligence, but also has good scalability and can be applied to different medical document sources and question-answering needs. Attached Figure Description

[0018] Figure 1 This is a system module structure diagram of a fine-tuned medical knowledge graph question-answering system according to the present invention; Figure 2 A flowchart for creating the medical Neo4j graph database module of a fine-tuned medical knowledge graph question-answering system according to the present invention; Figure 3 This is a flowchart of the query module of a fine-tuned medical knowledge graph question-answering system according to the present invention; Figure 4 A flowchart for creating a fine-tuned medical LLM module for a fine-tuned medical knowledge graph question-answering system according to the present invention; Figure 5 This is a diagram of the medical knowledge graph triplet data structure of a fine-tuned medical knowledge graph question-answering system according to the present invention. Figure 6 This is a schematic diagram of the interface of a fine-tuned medical knowledge graph question-and-answer system according to the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Please see Figure 1-6 The present invention provides a technical solution: a fine-tuned medical knowledge graph question-answering system, including an input module, a medical Neo4j graph database module, a query module, a fine-tuned medical LLM module, and an output module.

[0021] Specifically, the input module is mainly responsible for receiving natural language questions input by users in the interactive interface and performing preliminary processing, including word segmentation, entity recognition, and relation extraction, to extract medical entities (such as disease names, drug names, symptoms, etc.), attributes (such as recommended foods, examination items), and relationships between entities (such as the relationship between "disease and drug") involved in the question. The extraction results are used for subsequent graph database queries and also provided to the fine-tuning medical LLM module as contextual information.

[0022] The Neo4j graph database module for healthcare is the core of the entire system's knowledge storage. Its construction process is as follows: Figure 2 As shown: First, the original medical documents (supporting formats such as Word, PDF, Excel, and CSV) are acquired, and a summary is extracted to filter redundant information. Next, Named Entity Recognition (NER) is performed on the summary text to extract entities such as drugs, food, examination items, departments, diseases, and symptoms. Semantic relationships between entities are obtained through relation extraction technology, such as "relationship between disease and common drugs," "relationship between disease and examination," and "relationship between manufacturer and drug." Then, attribute completion technology (which can be combined with external databases or rule-based reasoning) is used to supplement attribute information for entities, such as adding attributes like "recommended food," "commonly used drugs," and "required examination items" for disease entities. Finally, a knowledge graph is constructed using entities as nodes, relationships as edges, and attributes as additional information for nodes or edges, and stored in the Neo4j graph database. The database provides a Cypher query interface (CQL) for the query module to call.

[0023] The query module process is as follows: Figure 3 As shown: The input module receives structured information (entities, relationships, attributes), converts it into Cypher query statements, sends it to the medical Neo4j graph database module, obtains matching query results (such as a list of recommended drugs for a certain disease, required examinations, etc.), and returns the query results in structured data format for use by the output module.

[0024] The creation process of a fine-tuned medical LLM module is as follows: Figure 4 As shown: A subset of data is selected from original medical documents and labeled by professionals or automated tools to obtain labeled medical question-answering training data. This data is then used to fine-tune a pre-trained large language model foundation (such as ChatGPT, Qwen, DeepSeek, etc.) to obtain a fine-tuned medical LLM. This allows the model to learn medical terminology, reasoning patterns, and answering styles, which are then provided to the question-answering system, resulting in stronger generalization capabilities. The fine-tuned medical LLM can receive user questions and, optionally, combine structured knowledge returned by the query module to generate accurate, fluent, and medical-contextualized natural language answers.

[0025] The output module integrates and deduplicates the graph database search results returned by the comprehensive query module and the answers generated by the fine-tuned medical LLM module, ultimately producing a high-quality response for the user. The output module's user interface is as follows: Figure 6 As shown, it includes a question input box (with the prompt "Please enter your question here"), a question and answer list display area, and displays the message "The answer is AI-generated content, for reference only, and needs to be verified!" below each generated answer to reduce the risks that may be caused by large model illusion.

[0026] In this embodiment, the intelligent question-answering system for medical documents combines large language models and knowledge graphs to realize the entire process from original medical documents to intelligent question answering, which can be divided into three key parts: (1) Medical document processing and model fine-tuning First, raw documents in the medical field are manually or automatically annotated to generate labeled training data. This data is then used to fine-tune existing large language models (such as ChatGPT, Qwen, and DeepSeek) to enhance their question-answering capabilities in the medical field. The fine-tuned medical LLM can then combine specialized corpora to output more accurate answers that better fit medical scenarios.

[0027] (2) Knowledge Graph Construction The process involves extracting summaries from original medical documents, filtering out redundant information, and retaining core knowledge. Named Entity Recognition (NER) is performed on the text to extract key medical-related objects. Relationship extraction is then performed based on logical or semantic relationships between entities. Attribute completion (using rules, external databases, or model reasoning) is used to enrich the information in the knowledge graph. The results are stored in the Neo4j graph database for subsequent structured queries and reasoning.

[0028] (3) Question-and-answer process and result generation After a user submits a question, the system inputs it into a finely tuned medical LLM (Limited Learning Model). While understanding the question, the model can access structured data from the medical knowledge graph to complete facts and validate answers. Ultimately, it outputs a high-quality answer that combines the semantic capabilities of the large-scale medical model with the knowledge from the knowledge graph.

[0029] LLMs (such as ChatGPT, Qwen, and DeepSeek) possess powerful language understanding and generation capabilities, but may have knowledge blind spots or illusions in specific domains (such as healthcare). Through fine-tuning, the model can be better adapted to healthcare scenarios. Knowledge graphs, through entities and relationships, form a structured knowledge network, ensuring the accuracy and traceability of question-and-answer results. LLMs understand natural language questions and further convert them into knowledge graph query statements (CQL), feeding the retrieval results back to the model. Finally, LLMs transform the structured CQL results into fluent natural language output.

[0030] The Neo4j medical graph database module extracts document summaries from original medical documents (formats can be Word, PDF, Excel, or CSV, etc.), then performs named entity recognition, relation extraction, and attribute completion from the summaries. Based on the extracted entities, relations, and attributes, it creates the corresponding node, connection, and edge data information for the Neo4j medical graph database, thus constructing the Neo4j medical graph database. Knowledge graphs can store structured, semi-structured, and unstructured data. The original input document in this invention is unstructured data, requiring the following data processing when stored in the Neo4j graph database: First, entities in the original document are obtained using Named Entity Recognition (NER) technology and stored in the Neo4j graph database. Second, based on the entities extracted by NER, relations between entities are obtained from the original document using relation extraction technology and saved in the graph database. Third, in addition to the existing entities and their relationships, attribute information of the entities needs to be extracted from the original document, and attribute completion technology is used to complete the attribute information of the entities. Finally, to provide effective structured information for the question-answering system, event extraction is required from the original documents, extracting information such as time, location, and task related to the events. Entities extracted from the original documents serve as nodes in the knowledge graph, and extracted relationships serve as edges. Each node and edge can be integrated with the corresponding extracted attributes. The constructed knowledge graph is stored in the Neo4j graph database, and a Cypher query interface is provided to provide a data source for the question-answering system.

[0031] Medical knowledge graph triple data structure, such as Figure 5As shown in the diagram, this is just an example. Gray circles represent entities in the medical knowledge graph, such as "common cold," "amoxicillin," "complete blood count," and "respiratory medicine." White circles represent the attributes of the corresponding entities, such as "drink more water," "penicillin," and "fever, cough." The text between entities indicates the relationships between them. Entities mainly include drugs, food, examinations, departments, diseases, and symptoms, forming the node information of the knowledge graph. Entity relationships mainly include the relationships between diseases and food, diseases and common drugs, diseases and drugs, diseases and examinations, and manufacturers and drugs, forming the relationships between entities. Attributes mainly include recommended foods, commonly used drugs, drug manufacturers, and disease examination items, such as "common cold - recommended drug - amoxicillin," "common cold - required examination - complete blood count," and "common cold - relevant department - respiratory medicine." Through this graph structure, the system can quickly retrieve all drugs, examinations, departments, and precautions related to a specific disease.

[0032] In the finely tuned medical knowledge graph question-and-answer system interface, users input, edit, and send questions through input boxes, with the prompt "Please enter your question here." Users can continuously input questions, and a list of questions and answers is displayed in the center of the interface. Each time a user receives an answer, the system provides an AI-generated prompt: "The answer is AI-generated content, for reference only, and requires verification!" This is to prevent illogical or factual results from the illusions created by the large model, reminding users to carefully discern the truth. The question-and-answer system supports users providing answers regarding disease symptoms, relevant departments, required examinations, and precautions, fully demonstrating an intelligent interactive scenario and providing users with more accurate, professional, and convenient services.

[0033] For example, a user asked, "What medicine should I take for a cold?" 1. Input module receiving problem: extract the entity "cold" and the relationship "recommended medicine".

[0034] 2. The query module converts the extracted information into Cypher statements and sends them to the graph database.

[0035] 3. The fine-tuned medical LLM module simultaneously receives the user's original question and generates an answer based on the returned structured results: "According to the medical knowledge base, commonly used medications for cold patients include amoxicillin and cold medicine granules. Please use them as directed by your doctor. This answer is for reference only."

[0036] 4. The output module displays the answers in the question-and-answer list on the interactive interface, along with AI-generated hints.

[0037] At the hardware level, the present invention can be deployed on one or more servers, including at least one processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the processor executes the program, it implements the functions of the above modules. The medical Neo4j graph database can run on an independent database server and communicate with the backend of the question-and-answer system through an API. The user terminal accesses the interactive interface through a web browser or mobile APP, sends requests and receives responses.

[0038] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A fine-tuned medical knowledge graph question-answering system, characterized in that: include: The input module is used to receive natural language questions input by the user and extract entity, attribute and relation information from the questions; The Neo4j medical graph database module is used to store medical knowledge graphs constructed from original medical documents. The medical knowledge graphs include at least entity nodes, relation edges, and attribute information. The fine-tuned medical LLM module, obtained by fine-tuning the large language model base with labeled data in the medical field, is used to understand the question information extracted by the input module and generate the corresponding graph database query statement; The query module is used to receive the query statement generated by the fine-tuned medical LLM module, perform the query operation on the medical Neo4j graph database module, and return the structured query results. The output module is used to input the structured query results into the fine-tuned medical LLM module, which then integrates and generates a natural language answer, and outputs it to the user interface.

2. The fine-tuned medical knowledge graph question-answering system according to claim 1, characterized in that: The medical Neo4j graph database module is constructed in the following way: Obtain the original medical documents and extract a summary from the documents to filter out redundant information; Perform named entity recognition from the summary to extract medical entities; perform relation extraction to obtain the semantic relationships between entities; Perform attribute completion to improve the entity's attribute information; Perform event extraction to extract relevant information such as time, location, and people involved in the event; The extracted entities are stored as nodes, relationships as edges, and attributes as attributes of nodes or edges in the Neo4j graph database.

3. The fine-tuned medical knowledge graph question-answering system according to claim 2, characterized in that: The medical entities include drugs, food, examination items, departments, diseases, and symptoms; the entity relationships include the relationship between diseases and food, the relationship between diseases and common drugs, the relationship between diseases and drugs, the relationship between diseases and examinations, and the relationship between manufacturers and drugs; the attributes include recommended foods, commonly used drugs, drug manufacturers, and disease examination items.

4. The fine-tuned medical knowledge graph question-answering system according to claim 1, characterized in that: The fine-tuned medical LLM module is generated as follows: a portion of data from the original medical documents is obtained and manually or automatically labeled to obtain labeled medical question-and-answer training data; the labeled training data is then used to fine-tune the large language model base.

5. A fine-tuned medical knowledge graph question-answering system according to claim 4, characterized in that: The query statement is a Cypher query language statement; the query module provides a Cypher query interface for receiving the CQL statement generated by the fine-tuned medical LLM module and calling the medical Neo4j graph database module for retrieval.

6. A fine-tuned medical knowledge graph question-answering system according to claim 5, characterized in that: The medical Neo4j graph database module supports the Cypher query interface and is used to provide a structured data source for the question-and-answer system.

7. A fine-tuned medical knowledge graph question-answering system according to claim 2, characterized in that: The original medical documents are unstructured text data in Word, PDF, Excel, or CSV format; the named entity recognition, relation extraction, attribute completion, and event extraction are all automatically performed based on a natural language processing model.

8. A fine-tuned medical knowledge graph question-answering system according to claim 1, characterized in that: The output module is also used to generate and display prompt information when outputting the natural language answer. The prompt information is used to inform the user that the answer is generated by artificial intelligence, is for reference only, and needs to be verified.

9. A computer device, characterized in that: It includes a processor and a memory, wherein the memory stores a computer-executable program, and when the computer-executable program is executed by the processor, it implements all the functional modules of the fine-tuned medical knowledge graph question-answering system as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Medical knowledge graph question-answering system construction method based on BERT and similarity algorithm

    CN112131393A