A medical question-answering assistance system and method based on the fusion of large models and knowledge graphs

Through a medical Q&A system that integrates large models and knowledge graphs, the existing system's lack of context tracking and multiple rounds of dialogue capabilities is solved, and smooth and natural popular language answers are generated, enhancing the interpretability and accuracy of the system.

CN120123467BActive Publication Date: 2025-08-12HEFEI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510147712.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-11
Publication Date
2025-08-12
Estimated Expiration
2045-02-11

AI Technical Summary

Technical Problem

Existing medical Q&A assistive systems lack context tracking and multi-round dialogue capabilities, making it difficult to generate smooth natural language answers, especially when multi-step reasoning is required.

Method used

By integrating large models and knowledge graphs, crawling technology uses crawler technology to collect domain knowledge, build structured knowledge graphs, combine multiple learning models for query optimization, and generate answers through large language models, providing clear and structured medical knowledge, verifying the medical facts of the answers, and adjusting the answer style to suit patients' understanding.

Benefits of technology

It enhances the interpretability and accuracy of the medical question-and-answer system, generates smooth and natural popular language answers, lowers the threshold for use, and realizes multi-round tracking and multi-step reasoning capabilities of dialogue.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123467B_ABST
    Figure CN120123467B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of medical assistance technology, and specifically discloses a medical question-and-answer assistance system and method based on the fusion of a large model and a knowledge graph. The system includes: a data collection module for storing domain knowledge obtained from different sources using crawler technology in a graph database, providing clear and structured medical knowledge through the knowledge graph, and being able to verify whether the answers generated by the large language model are consistent with medical facts, reduce the generation of incorrect answers, and enhance interpretability. After integrating the large language model, the system can adjust the answer style according to the user's background, tone and needs, thereby generating fluent, natural and popular language suitable for patient understanding to explain complex medical concepts, making up for the large language model's lack of understanding of certain professional details. In addition, the large language model can not only access medical knowledge, but also supplement other field information involved in the user's questions, making the answers more comprehensive, thereby achieving optimization of the medical question-and-answer assistance system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical assistance technology, and specifically to a medical question-answering assistance system and method based on the fusion of a large model and a knowledge graph. Background Art

[0002] The medical question-answering assistance system is an intelligent system that uses artificial intelligence technology, especially natural language processing and machine learning technology, to assist doctors or patients in medical consultation, disease diagnosis, health guidance and other activities.

[0003] Common medical question-and-answer assistance systems integrate knowledge graphs to inject medical professional knowledge into large language models, giving question-and-answer assistants reliable knowledge support and background basis. They then use query statements to input the graph database to query relevant documents stored in the knowledge graph, and put the relevant documents and query questions obtained from the query into a universal large language model to generate answers to questions, thereby realizing assisted communication in medical consultation.

[0004] Common medical question-and-answer assistance systems in the existing technology are knowledge graph-based question-and-answer systems that usually focus on single-round queries. This query method lacks context tracking and multi-round dialogue capabilities, and it is difficult to answer questions by integrating the previous and subsequent contexts in complex dialogues. In addition, it lacks flexible generation capabilities and cannot construct answers with creativity or reasoning ability. It is difficult to generate fluent natural language answers, especially when multi-step reasoning is required. Summary of the Invention

[0005] The purpose of this invention is to provide a medical question-answering assistance system and method based on the fusion of a large model and a knowledge graph to solve the following technical problems:

[0006] How to optimize the query method of medical question-answering assistance system.

[0007] The purpose of the present invention can be achieved through the following technical solutions:

[0008] A medical question-answering assistance system and method based on the fusion of a large model and a knowledge graph, the system comprising:

[0009] The data collection module is used to store domain knowledge collected from different sources using crawler technology into a graph database;

[0010] The data preprocessing module is used to extract knowledge from the unstructured data obtained by the crawler, including entity recognition, relationship extraction, and attribute extraction. It also obtains structured knowledge data triples through data organization, which constitute the basic building blocks of the knowledge graph.

[0011] The data storage module is used to use the py2neo package and automatically store structured data in the knowledge graph Neo4j through Python;

