A method, system, medium and application for constructing a large language model based on knowledge graph enhancement
By combining large language models with knowledge graphs, and using verifiable information in the knowledge graph to improve the initial response of the model, the problem of factual hallucinations of large language models in the field of biomedical science is solved, significantly improving the accuracy and practicality of the model.
Patent Information
- Application Number
- CN202411717950.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-28
AI Technical Summary
Large language models have problems with hallucinations in the field of biomedical science, resulting in the generation of misstatements, which are not completely eliminated by prior art such as fine-tuning and cues engineering.
A construction method based on knowledge graph enhancement large language model is proposed. By combining LLM with knowledge graph, leveraging verifiable information in the knowledge graph to improve the initial response of the model, generate the best subgraph related to the problem, and conduct inference and answer generation based on this.
It significantly reduces factual errors in the reasoning process, improves the accuracy and practicality of LLM in the field of biomedical science, can identify potential drug-cancer associations, promotes the discovery of new uses of existing drugs, and assists in predicting drug resistance.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence and biomedicine, and in particular to a technical framework that combines a knowledge graph with a large language model to improve the accuracy and practicality of biomedical question answering. Background Art
[0002] A large language model is a language model built by a deep neural network with more than tens of billions of parameters, and is usually trained using a large amount of unlabeled text using a self-supervised learning method. It can understand and generate natural language text, support a variety of natural language processing tasks, and is based on a "transformer" architecture. It uses a self-attention mechanism to understand the relationship between words in the input text and learns language rules and patterns by predicting the next word or character in a text sequence;
[0003] With the increasing popularity of large language models (LLMs) in the field of artificial intelligence, the emergence of influential models such as ChatGPT and Llama has promoted the widespread development of biomedical and healthcare applications. However, LLMs face the problem of factual hallucination in practical applications, that is, generating false statements due to the limitation of intrinsic knowledge. This problem is particularly prominent in practical scenarios where factual accuracy is required; existing technologies mainly address this problem through fine-tuning and prompt engineering. Fine-tuning technology further trains the model on data in a specific field to reduce hallucinations, but it requires a lot of computing resources and has the problem of catastrophic forgetting. Prompt engineering improves the output of LLM by designing and optimizing prompts. Although fine-tuning is not required, it still cannot completely eliminate factual hallucinations. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention proposes a method for constructing a large language model based on knowledge graph enhancement, and a new system based on "Knowledge Augmented Reasoning (KAR)", which combines LLM with knowledge graph (KG) and improves the initial response of the model by utilizing verifiable information in the knowledge graph, thereby significantly reducing factual errors in the reasoning process. The KAR framework demonstrates strong adaptability and performs well in a variety of open source LLMs. In particular, KAR can promote the discovery of new uses for existing drugs by identifying potential drug-cancer associations, and can assist in predicting drug resistance by analyzing related biomarkers and genetic mechanisms. In order to evaluate the knowledge network question-answering tasks in the biomedical field, a benchmark for Cross-domain Oncology Question Answering (COQA) is provided. The KAR framework significantly improves the accuracy and practicality of LLM in the biomedical field, demonstrating its excellent performance in biomedical question answering.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A method for constructing a large language model based on knowledge graph enhancement includes the following steps:
[0007] Step S1: problem analysis and information extraction;
[0008] Step S2: After parsing the problem and extracting key information, query the knowledge graph to generate the best subgraph related to the problem; in the process of generating the best subgraph, multi-hop reasoning and logical reasoning are used to determine the factor information related to the problem;
[0009] Step S3: Based on the generated optimal subgraph as the basis for enhanced reasoning, the large language model performs reasoning and answer generation on this basis.
[0010] The present invention can process complex language structures and semantic relationships and generate coherent and logical text. By combining LLM with KG, we can further extract AI-related entities (such as machine learning, deep learning, etc.) and relationships (such as AI including machine learning, etc.), present answers in a more structured way, and enhance the accuracy and completeness of answers.
[0011] As a further solution of the present invention, step S1 specifically includes: natural language parsing, using part-of-speech tagging and named entity recognition to pre-process the question text, extract entities and relationships, and convert them into a structured query form; semantic understanding, through pre-trained models and semantic networks, understand the deep meaning and intention of the question, and classify the question to determine which type of biomedical problem it belongs to.
[0012] As a further solution of the present invention, step S2 also includes: subgraph query and retrieval, using the index structure in the knowledge graph to quickly locate relevant entities and relationships, constructing query statements through query language, and extracting relevant information from the knowledge graph; subgraph optimization, based on the specific needs of the problem, optimizing the generated subgraph to ensure that it contains the most relevant information, and the optimization methods include subgraph pruning, path optimization, and relevance calculation.
[0013] As a further solution of the present invention, step S3 specifically includes: subgraph input, taking the generated subgraph as context input, combining it with the initial question, and inputting them into the large language model together, using the structured information in the subgraph to guide the model to generate answers that are consistent with the facts; answer generation and optimization, after the large language model generates a preliminary answer, it corrects and optimizes it by verifying the information in the subgraph, using the attention mechanism and context information to ensure that the generated answer is consistent with the facts in the knowledge graph; result verification, comparing the generated answer with the known facts in the knowledge graph, excluding inconsistent or erroneous parts, and using the Bayesian network uncertainty reasoning technology to evaluate the confidence of the answer.
[0014] The present invention also provides a system for building a large language model based on knowledge graph enhancement, including a parsing and information extraction module, which is used to parse the question using natural language processing technology after receiving the question raised by the user, so as to identify and extract key information therein;
[0015] A knowledge graph subgraph generation module is used to query the knowledge graph based on the received information and generate the best subgraph related to the question;
[0016] The enhanced reasoning module is used to use the generated optimal subgraph as the basis for enhanced reasoning, and the large language model generates accurate answers based on this.
[0017] As a further solution of the present invention, the parsing and information extraction module includes a natural language parsing module and a semantic understanding module. The natural language parsing module is used to pre-process the question text using part-of-speech tagging and named entity recognition, extract entities and relationships, and convert them into a structured query form; the semantic understanding module is used to understand the deep meaning and intention of the question through a pre-trained model and a semantic network, and classify the question to determine which type of biomedical problem it belongs to.
[0018] As a further solution of the present invention, the knowledge graph subgraph generation module includes a subgraph query and retrieval module, a subgraph optimization module, and a multi-hop reasoning module. The subgraph query and retrieval module is used to use the index structure in the knowledge graph to quickly locate related entities and relationships, build query statements through query language, and extract relevant information from the knowledge graph; the subgraph optimization module is used to optimize the generated subgraph to ensure that it contains the most relevant information, and the optimization methods include subgraph pruning, path optimization, and relevance calculation; the multi-hop reasoning module is used to perform multi-hop reasoning on the generated subgraph to reveal complex entity relationships, and use path search algorithms and logical reasoning techniques to explore possible indirect associations.
[0019] As a further solution of the present invention, the enhanced reasoning module includes a subgraph input module, an answer generation and optimization module and a result verification module. The subgraph input module is used to use the generated subgraph as context input, combine it with the initial question, and input it into the large language model together, and use the structured information in the subgraph to guide the model to generate answers that are consistent with the facts; the answer generation and optimization module is used to generate preliminary answers based on the large language model, and then correct and optimize them by verifying the information in the subgraph, using the attention mechanism and context information to ensure that the generated answers are consistent with the facts in the knowledge graph; the result verification module is used to compare the generated answers with the known facts in the knowledge graph, exclude inconsistent or erroneous parts, and use the Bayesian network uncertainty reasoning technology to evaluate the confidence of the answer.
[0020] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a method for constructing a large language model enhanced based on a knowledge graph is implemented.
[0021] The present invention also provides an application of a method for constructing a large language model based on knowledge graph enhancement, which is suitable for a wide range of biomedical applications and for benchmarking cross-domain tumor question and answering.
[0022] The present invention has the following beneficial effects:
[0023] The present invention combines LLM with knowledge graph (KG), and improves the initial response of the model by utilizing verifiable information in the knowledge graph, thereby significantly reducing factual errors in the reasoning process. The KAR framework demonstrates strong adaptability and performs well in a variety of open source LLMs. In particular, KAR can promote the discovery of new uses for existing drugs by identifying potential drug-cancer associations, and can assist in predicting drug resistance by analyzing related biomarkers and genetic mechanisms. And through the benchmark of Cross-domain Oncology Question Answering (COQA), it is implemented to evaluate knowledge network question answering tasks in the biomedical field. The KAR framework significantly improves the accuracy and practicality of LLM in the biomedical field and demonstrates its excellent performance in biomedical question answering. In practical applications, large language models are often limited by incorrect output and hallucination responses. In contrast, knowledge graphs (KGs), as a repository of high-quality structured data, can effectively alleviate the problem of factual hallucinations by providing verifiable information. Traditional KG question answering methods perform poorly in semantic understanding and high-quality text generation. To this end, this paper proposes a new framework that combines LLM with KG and reduces the fact hallucination of LLM by reasoning on the patterns of KG.
[0024] In order to more clearly illustrate the structural features and effects of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A schematic diagram of a process for constructing a large language model based on knowledge graph enhancement according to the present invention. DETAILED DESCRIPTION
[0026] The present invention will be further explained below in conjunction with the accompanying drawings and related knowledge, and described clearly and completely. Obviously, the described application is only a part of the embodiments of the present invention, rather than all the embodiments.
[0027] Existing large language models (LLMs) have shown great potential in multiple fields, especially in biomedical sciences. However, in practical applications, these models are often limited by erroneous outputs and hallucinated responses.
[0028] Reference Figure 1 As shown, the present invention provides a method for constructing a large language model based on knowledge graph enhancement, comprising the following steps:
[0029] Step S1: problem analysis and information extraction;
[0030] Step S2: After parsing the problem and extracting key information, query the knowledge graph to generate the best subgraph related to the problem; in the process of generating the best subgraph, multi-hop reasoning and logical reasoning are used to determine the factor information related to the problem;
[0031] Step S3: Based on the generated optimal subgraph as the basis for enhanced reasoning, the large language model performs reasoning and answer generation on this basis.
[0032] The present invention combines a large language model with a knowledge graph; uses verifiable information in the knowledge graph to improve the initial response of the large language model; and improves the accuracy of answer reasoning by optimizing the generation of subgraphs. The large language models mentioned in the present invention include but are not limited to open source models such as ChatGPT and Llama, and the knowledge graph includes but is not limited to the pan-cancer knowledge graph; the present invention can seamlessly integrate multiple large language models without fine-tuning, and can implement large language model enhancement technology for pan-cancer question answering.
[0033] In the present invention, key information is extracted from the question by optimizing the subgraph generation process; the best subgraph is generated based on the extracted key information; a large language model is used to perform reasoning on the generated best subgraph, and the initial response of the model is improved by utilizing the verifiable information in the knowledge graph, thereby significantly reducing factual errors in the reasoning process.
[0034] The knowledge graph (KG) mentioned in the present invention is a method of storing knowledge in the form of a semantic network, which is widely used in various intelligent systems. In the biomedical field, knowledge graphs can effectively organize and manage complex medical knowledge and support a variety of application scenarios, such as disease diagnosis, drug development and personalized treatment. However, existing knowledge graphs have some limitations, such as untimely knowledge updates and insufficient data coverage. The present invention is based on the pan-cancer knowledge graph (SOKG) developed by SmartQuerier, which is one of the more advanced biomedical knowledge bases. SOKG focuses on cancer-related knowledge, covering a wide range of entities (such as cancer types, drugs, genes, etc.) and relationships (such as drugs-diseases, genes-diseases, etc.), and is updated regularly to keep the knowledge up to date. SOKG is superior to other existing knowledge graphs in terms of the number of entities, the number of relationships, and the types of attributes, providing a solid knowledge foundation for various biomedical applications.
[0035] This paper proposes a model called "Knowledge Augmented Reasoning" (KAR) framework, which aims to combine large language models (LLMs) with knowledge graphs (KGs) and improve the initial response of LLMs by utilizing verifiable information in knowledge graphs, thereby significantly reducing factual errors in reasoning. The framework demonstrates strong adaptability and performs well in various open source LLMs.
[0036] Reference Figure 1 As shown, the present invention provides a method for constructing a large language model based on knowledge graph enhancement, which specifically includes the following steps:
[0037] Step S1: Question analysis and information extraction: After receiving the question from the user, the KAR framework (model) first uses natural language processing technology to analyze the question to identify and extract key information. This key information usually includes but is not limited to entities (such as drug names, disease names, gene names, etc.) and relationships (such as the relationship between drugs and diseases, the relationship between genes and symptoms, etc.);
[0038] Step S2: After parsing the problem and extracting key information, query the knowledge graph to generate the best subgraph related to the problem; specifically, after parsing the problem and extracting key information, the system queries the knowledge graph based on this information to generate the best subgraph related to the problem;
[0039] Step S3: Based on the generated optimal subgraph as the basis for enhanced reasoning, the large language model performs reasoning and answer generation on this basis.
[0040] The present invention specifically includes in step S1: natural language parsing: pre-processing the question text using technologies such as part-of-speech tagging and named entity recognition. Extracting the main entities and relationships and converting them into structured query forms. Semantic understanding: understanding the deep meaning and intention of the question through pre-trained models and semantic networks. Classifying the question to determine what type of biomedical problem it belongs to (such as diagnosis, treatment, prognosis, etc.).
[0041] The present invention specifically includes in step S2: subgraph query and retrieval: using the index structure in the knowledge graph to quickly locate related entities and relationships. Query statements are constructed through query languages such as Cypher to extract relevant information from the knowledge graph. Subgraph optimization: based on the specific needs of the problem, the generated subgraph is optimized to ensure that it contains the most relevant information. Optimization methods include subgraph pruning, path optimization, relevance calculation, etc. Multi-hop reasoning: multi-hop reasoning is performed on the generated subgraph to reveal complex entity relationships. Use path search algorithms and logical reasoning techniques to explore possible indirect associations. Multi-hop reasoning involves multiple consecutive reasoning steps between multiple information sources or knowledge nodes to draw a conclusion. Unlike single-hop reasoning (conclusions are drawn through only one step of reasoning), multi-hop reasoning requires the integration of multiple related information fragments and spans multiple levels or relationships to establish logical connections. The path search algorithm is an algorithm for finding valid paths from one or more starting nodes to one or more target nodes in the knowledge graph. Its main goal is to find one (or more) paths that meet specific conditions (such as the shortest path, the least cost path, etc.), and combine logical reasoning techniques to explore possible indirect associations.
[0042] The present invention specifically includes in step S3: Subgraph input: the generated subgraph is used as context input, combined with the initial question, and input into the LLM together. The structured information in the subgraph is used to guide the model to generate answers that are consistent with the facts. Answer generation and optimization: After LLM generates a preliminary answer, it is corrected and optimized by verifying the information in the subgraph. Use the attention mechanism and context information to ensure that the generated answer is consistent with the facts in the knowledge graph. Result verification: Compare the generated answer with the known facts in the knowledge graph to eliminate inconsistent or erroneous parts. Use uncertainty reasoning techniques such as Bayesian networks to evaluate the confidence of the answer.
[0043] The present invention increases the credibility and explainability of answers, and provides explanations and bases, including referring to entities and relationships in subgraphs, explaining the reasoning process and bases, and improving users' trust in answers; that is, by using the generated optimal subgraph as the basis for enhanced reasoning, more accurate and in-depth reasoning is performed, and high-quality answers are generated.
[0044] The present invention also discloses a construction system for enhancing a large language model based on a knowledge graph, including a parsing and information extraction module, which is used to parse the question using natural language processing technology after receiving the question raised by the user, so as to identify and extract the key information therein; a knowledge graph subgraph generation module, which is used to query the knowledge graph according to the received information and generate the best subgraph related to the question; an enhanced reasoning module, which is used to use the generated best subgraph as the basis for enhanced reasoning, and the large language model generates accurate answers on this basis. The system implements the parsing of the question raised by the user and extracts key information from it, providing accurate input for subsequent querying in the knowledge graph and reasoning of the large language model. The goal is to understand the meaning and intention of the question as accurately as possible, and extract the most relevant information to the question, so as to efficiently use the advantages of the knowledge graph and the large language model to generate high-quality answers.
[0045] Further preferably, the parsing and information extraction module includes a natural language parsing module and a semantic understanding module. The natural language parsing module is used to pre-process the question text using part-of-speech tagging and named entity recognition, extract entities and relationships, and convert them into a structured query form; the semantic understanding module is used to understand the deep meaning and intention of the question through a pre-trained model and a semantic network, and classify the question to determine which type of biomedical question it belongs to. The question raised by the user is analyzed, the core intention of the question is accurately grasped, and the background and field of the question are understood, so as to better perform subsequent information extraction and processing; and the extracted key information is passed to the knowledge graph module for query and reasoning in the knowledge graph, and the results returned by the knowledge graph module can also be received and further processed and analyzed. Through natural language processing technology and semantic analysis, the question intention is accurately understood, key information is extracted, and collaboration with the knowledge graph and large language model is performed to provide users with high-quality answers.
[0046] Further preferably, the generation module of the knowledge graph subgraph includes a subgraph query and retrieval module, a subgraph optimization module, and a multi-hop reasoning module. The subgraph query and retrieval module is used to use the index structure in the knowledge graph to quickly locate relevant entities and relationships, construct query statements through query language, and extract relevant information from the knowledge graph; the subgraph optimization module is used to optimize the generated subgraph to ensure that it contains the most relevant information, and the optimization method includes subgraph pruning, path optimization, and relevance calculation; the multi-hop reasoning module is used to perform multi-hop reasoning on the generated subgraph to reveal complex entity relationships, and use path search algorithms and logical reasoning techniques to explore possible indirect associations. It is realized that the best subgraph related to the question is generated from the knowledge graph based on the key information provided by the parsing and information extraction module. This subgraph will serve as the basis for reasoning and answer generation of a large language model, provide accurate and structured knowledge support, search and match in the knowledge graph, and find entities and relationships related to these key information; after finding the initial related entities and relationships, the module will expand the subgraph. This includes finding other entities and relationships directly or indirectly related to these entities.
[0047] Further preferably, the enhanced reasoning module includes a subgraph input module, an answer generation and optimization module, and a result verification module. The subgraph input module is used to input the generated subgraph as context input, combined with the initial question, into the large language model, and use the structured information in the subgraph to guide the model to generate answers that conform to the facts; the answer generation and optimization module is used to generate preliminary answers based on the large language model, and then correct and optimize them by verifying the information in the subgraph, using the attention mechanism and context information to ensure that the generated answers are consistent with the facts in the knowledge graph; the result verification module is used to compare the generated answers with the known facts in the knowledge graph, exclude inconsistent or erroneous parts, and use the Bayesian network uncertainty reasoning technology to evaluate the confidence of the answer. The structured knowledge provided by the knowledge graph subgraph is used to enhance the reasoning ability of the large language model, thereby generating more accurate and in-depth answers; the structured knowledge in the knowledge graph subgraph is combined with the language understanding and generation capabilities of the large language model to achieve more powerful reasoning capabilities.
[0048] The present invention discloses application scenarios and performance evaluation of large language models enhanced based on knowledge graphs, specifically, the KGT framework can seamlessly integrate multiple LLMs without fine-tuning, and is suitable for a wide range of biomedical applications, including the following main scenarios:
[0049] Clinical decision support: Improve the clinical decision-making level of doctors and medical institutions, provide accurate diagnosis and treatment recommendations, and generate personalized medical plans through comprehensive analysis of patient medical records, laboratory test results and knowledge graph information.
[0050] Drug repositioning: Explore new therapeutic applications for existing drugs by understanding their mechanisms, side effects, and biological processes of related diseases. Predict the potential effects of drugs in the treatment of new diseases and verify them with existing literature and clinical data.
[0051] Early disease detection: Discover key biomarkers for early disease detection and personalized treatment. Use biomarker information in the knowledge graph combined with the reasoning ability of LLM to predict patients’ disease risk.
[0052] Biomedical research: Support researchers in cutting-edge biomedical research, provide comprehensive knowledge support and reasoning capabilities, and accelerate scientific research discovery and innovation through the combination of knowledge graphs and LLM.
[0053] The present invention discloses benchmarking and verification of large language models enhanced by knowledge graphs, including: To evaluate the performance of the KAR framework in the biomedical field, a benchmark called Cross-domain Oncology Question Answering (COQA) was constructed using the pan-cancer knowledge graph (SOKG) developed by SmartQuerier. The test results show that the KAR framework significantly improves the accuracy and practicality of LLM in biomedical question answering, demonstrating its excellent performance in various biomedical tasks;
[0054] The benchmark test mentioned in the present invention further specifically includes: Benchmark test design: The COQA benchmark test includes various types of biomedical questions, covering diagnosis, treatment, prognosis, etc. The test questions are extracted from actual clinical and scientific research scenarios to ensure their representativeness and challenge.
[0055] Performance evaluation indicators: The performance of the KAR framework is evaluated through indicators such as accuracy, recall, and F1 score.
[0056] Compare it with traditional LLM and other enhancement technologies to verify its advantages and improvements.
[0057] Test result analysis: Analyze the test results to reveal the performance differences of the KAR framework on different types of problems. Identify the advantages and disadvantages of the framework and guide subsequent optimization and improvement.
[0058] Through the above detailed description, the present invention demonstrates the unique advantages of the KAR framework in improving the accuracy of LLM reasoning and provides an innovative technical means that can be effectively applied in the biomedical field.
[0059] The significant advantage of the KAR framework of the present invention is that it can be seamlessly integrated into different fields without fine-tuning the LLM, and can automatically generate the optimal knowledge subgraph to support reasoning. By combining structured knowledge graphs and subgraph optimization, the system can significantly improve the accuracy and practicality of answers when dealing with complex biomedical problems, especially in clinical decision support and drug development.
[0060] The reasoning process of the present invention includes the following steps:
[0061] a. Natural language input parsing. Users enter natural language questions, such as “What drugs can be used to treat lung cancer?” LLM parses the question into multiple key pieces of information, including entities (such as “drugs”, “lung cancer”) and relations (such as “treatment”).
[0062] b. Generation and optimization of knowledge graph subgraphs. The subgraph optimization module locates relevant entity types (such as "drugs" and "cancer") and relationships from the knowledge graph schema based on the key information extracted from the user's questions, and uses the graph search algorithm to find all possible shortest paths between them. Then, based on the similarity matching algorithm, it finds the path most similar to the relationship, and further uses LLM to generate query languages such as Cypher to construct query statements, extract relevant information from the knowledge graph, and generate a subgraph containing key entities and relationships to ensure the relevance and coverage of knowledge.
[0063] c. Multi-hop reasoning and association path optimization. Perform multi-hop reasoning on the generated subgraphs to explore complex association paths between entities. For example, for the "drug-disease" problem, the system can use multi-hop reasoning technology to identify possible new uses of drugs and indirect associations between drugs and genes and diseases.
[0064] d. Reasoning result integration and answer generation. The reasoning integration module integrates the preliminary answer of the extended language model with the information obtained from the knowledge network, eliminates inconsistencies, and forms a more accurate final answer. During the integration process, the system uses contextual information to correct the answer.
[0065] e. Output and verification. The final answer is evaluated for confidence to ensure its accuracy and reliability. For example, the system can give a drug recommendation with a confidence score to help users make decisions.
[0066] The following provides an example of a pan-cancer question-answering system based on the KAR framework:
[0067] Example 1 describes a pan-cancer question answering system based on the KAR framework, comprising the following steps:
[0068] Question Input: The user enters a question about cancer treatment.
[0069] Information Extraction: The system extracts key information from the question, such as drug names and disease names.
[0070] Subgraph Generation: Generate the best subgraph from SOKG based on the extracted key information.
[0071] Answer reasoning: Use LLM to reason on the generated subgraph and get the accurate answer.
[0072] Answer output: The system outputs the reasoning results and provides them to the user.
[0073] Example 2 Application of KAR framework in drug repositioning
[0074] Example 2 demonstrates the application of the KAR framework in drug repositioning, comprising the following steps:
[0075] Drug information input: The researcher enters the name of a known drug.
[0076] Knowledge graph query: The system queries SOKG for relevant information about the drug, including its mechanism and known effects.
[0077] Subgraph generation: Generate the best subgraph related to the drug based on the query results.
[0078] Inference Analysis: Use LLM to perform reasoning on the subgraph to predict possible new therapeutic applications of the drug.
[0079] Result verification: The prediction results are compared with existing literature to confirm the accuracy of the prediction.
[0080] The technical principle of the present invention is described above in combination with the specific embodiments, which are only preferred implementations of the present invention. The protection scope of the present invention is not limited to the above embodiments, and all technical solutions under the idea of the present invention belong to the protection scope of the present invention. Those skilled in the art can think of other specific implementations of the present invention without creative work, and these methods will fall within the protection scope of the present invention.
Claims
1. A method for constructing a large language model based on knowledge graph enhancement, characterized in that: The following steps are involved: Step S1: question analysis and information extraction, including natural language analysis, using part-of-speech tagging and named entity recognition to pre-process the question text, extract entities and relationships, and convert them into a structured query form; Semantic understanding, through pre-trained models and semantic networks, understands the deep meaning and intent of the question and classifies the question to determine what type of biomedical problem it belongs to; Step S2: after parsing the problem and extracting key information, query the knowledge graph to generate the best subgraph related to the problem; in the process of generating the best subgraph, multi-hop reasoning and logical reasoning are used to determine the factor information related to the problem, and multi-hop reasoning is performed on the generated subgraph to reveal the entity relationship, and the path search algorithm and logical reasoning technology are used to explore the indirect association of the generated subgraph; it also includes subgraph query and retrieval, using the index structure in the knowledge graph to quickly locate related entities and relationships, constructing query statements through query language, and extracting relevant information from the knowledge graph; subgraph optimization, based on the specific needs of the problem, the generated subgraph is optimized to ensure that it contains the most relevant information, and the optimization methods include subgraph pruning, path optimization, and relevance calculation; Step S3: Based on the generated optimal subgraph as the basis for enhanced reasoning, the large language model performs reasoning and generates answers on this basis, specifically including: subgraph input, taking the generated subgraph as context input, combining it with the initial question, and inputting it into the large language model together, using the structured information in the subgraph to guide the model to generate answers that are consistent with the facts; answer generation and optimization, after the large language model generates a preliminary answer, it verifies and optimizes the information in the subgraph, and uses the attention mechanism and context information to ensure that the generated answer is consistent with the facts in the knowledge graph; result verification, comparing the generated answer with the known facts in the knowledge graph, eliminating inconsistent or erroneous parts, and using the Bayesian network uncertainty reasoning technology to evaluate the confidence of the answer.
2. A system for building a large language model based on knowledge graph enhancement, characterized in that: It includes a parsing and information extraction module, which is used to parse the questions raised by users using natural language processing technology to identify and extract key information; A knowledge graph subgraph generation module is used to query the knowledge graph based on the received information and generate the best subgraph related to the question; The enhanced reasoning module is used to use the generated optimal subgraph as the basis for enhanced reasoning, and the large language model generates accurate answers on this basis. The parsing and information extraction module includes a natural language parsing module and a semantic understanding module. The natural language parsing module is used to pre-process the question text using part-of-speech tagging and named entity recognition, extract entities and relationships, and convert them into a structured query form; the semantic understanding module is used to understand the deep meaning and intention of the question through a pre-trained model and a semantic network, and classify the question to determine what type of biomedical problem it belongs to. The knowledge graph subgraph generation module includes a subgraph query and retrieval module, a subgraph optimization module, and a multi-hop reasoning module. The subgraph query and retrieval module is used to use the index structure in the knowledge graph to quickly locate related entities and relationships, construct query statements through query language, and extract relevant The subgraph optimization module is used to optimize the generated subgraph to ensure that it contains the most relevant information. The optimization methods include subgraph pruning, path optimization, and relevance calculation. The multi-hop reasoning module is used to perform multi-hop reasoning on the generated subgraph to reveal entity relationships. The path search algorithm and logical reasoning technology are used to explore the indirect associations of the generated subgraph. The enhanced reasoning module includes a subgraph input module, an answer generation and optimization module, and a result verification module. The subgraph input module is used to input the generated subgraph as context input, combined with the initial question, into the large language model, and use the structured information in the subgraph to guide the model to generate answers that are consistent with the facts. The answer generation and optimization module is used to generate preliminary answers based on the large language model, and then correct and optimize them by verifying the information in the subgraph. The attention mechanism and context information are used to ensure that the generated answers are consistent with the facts in the knowledge graph. The result verification module is used to compare the generated answers with the known facts in the knowledge graph, eliminate inconsistent or erroneous parts, and use Bayesian network uncertainty reasoning technology to evaluate the confidence of the answers.
3. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for constructing a large language model based on knowledge graph enhancement as described in claim 1 is implemented.
4. An application of the method for constructing a large language model based on knowledge graph enhancement as claimed in claim 1, characterized in that: It is suitable for a wide range of biomedical applications, and is applied to benchmarks for cross-domain oncology question answering.
Citation Information
Patent Citations
Traditional Chinese medicine question-answering system construction method based on large language model and knowledge graph
CN118838996A
Knowledge graph question-answer method and apparatus based on deep learning technology, and device
WO2021139283A1