[0012] The query module is used to extract disease entities through the entity recognition model and parse the intent recognition model to obtain the intent recognition dataset, then select the Cypher template and fill in the disease entities to obtain the query Cypher statement;

[0013] The search module is used to input Cypher statements into the graph database Neo4j and query knowledge from the knowledge graph through the graph search algorithm;

[0014] The judgment module is used to determine the cause of the query failure by combining multiple learning models and optimize the query method when knowledge cannot be retrieved from the knowledge graph;

[0015] Algorithm improvement module, used to parse intent by optimizing and fine-tuning the large language model for disease entity parsing;

[0016] The output module is used to query questions based on the knowledge obtained from the knowledge graph, and designs different prompts based on the intent recognition dataset. After assembly, it is put into the general large language model, and finally the general large language model outputs the question and answer results.

[0017] Furthermore, the intent recognition dataset in the query module includes:

[0018] Disease introduction, clinical manifestations, related symptoms, treatment methods, cure rate, infectiousness, disease causes, contraindications, treatment time, department involved, prevention, laboratory / physical examination plan and others.

[0019] Furthermore, the process of optimizing the disease entity parsing large language model in the algorithm improvement module includes:

[0020] S1: Encode the input text using the chinese-roberta-wwm-ext pre-trained model;

[0021] S2: Processing nested and non-nested entity relationships through Efficient-GlobalPointer network;

[0022] S3: Introduce adversarial training strategies to enhance the model’s robustness to noise and adversarial samples, and finally use the training set to train the entity recognition model.

[0023] Furthermore, the process of fine-tuning the large language model in the algorithm improvement module includes:

[0024] The intent recognition dataset constructed using a large language model is fine-tuned using the LoRA technology, ultimately resulting in an intent parsing model.

[0025] Furthermore, the judgment process of the judgment module includes:

[0026] By formula Calculate the influence coefficient p of typos in the text during the i-th query process i ;

[0027] Among them, i is any query process, a is any learning model, b is the total number of learning models, cbz ai is the number of typos judged by the a-th learning model during the i-th query process, x a is the weight coefficient of the a-th learning model, which is set according to empirical fitting. is the error correction coefficient, which is set according to empirical fitting, and round is the rounding function.

[0028] Furthermore, the judgment process of the judgment module further includes:

[0029] By calculating the influence coefficient p of typos in the text during the i-th query process i and the preset influence coefficient threshold p 01 Make a comparison;

[0030] If p i ≥p 01 ,The system determines that there are many typos in the text during the current query, and the reason for the query failure is related to typos;

[0031] If p i <p 01 ,The system determines that there are few typos in the text during the current query process, and the reason for the query failure is not related to typos.

[0032] Furthermore, the optimization query method of the judgment module includes:

[0033] When the reason for the query failure is determined to be related to typos, the hint word project is used to put the parsed disease entity and the query sentence into the general large language model, allowing the general large language model to optimize the parsed disease entity;

[0034] When it is determined that the reason for the query failure is not related to typos, it is determined that there are multiple disease entities. The hint word project is used to put the parsed disease entities and query sentences into the large language model. The large language model selects the disease entity that best meets the user's query requirements, and then assembles the Cypher statement and finally puts it into the knowledge graph for query.

[0035] A medical question-answering assistance method based on the fusion of a large model and a knowledge graph, the method comprising:

[0036] S10: The domain knowledge collected from different sources using crawler technology is stored in the graph database through the data collection module;

[0037] S20: The data preprocessing module is used to extract knowledge from the unstructured data obtained by the crawler, and obtain structured knowledge data triples through data organization, which constitute the basic building blocks of the knowledge graph;

[0038] S30: Use the py2neo package through the data storage module and use Python to automatically store structured data into the knowledge graph Neo4j;

[0039] S40: The query module extracts disease entities through the entity recognition model and parses the intent recognition model to obtain an intent recognition dataset. Then, a Cypher template is selected and the disease entities are filled in to obtain a query Cypher statement.

[0040] S50: Input the data into the graph database Neo4j using Cypher statements through the search module, and query knowledge from the knowledge graph through the graph search algorithm;

[0041] S60: When the judgment module fails to retrieve knowledge from the knowledge graph, it determines the cause of the query failure by combining multiple learning models and optimizes the query method;

[0042] S70: The algorithm improvement module uses methods such as optimizing the disease entity parsing large language model and fine-tuning the large language model to parse the intent;

[0043] S80: The output module queries questions based on the knowledge obtained from the knowledge graph, and designs different prompts based on the intent recognition dataset. After the assembly is completed, it is put into the general language model, and finally the general language model outputs the question and answer results.

[0044] Beneficial effects of the present invention:

[0045] (1) The present invention provides clear and structured medical knowledge through the knowledge graph, which can verify whether the answers generated by the large language model are consistent with medical facts, reduce the generation of incorrect answers, and enhance interpretability. After integrating the large language model, the system can adjust the answer style according to the user's background, tone and needs, thereby generating fluent, natural and popular language suitable for patients to understand to explain complex medical concepts, making up for the lack of understanding of certain professional details by the large language model. In addition, the large language model can not only access medical knowledge, but also supplement other fields of information involved in the user's questions, making the answers more comprehensive, thereby optimizing the medical question-answering auxiliary system.

[0046] (2) The present invention calculates the influence coefficient p of the typos in the text during the i-th query processi and the preset influence coefficient threshold p 01 By comparing, this comparison method can accurately determine the number of typos in the text during the current query process, and then by combining the judgment results, the reason for the failure of the current query can be analyzed, thereby providing accurate data for subsequent optimization of the query method.

[0047] (3) The present invention can provide clear and structured medical knowledge through the support of structured data based on the knowledge graph, and can verify whether the answers generated by the large language model are consistent with medical facts, reduce the generation of wrong answers, and enhance interpretability. In addition, the knowledge graph can quickly integrate new medical discoveries or policy updates to achieve real-time dynamic knowledge updates. After integrating the large language model, it can generate fluent, natural and popular language suitable for patients to understand to explain complex medical concepts based on user preferences. After integrating the large language model, the interaction between users and the system is closer to daily communication methods, which lowers the threshold for use. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The present invention will be further described below with reference to the accompanying drawings.

[0049] Figure 1 This is a schematic block diagram of a medical question-answering assistance system based on the fusion of a large model and a knowledge graph in the present invention;

[0050] Figure 2 It is a flow chart of knowledge graph construction in the present invention;

[0051] Figure 3 It is a knowledge graph type graph in the present invention;

[0052] Figure 4 It is a question-answering flow chart of the present invention;

[0053] Figure 5 is a flow chart of the process of optimizing the large language model for disease entity parsing in the present invention;

[0054] Figure 6 This is a flowchart of a medical question-answering auxiliary method based on the fusion of a large model and a knowledge graph in the present invention;

[0055] Figure 7 It is a schematic diagram of fine-tuning parameters in the present invention;

[0056] Figure 8 This is a comparison chart of the reply content before and after fine-tuning the large model in the present invention. DETAILED DESCRIPTION

[0057] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.

[0058] See also Figures 1 to 4 As shown, in one embodiment, the present application provides a medical question-answering assistance system and method based on the fusion of a large model and a knowledge graph, the system comprising:

[0059] The data collection module is used to store domain knowledge collected from different sources using crawler technology into a graph database;

[0060] The data preprocessing module is used to extract knowledge from the unstructured data obtained by the crawler, including entity recognition, relationship extraction, and attribute extraction. It also obtains structured knowledge data triples through data organization, which constitute the basic building blocks of the knowledge graph.

[0061] The data storage module is used to use the py2neo package and automatically store structured data in the knowledge graph Neo4j through Python;

[0062] The query module is used to extract disease entities through the entity recognition model and parse the intent recognition model to obtain the intent recognition dataset, then select the Cypher template and fill in the disease entities to obtain the query Cypher statement;

[0063] The search module is used to input Cypher statements into the graph database Neo4j and query knowledge from the knowledge graph through the graph search algorithm;

[0064] The judgment module is used to determine the cause of the query failure by combining multiple learning models and optimize the query method when knowledge cannot be retrieved from the knowledge graph;

[0065] Algorithm improvement module, used to parse intent by optimizing and fine-tuning the large language model for disease entity parsing;

[0066] The output module is used to query questions based on the knowledge obtained from the knowledge graph. Different prompts are designed based on the intent recognition dataset. After assembly, they are put into the general language model, which finally outputs the question and answer results.

[0067] Through the above technical solution, this example provides a data collection module for storing domain knowledge obtained from different sources using crawler technology into a graph database. After that, the data preprocessing module extracts knowledge from the unstructured data obtained by the crawler, including entity recognition, relationship extraction and attribute extraction, and obtains structured knowledge data triples through data organization, which constitute the basic building block of the knowledge graph. The triple knowledge data includes knowledge triples such as "entity-relationship-entity" and "entity-attribute-attribute value". Subsequently, the py2neo package is used through the data storage module, and the structured data is automatically stored in the knowledge graph Neo4j through python. On this basis, the query module can be used to extract disease entities and intent recognition model analysis through the entity recognition model at the same time. After obtaining the intent recognition dataset, a Cypher template is selected and then disease entities are filled in to obtain the query Cypher statement. The Cypher statement is then input into the graph database Neo4j through the search module. Knowledge is queried from the knowledge graph through the graph search algorithm. When the judgment module fails to retrieve knowledge from the knowledge graph, the cause of the query failure is determined by combining multiple learning models and the query method is optimized. The algorithm improvement module uses methods such as optimizing the disease entity parsing large language model and fine-tuning the large language model to parse the intent. Finally, the output module can query the question based on the knowledge obtained from the knowledge graph, and different prompts are designed according to the intent recognition dataset. After assembly, they are put into the general large language model, and the general large language model outputs the question and answer results.

[0068] Through the above technical solution, clear and structured medical knowledge is provided through the knowledge graph, which can verify whether the answers generated by the large language model are consistent with medical facts, reduce the generation of incorrect answers, and enhance interpretability. After integrating the large language model, the system can adjust the answer style according to the user's background, tone and needs, thereby generating fluent, natural and popular language suitable for patients to understand to explain complex medical concepts, making up for the lack of understanding of certain professional details by the large language model. In addition, the large language model can not only access medical knowledge, but also supplement other fields of information involved in the user's questions, making the answers more comprehensive, thereby optimizing the medical question-answering assistance system.

[0069] The intent recognition dataset in the query module includes:

[0070] Disease introduction, clinical manifestations, related symptoms, treatment methods, cure rate, infectiousness, disease causes, contraindications, treatment time, department involved, prevention, laboratory / physical examination plan, and others;

[0071] Through the above technical solution, this example provides an intent recognition dataset in the query module. By providing this dataset, accurate data can be provided for assembling Cypher query statements, as shown in the following example:

[0072] Example: Question: "How can I effectively prevent my child from getting whooping cough? I'm worried that my child might get infected with this disease."

[0073] Entity recognition and intent parsing are performed through the semantic parsing module, where the entity is "pertussis" and the intent is "prevention";

[0074] Assemble the Cypher query statement:

[0075] "MATCH(p:disease) WHERE p.name = 'pertussis' RETURN p.prevent";

[0076] Query results:

[0077] 1. Control the source of infection: During epidemic seasons, if there are prodromal symptoms, antibiotic treatment should be started as soon as possible;

[0078] 2. Cut off the transmission route: Since Bordetella pertussis has a weak resistance to the outside world, no disinfection is required. However, the room should be ventilated, clothes should be exposed to the sun, and sputum and oral and nasal secretions should be disinfected.

[0079] Prompt assembly:

[0080] As a medical worker with deep professional knowledge, you have searched the knowledge graph for information on how to prevent the disease "pertussis," including:

[0081] 1. Control the source of infection: During epidemic seasons, if there are prodromal symptoms, antibiotic treatment should be started as soon as possible;

[0082] 2. Cut off the transmission route: Since Bordetella pertussis has a weak resistance to the outside world, no disinfection is required. However, the room should be ventilated, clothes should be exposed to the sun, and sputum and oral and nasal secretions should be disinfected.

[0083] Now, use your professional knowledge and the results of the map search to give a detailed, easy-to-understand answer based on practical medical knowledge to the patient's question: "How can I effectively prevent my child from getting whooping cough? I am very worried that my child will be infected with this disease."

[0084] See also Figure 5 As shown, the process of optimizing the disease entity parsing large language model in the algorithm improvement module includes:

[0085] S1: Encode the input text using the chinese-roberta-wwm-ext pre-trained model;

[0086] S2: Processing nested and non-nested entity relationships through Efficient-GlobalPointer network;

[0087] S3: Introducing adversarial training strategies to enhance the model’s robustness to noise and adversarial examples, and finally using the training set to train an entity recognition model;

[0088] Using the above technical solutions, this example provides a process for optimizing a large language model for disease entity parsing. First, the Chinese-roberta-wwm-ext pre-trained model is used to encode the input text. Then, an Efficient-GlobalPointer network is used to process nested and non-nested entity relationships. Finally, an adversarial training strategy is introduced to enhance the model's robustness to noise and adversarial examples. Finally, an entity recognition model is trained using the training set.

[0089] With this setting, after encoding the input text using the chinese-roberta-wwm-ext pre-trained model, the input text can be converted into a numerical representation that the model can understand, providing a basis for subsequent processing steps. After that, after processing the nested and non-nested entity relationships through the Efficient-GlobalPointer network, nested entities and non-nested entities can be identified indiscriminately. When processing text, it can help us identify the key information in the text. Finally, the adversarial training strategy is introduced to enhance the model's robustness to noise and adversarial samples. By introducing adversarial samples during the training process, that is, samples that can mislead the model to produce incorrect outputs after slight modifications, it can force the model to learn more robust representations, thereby improving its stability and reliability in practical applications.

[0090] The process of fine-tuning the large language model in the algorithm improvement module includes:

[0091] Using a large language model to fine-tune the LoRA technology on the intent recognition dataset, we ultimately obtain an intent parsing model.

[0092] Through the above technical solution, this example provides a process of fine-tuning a large language model. By using the large language model to fine-tune the LoRA technology on the constructed intent recognition dataset, an intent parsing model is finally obtained. By setting it up like this, LoRA layers are added after specific layers of the base model. These layers contain two trainable matrices for simulating minor adjustments to the weights of the original model, and these LoRA layers are trained on the constructed intent recognition dataset instead of the entire model, which greatly reduces the required computing resources and time. The fine-tuning parameters such as Figure 7 As shown, the comparison of the reply content before and after fine-tuning the large language model is as follows: Figure 8 shown.

[0093] The judgment process of the judgment module includes:

[0094] By formula Calculate the influence coefficient p of typos in the text during the i-th query process i ;

[0095] Among them, i is any query process, a is any learning model, b is the total number of learning models, cbz ai is the number of typos judged by the a-th learning model during the i-th query process, x a is the weight coefficient of the a-th learning model, which is set according to empirical fitting. is the error correction coefficient, which is set according to empirical fitting, and round is the rounding function;

[0096] Through the above technical solution, this example provides the influence coefficient p of typos in the text during the i-th query process. i , can be obtained by formula Obviously, when the number of typos judged by the a-th learning model in the i-th query process is higher, the typo influence coefficient p in the text in the i-th query process is i The higher it is, the more typos there are in the text during the current query, which leads to query failure. Conversely, when the number of typos judged by the a-th learning model in the i-th query process is less or no, then the typo influence coefficient p in the text during the i-th query process is i The smaller it is, the fewer typos in the text during the current query, which means that the reason for the failure of the current query is the existence of multiple disease entities.

[0097] The judgment process of the judgment module further includes:

[0098] By calculating the influence coefficient p of typos in the text during the i-th query process i and the preset influence coefficient threshold p 01 Make a comparison;

[0099] If p i ≥p 01 ,The system determines that there are many typos in the text during the current query, and the reason for the query failure is related to typos;

[0100] If p i <p 01 ,The system determines that there are few typos in the text during the current query, and the reason for the query failure is not related to typos;

[0101] Through the above technical solution, this embodiment calculates the influence coefficient p of the typos in the text in the i-th query process. i and the preset influence coefficient threshold p 01 By comparing, this comparison method can accurately determine the number of typos in the text during the current query process, and then by combining the judgment results, the reason for the failure of the current query can be analyzed, thereby providing accurate data for subsequent optimization of the query method.

[0102] The optimization query method of the judgment module includes:

[0103] When the reason for the query failure is determined to be related to typos, the hint word project is used to put the parsed disease entity and the query sentence into the general large language model, allowing the general large language model to optimize the parsed disease entity;

[0104] When the reason for the query failure is determined to be unrelated to typos, it is determined that there are multiple disease entities. The parsed disease entities and the query sentence are fed into the large language model using prompt word engineering. The large language model then selects the disease entity that best meets the user's query requirements, assembles the Cypher statement, and finally feeds it into the knowledge graph for query.

[0105] Through the above technical solution, this implementation provides an optimized query method for the judgment module. Through such a setting, further optimized query methods can be provided according to different reasons for query failure, thereby realizing an optimized query method for the medical question-and-answer assistance system.

[0106] See also Figure 6 As shown, a medical question-answering assistance method based on the fusion of a large model and a knowledge graph includes:

[0107] S10: The domain knowledge collected from different sources using crawler technology is stored in the graph database through the data collection module;

[0108] S20: The data preprocessing module is used to extract knowledge from the unstructured data obtained by the crawler, and obtain structured knowledge data triples through data organization, which constitute the basic building blocks of the knowledge graph;

[0109] S30: Use the py2neo package through the data storage module and use Python to automatically store structured data into the knowledge graph Neo4j;

[0110] S40: The query module extracts disease entities through the entity recognition model and parses the intent recognition model to obtain an intent recognition dataset. Then, a Cypher template is selected and the disease entities are filled in to obtain a query Cypher statement.

[0111] S50: Input the data into the graph database Neo4j using Cypher statements through the search module, and query knowledge from the knowledge graph through the graph search algorithm;

[0112] S60: When the judgment module fails to retrieve knowledge from the knowledge graph, it determines the cause of the query failure by combining multiple learning models and optimizes the query method;

[0113] S70: The algorithm improvement module uses methods such as optimizing the disease entity parsing large language model and fine-tuning the large language model to parse the intent;

[0114] S80: The output module uses the knowledge obtained from the knowledge graph to query questions, and designs different prompts based on the intent recognition dataset. After assembly, it is put into the general language model, and finally the general language model outputs the question and answer results.

[0115] Through the above technical solution, this embodiment provides a medical question-answering assistance method based on the fusion of a large model and a knowledge graph. Through this assistance method, based on the structured data support of the knowledge graph, clear and structured medical knowledge can be provided, and it can verify whether the answers generated by the large language model are consistent with medical facts, reduce the generation of incorrect answers, and enhance interpretability. In addition, the knowledge graph can quickly integrate new medical discoveries or policy updates to achieve real-time dynamic knowledge updates. After integrating the large language model, it can generate fluent, natural and popular language suitable for patients to understand according to the user's preferences to explain complex medical concepts. After integrating the large language model, the interaction between the user and the system is closer to the daily communication method, which lowers the usage threshold.

[0116] The above is a detailed description of an embodiment of the present invention. However, the content described is only a preferred embodiment of the present invention and should not be considered to limit the scope of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.

Claims

1. A medical question-answering assistance system based on the fusion of large models and knowledge graphs, characterized by: The system comprises: The data collection module is used to store domain knowledge collected from different sources using crawler technology into a graph database; The data preprocessing module is used to extract knowledge from the unstructured data obtained by the crawler, including entity recognition, relationship extraction, and attribute extraction. It also obtains structured knowledge data triples through data organization, which constitute the basic building blocks of the knowledge graph. The data storage module is used to use the py2neo package and automatically store structured data in the knowledge graph Neo4j through Python; The query module is used to extract disease entities through the entity recognition model and parse the intent recognition model to obtain the intent recognition dataset, then select the Cypher template and fill in the disease entities to obtain the query Cypher statement; The search module is used to input Cypher statements into the graph database Neo4j and query knowledge from the knowledge graph through the graph search algorithm; The judgment module is used to determine the cause of the query failure by combining multiple learning models and optimize the query method when knowledge cannot be retrieved from the knowledge graph; An algorithm improvement module, which is used to parse intent by optimizing and fine-tuning the large language model for disease entity parsing; The output module is used to query questions based on the knowledge obtained from the knowledge graph. Different prompts are designed based on the intent recognition dataset. After assembly, they are put into the general language model, which finally outputs the question and answer results. The judgment process of the judgment module includes: By formula Calculate the influence coefficient of typos in the text during the i-th query process ; Among them, i is any query process, a is any learning model, b is the total number of learning models, is the number of typos judged by the a-th learning model during the i-th query process, is the weight coefficient of the a-th learning model, which is set according to empirical fitting. is the error correction coefficient, which is set based on empirical fitting. is the rounding function; The judgment process of the judgment module further includes: By calculating the influence coefficient of typos in the text during the i-th query and the preset impact coefficient threshold Make a comparison; like ,The system determines that there are many typos in the text during the current query, and the reason for the query failure is related to typos; like ,The system determines that there are few typos in the text during the current query process, and the reason for the query failure is not related to typos.

2. A medical question-answering auxiliary system based on the fusion of a large model and a knowledge graph according to claim 1, characterized in that: The intent recognition dataset in the query module includes: Disease introduction, clinical manifestations, related symptoms, treatment methods, cure rate, infectiousness, disease causes, contraindications, treatment time, department involved, prevention, laboratory / physical examination plan and others.

3. A medical question-answering auxiliary system based on the fusion of a large model and a knowledge graph according to claim 1, characterized in that: The process of optimizing the large language model for disease entity parsing in the algorithm improvement module includes: S1: Encode the input text using the chinese-roberta-wwm-ext pre-trained model; S2: Processing nested and non-nested entity relationships through Efficient-GlobalPointer network; S3: Introduce adversarial training strategies to enhance the model’s robustness to noise and adversarial samples, and finally use the training set to train the entity recognition model.

4. A medical question-answering assistance system based on the fusion of a large model and a knowledge graph according to claim 1, characterized in that: The process of fine-tuning the large language model in the algorithm improvement module includes: The intent recognition dataset constructed using a large language model is fine-tuned using the LoRA technology, ultimately resulting in an intent parsing model.

5. The medical question-answering auxiliary system based on the fusion of large models and knowledge graphs according to claim 1 is characterized in that: The optimization query method of the judgment module includes: When the reason for the query failure is determined to be related to typos, the hint word project is used to put the parsed disease entity and the query sentence into the general large language model, allowing the general large language model to optimize the parsed disease entity; When it is determined that the reason for the query failure is not related to typos, it is determined that there are multiple disease entities. The hint word project is used to put the parsed disease entities and query sentences into the large language model. The large language model selects the disease entity that best meets the user's query requirements, and then assembles the Cypher statement and finally puts it into the knowledge graph for query.

6. A medical question-answering assistance method based on the fusion of a large model and a knowledge graph, the method adopting a medical question-answering assistance system based on the fusion of a large model and a knowledge graph as described in claims 1-5, characterized in that: The method comprises: S10: The domain knowledge collected from different sources using crawler technology is stored in the graph database through the data collection module; S20: The data preprocessing module is used to extract knowledge from the unstructured data obtained by the crawler, and obtain structured knowledge data triples through data organization, which constitute the basic building blocks of the knowledge graph; S30: Use the py2neo package through the data storage module and use Python to automatically store structured data into the knowledge graph Neo4j; S40: The query module extracts disease entities through the entity recognition model and parses the intent recognition model to obtain an intent recognition dataset. Then, a Cypher template is selected and the disease entities are filled in to obtain a query Cypher statement. S50: Input the data into the graph database Neo4j using Cypher statements through the search module, and query knowledge from the knowledge graph through the graph search algorithm; S60: When the judgment module fails to retrieve knowledge from the knowledge graph, it determines the cause of the query failure by combining multiple learning models and optimizes the query method; S70: The algorithm improvement module uses the optimization and fine-tuning of the large language model for disease entity parsing to parse intent. S80: The output module queries questions based on the knowledge obtained from the knowledge graph, and designs different prompts based on the intent recognition dataset. After the assembly is completed, it is put into the general language model, and finally the general language model outputs the question and answer results.

Citation Information

Patent Citations

  • Large language model question and answer method and device based on cervical vertebra disease knowledge graph

    CN118377875A

  • Data processing method and device, and computer readable storage medium

    WO2021213314A1