GraphRAG-based large model question and answer method, system and equipment, medium and product

By building a knowledge graph and using GraphRAG's large language model to extract and retrieve key entities, the shortcomings of existing question-and-answer systems in the processing of complex problems are solved, and more comprehensive answers and higher accuracy and diversity are achieved.

CN119558401APending Publication Date: 2025-03-04SUZHOU INST OF BIOMEDICAL ENG & TECH CHINESE ACADEMY OF SCI
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202411521518.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The existing question-and-answer system cannot cover more relevant knowledge points and information sources when answering complex questions, has low accuracy, high demand for computing resources, and cannot achieve cross-domain integration and reasoning, and the answers are diverse and quality.

Method used

By determining the available data sources and preprocessing the data, a knowledge graph is constructed, and a key entity is extracted from user queries using GraphRAG's large language model, relevant subgraphs in the knowledge graph are retrieved, context information is formed, and sent to GraphRAG's large language model for generative answers.

Benefits of technology

It has achieved the ability to cover more relevant knowledge points and information sources when answering complex questions, improve the accuracy of complex queries, reduce the computing resource requirements for processing large-scale data sets, realize cross-domain integration and reasoning, significantly improve the diversity and quality of answers, and make high-relevance and high-quality answers easier to be discovered and used by users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119558401A_ABST
    Figure CN119558401A_ABST
Patent Text Reader

Abstract

The invention provides a GraphRAG-based large model question and answer method, system and device, a medium and a product, and the method comprises the steps: determining an available data source, and carrying out the preprocessing of data; performing knowledge extraction, knowledge fusion and knowledge calculation on the preprocessed data to construct a knowledge graph; key entities are extracted from user query through a large language model of GraphRAG; retrieving related sub-graphs in the knowledge graph according to the extracted key entities to form context information; and sending the context information into a large language model of the GraphRAG to perform a generative answer. According to the invention, more related knowledge points and information sources can be covered, and more comprehensive answers can be provided; for complex queries needing multi-step reasoning or multi-document information integration, the accuracy is high; when a large-scale data set is processed, the computing power resource demand is relatively low; cross-domain integration and reasoning can be realized; the diversity of answers is improved, and the weighting of the answers is remarkably enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing technology, and in particular to a large-model question-answering method, system, device, medium and product based on GraphRAG. Background Art

[0002] In the era of information explosion, people are increasingly relying on intelligent question-answering systems to quickly obtain accurate information. Intelligent question-answering systems have not only changed the way people obtain information, but also greatly improved the efficiency of information processing. In this system, big models undoubtedly play a core role. With their powerful data processing and deep learning capabilities, big models provide strong support for intelligent question-answering systems, making it possible to quickly build and query knowledge bases. However, existing question-answering systems have obvious defects: When answering complex questions, existing question-answering systems cannot cover more relevant knowledge points and information sources, and cannot provide more comprehensive answers; For complex queries that require multi-step reasoning or multi-document information integration, existing question answering systems have low accuracy; When processing large-scale data sets, existing question-answering systems require high computing resources; When dealing with complex semantic question reasoning across domains and data sets, existing question answering systems are unable to achieve cross-domain integration and reasoning; The answers of existing question-answering systems are relatively simple and cannot provide answers with high relevance and quality, making it difficult for users to find and use highly relevant and high-quality answers. Summary of the invention

[0003] In order to achieve the above-mentioned purpose and other advantages of the present invention, the first purpose of the present invention is to provide a large model question answering method based on GraphRAG, comprising the following steps: Identify available data sources and pre-process the data; Perform knowledge extraction, knowledge fusion, and knowledge calculation on the preprocessed data to build a knowledge graph; Extract key entities from user queries through GraphRAG’s large language model; Retrieving relevant subgraphs in the knowledge graph according to the extracted key entities to form context information; The context information is fed into the GraphRAG large language model for generative answering.

[0004] Furthermore, the step of determining the available data source includes: Determine the available data sources based on the purpose of building the knowledge graph.

[0005] Furthermore, the available data sources include structured databases, semi-structured data, and unstructured text.

[0006] Furthermore, the step of preprocessing the data includes: Clean, transform and format the data to meet the needs of knowledge graph construction.

[0007] Furthermore, the step of extracting knowledge from the preprocessed data includes: Named entity recognition technology and relationship extraction technology are used to extract entity, relationship, and attribute information from text data.

[0008] Furthermore, the step of extracting entities from text data using named entity recognition technology and relationship extraction technology includes: Use natural language processing technology to identify entities with specific meanings from text data; Match the identified entities with the existing knowledge base to achieve entity standardization.

[0009] Furthermore, the steps of extracting relations from text data using named entity recognition technology and relation extraction technology include: Extracting relationships between entities from text data based on predefined rules or templates; Use machine learning models to automatically learn and extract relationships between entities from text data; Use the relationship information in the existing knowledge base to supplement or verify the extracted relationships.

[0010] Furthermore, the steps of performing knowledge fusion on the preprocessed data include: Integrate knowledge from different sources, structures, and formats to form a unified knowledge graph; The steps of knowledge calculation on preprocessed data include: Reasoning, machine learning, and network analysis are performed on the knowledge graph to enrich the semantic information of the graph.

[0011] Furthermore, the step of extracting key entities from user queries by using the GraphRAG large language model includes: Identify the intent of user queries; Extract involved entities and possible relations from user queries.

[0012] Furthermore, the step of retrieving relevant subgraphs in the knowledge graph according to the extracted key entities includes: Map the extracted entities and relationships into Cypher query statements; Optimize Cypher statements based on query complexity and performance requirements; Execute the constructed Cypher statement in the graph database.

[0013] Furthermore, the step of feeding the context information into the GraphRAG large language model for generative answering also includes: The query results are converted into a form that is easy for users to understand and returned to the users.

[0014] The second object of the present invention is to provide a large-model question-answering system based on GraphRAG, which applies the above method and includes a data preprocessing module, a knowledge graph construction module, an entity extraction module, a subgraph retrieval module, and an answer generation module; wherein, The data preprocessing module is used to determine the available data source and preprocess the data; The knowledge graph construction module is used to perform knowledge extraction, knowledge fusion, and knowledge calculation on the preprocessed data to construct a knowledge graph; The entity extraction module is used to extract key entities from user queries through the large language model of GraphRAG; The subgraph retrieval module is used to retrieve relevant subgraphs in the knowledge graph according to the extracted key entities to form context information; The answer generation module is used to send the context information into the large language model of GraphRAG to generate a generative answer.

[0015] A third object of the present invention is to provide a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0016] A fourth object of the present invention is to provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0017] A fifth object of the present invention is to provide a computer program product, comprising a computer program, and implementing the steps of the above method when the computer program is executed by a processor.

[0018] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a large model question-answering method, system, device, medium and product based on GraphRAG, which includes the following steps: determining available data sources and preprocessing the data; performing knowledge extraction, knowledge fusion and knowledge calculation on the preprocessed data to construct a knowledge graph; extracting key entities from user queries through the large language model of GraphRAG; retrieving relevant subgraphs in the knowledge graph according to the extracted key entities to form context information; and sending the context information to the large language model of GraphRAG for generative answers. When answering complex questions, the present invention can cover more relevant knowledge points and information sources and provide more comprehensive answers; for complex queries that require multi-step reasoning or multi-document information integration, the accuracy is significantly improved compared with existing solutions; when processing large-scale data sets, the computing power resource requirements are significantly reduced compared with existing solutions; when processing complex semantic problem reasoning across domains and data sets, cross-domain integration and reasoning can be achieved; compared with existing solutions, the diversity of answers is significantly improved, and each answer is scored and sorted, so that highly relevant and high-quality answers are easier to be discovered and used by users, and the empowerment is significantly enhanced.

[0019] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention in conjunction with the accompanying drawings. The specific implementation of the present invention is given in detail by the following embodiments and their accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 This is a flow chart of the large model question answering method based on GraphRAG in Example 1; Figure 2 This is the entity extraction flow chart of Example 1; Figure 3 This is a relationship extraction flow chart of Example 1; Figure 4 The key entity extraction flow chart of Example 1; Figure 5 A flowchart for searching related subgraphs in the knowledge graph of Example 1; Figure 6 This is a schematic diagram of a large-model question-answering system based on GraphRAG in Example 2; Figure 7 This is a schematic diagram of a computer device in Example 3; Figure 8This is a schematic diagram of a computer-readable storage medium of Example 4. DETAILED DESCRIPTION

[0021] The present invention is further described below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. It should be noted that, under the premise of no conflict, the embodiments or technical features described below can be arbitrarily combined to form a new embodiment.

[0022] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making any creative work shall fall within the scope of protection of the present invention.

[0023] The figure numbers in this application are only used to distinguish the various steps in the scheme, and are not used to limit the execution order of the various steps. The specific execution order is subject to the description in the specification.

[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0025] Example 1 A large-scale question answering method based on GraphRAG, such as Figure 1 As shown, the following steps are included: S1. Data preprocessing: determine the available data sources and preprocess the data; In some embodiments, the step of determining available data sources includes: Determine the data source: According to the purpose of building the knowledge graph, determine the available data sources, that is, the data sources that need to be collected.

[0026] Optionally, the available data sources include structured databases (SQL), semi-structured data (eg, XML, JSON), unstructured text (eg, news, web page content), open link data, industry knowledge bases, etc.

[0027] In some embodiments, the step of preprocessing the data includes: Data preprocessing: Clean, convert, format and process missing values ​​of data to remove noise, unify the format and meet the needs of knowledge graph construction.

[0028] S2, perform knowledge extraction, knowledge fusion, and knowledge calculation on the preprocessed data to construct a knowledge graph; The construction of a knowledge graph is a complex but structured process that aims to extract entities and relationships from diverse data sources and organize this information in the form of a graph structure for effective query and reasoning.

[0029] In some embodiments, the step of extracting knowledge from the preprocessed data includes: Knowledge extraction: Use named entity recognition technology and relationship extraction technology to extract entity, relationship, attribute and other information from text data; The steps of knowledge fusion for preprocessed data include: Knowledge fusion: integrate knowledge from different sources, structures, and formats to form a unified knowledge graph; Knowledge computing: The steps of knowledge computing on preprocessed data include: Reasoning, machine learning, network analysis and other knowledge computations are performed on the knowledge graph to enrich the semantic information of the graph.

[0030] Among them, Figure 2 As shown, the step of extracting entities from text data using named entity recognition technology and relationship extraction technology includes: S21. Named Entity Recognition (NER): Using natural language processing technology, identify entities with specific meanings from text data, such as names of people, places, and institutions; S22. Entity standardization: Match the identified entities with the existing knowledge base to solve the problem of entities having the same name but different meanings or different names but the same meaning, and achieve entity standardization.

[0031] like Figure 3 As shown, the steps of extracting relations from text data using named entity recognition technology and relation extraction technology include: S23. Rule-based methods: extracting relationships between entities from text data according to predefined rules or templates; S24. Machine learning-based methods: Use machine learning models (e.g., neural networks) to automatically learn and extract relationships between entities from text data; S25. Integrate with external knowledge bases: Use the relationship information in existing knowledge bases (e.g., Freebase, DBpedia) to supplement or verify the extracted relationships.

[0032] The prompt statement is: Python Please analyze the following text, first extract all the key entities (such as names of people, places, institutions, etc.), and then identify and extract the main relationships between these entities.

[0033] Text: [enter text] List of extracted entities: 1. Entity 1: [Name] 2. Entity 2: [Name] ... Relationship list: 1. The relationship between entity 1 and entity 2: [relationship type] 2. ... S3, Entity Extraction: Extract key entities from user queries through GraphRAG’s Large Language Model (LLM); Among them, GraphRAG technology is a retrieval enhancement technology based on knowledge graph. GraphRAG can achieve efficient and accurate question-answering functions by integrating knowledge graph (KG) and large language model (LLM). GraphRAG technology constructs the knowledge expression of graph model, displays the connection between entities and relationships in the form of graph, and uses LLM for retrieval enhancement, thereby significantly improving the performance of the question-answering system.

[0034] In some embodiments, Figure 4 As shown, the step of extracting key entities from user queries through the large language model of GraphRAG includes: S31, Intent recognition: Identify the user's query intent, such as query, description, comparison, etc.; S32. Entity and relationship identification: Extract the involved entities and possible relationships from user queries.

[0035] S4. Subgraph retrieval: Retrieve relevant subgraphs in the knowledge graph based on the extracted key entities to form contextual information; the depth of the subgraph (such as 2 degrees or more) and restrictions (such as the number of nodes) can be considered during retrieval.

[0036] In order to support user questions and answers, it is necessary to convert user questions into graph query statements. In some embodiments, Figure 5 As shown, the step of retrieving relevant subgraphs in the knowledge graph according to the extracted key entities includes: S41, Map to Cypher: Map the extracted entities and relationships to Cypher query statements; Cypher is the query language of the Neo4j graph database, which is used to query and operate data in the graph database. After building the knowledge graph, you can use Cypher statements to perform complex graph queries.

[0037] For example, suppose there is a knowledge graph about movies, which contains entities such as movies, directors, actors, and the relationships between them.

[0038] Find movies and their directors: Plain Text MATCH(movie:Movie)-[:DIRECTED_BY]->(director:Person) RETURN movie.title,director.name Find actors who have appeared in all movies directed by a specific director: Plain Text MATCH(director:Person)-[:DIRECTED_BY]->(movie:Movie)<-[:ACTED_IN]-(actor:Person) WHERE director.name='XXX' RETURN DISTINCT actor.name,COLLECT(movie.title)AS movies Prompt is: Python Please generate a Cypher query statement based on the following description, which will be used to retrieve relevant information in the Neo4j graph database.

[0039] Scenario description: You are working on a knowledge graph about movies, which contains movies, directors, actors, and the relationships between them. Now, you need to write a query to find all the movies directed by a specific director, as well as the actors who starred in these movies.

[0040] Director Name: XXX Please make sure your Cypher query contains the following parts: - Matches director nodes whose attribute `name` is "XXX".

[0041] - Starting from the director node, find all the movie nodes connected to it (assuming the relationship type is `DIRECTED`).

[0042] -For each movie, further find the actor nodes connected to the movie node (assuming the relationship type is `ACTED_IN`) and return the title of the movie and the name of the actor.

[0043] The generated Cypher query statement should be in the following format: MATCH... RETURN... S42. Optimize query: optimize Cypher statements according to query complexity and performance requirements; S43. Execute Cypher statements: Execute the constructed Cypher statements in graph databases such as Neo4j.

[0044] S5. Answer generation: The context information is fed into the GraphRAG large language model (LLM) for generative answering. The GraphRAG large language model (LLM) generates a natural language answer based on the context information and the query content.

[0045] In some embodiments, the step of feeding the context information into the GraphRAG large language model (LLM) for generating a generative answer further includes: Result processing: Convert the query results into a form that is easy for users to understand and return them to the users.

[0046] Through the above steps, a fully functional large-model question-answering system based on GraphRAG can be built, which supports extracting entities and relationships from diverse data sources, querying using Cypher statements, and responding to users' question-answering needs.

[0047] When a series of entities and relationships have been obtained through graph queries (such as Cypher queries) and it is desired to use a large model to answer user questions based on this knowledge, this embodiment designs a prompt to guide the model to use this information for reasoning and answering.

[0048] The prompt is: Plain Text You have been given a knowledge graph fragment about [specific field or topic], which contains multiple entities and their relationships. Now, I will ask you a question, and you need to give an answer based on these entities and relationships.

[0049] Overview of knowledge graph snippets: -Entity 1: [Entity 1 name], properties include [property list]... -Entity 2: [Entity 2 name], relationship with entity 1 is [relationship type], attributes include [attribute list]... -... (more entities and relationships) Please note that only some key entities and relationships are listed here to help you understand the context. The actual knowledge graph may contain more details.

[0050] User Question: [Specific question from the user, e.g., “Tell me how entity 1 and entity 2 are related?” or “What are the main characteristics of entity 3?”] To answer this question, follow these steps: 1. Understand the question: First, read the user’s question carefully and understand what information the user wants to know.

[0051] 2. Analyze the knowledge graph: In your mind (or if possible, in your internal representation), browse the knowledge graph fragment, looking for entities and relations that are relevant to the question.

[0052] 3. Reasoning and integration: Based on the entities and relationships found, make necessary reasoning and integration to form a complete answer to the question.

[0053] 4. Generate answers: Translate your reasoning results into clear and concise language as answers to user questions.

[0054] Now, please give your answer based on the above knowledge graph snippet and user question: Answer: [your answer].

[0055] The present embodiment provides a large-model question-answering method based on GraphRAG, which includes the following steps: determining available data sources and preprocessing the data; performing knowledge extraction, knowledge fusion, and knowledge calculation on the preprocessed data to construct a knowledge graph; extracting key entities from user queries through the large language model of GraphRAG; retrieving relevant subgraphs in the knowledge graph based on the extracted key entities to form context information; and sending the context information to the large language model of GraphRAG for generative answers. Compared with the large model that does not use GraphRAG technology, the large model based on GraphRAG in this embodiment has improved the comprehensiveness of question and answer by about 30%, which means that when answering complex questions, the model can cover more relevant knowledge points and information sources and provide more comprehensive answers; for complex queries that require multi-step reasoning or multi-document information integration, the large model based on GraphRAG has improved the accuracy by more than 20%, thanks to the fact that GraphRAG technology can construct a knowledge graph and use graph machine learning to mine deep information and complex relationships; when processing large-scale data sets, GraphRAG-based modular processing and community detection algorithms can reduce the complexity of traditional methods. It reduces the computing power resource requirements by about 15%, which helps to reduce operating costs and improve the sustainability and scalability of the system; the large model powered by GraphRAG performs well in reasoning about complex semantic problems across domains and data sets. On a specific test set, the model successfully answers such questions by more than 40%, demonstrating strong cross-domain integration and reasoning capabilities; by generating community summaries in parallel and aggregating these summaries to generate the final answer, the large model powered by GraphRAG improves the answer diversity by more than 25%. At the same time, the model scores and ranks each answer, making highly relevant and high-quality answers easier for users to discover and use, and the empowerment is significantly enhanced.

[0056] Example 2 A large model question answering system based on GraphRAG, using the above method, for a detailed description of the method, please refer to the corresponding description in the above method embodiment, which will not be repeated here. Figure 6 As shown, the system includes a data preprocessing module 61, a knowledge graph construction module 62, an entity extraction module 63, a subgraph retrieval module 64, and an answer generation module 65; wherein, The data preprocessing module is used to determine the available data source and preprocess the data; The knowledge graph construction module is used to perform knowledge extraction, knowledge fusion, and knowledge calculation on the preprocessed data to construct a knowledge graph; The entity extraction module is used to extract key entities from user queries through the large language model of GraphRAG; The subgraph retrieval module is used to retrieve relevant subgraphs in the knowledge graph according to the extracted key entities to form context information; The answer generation module is used to send the context information into the large language model of GraphRAG to generate a generative answer.

[0057] Based on the technical solution of the above embodiment, optionally, the step of determining the available data source includes: Determine the available data sources based on the purpose of building the knowledge graph.

[0058] Based on the technical solution of the above embodiment, optionally, the available data sources include structured databases, semi-structured data, and unstructured text.

[0059] Based on the technical solution of the above embodiment, optionally, the step of preprocessing the data includes: Clean, transform and format the data to meet the needs of knowledge graph construction.

[0060] Based on the technical solution of the above embodiment, optionally, the step of extracting knowledge from the preprocessed data includes: Named entity recognition technology and relationship extraction technology are used to extract entity, relationship, and attribute information from text data.

[0061] Based on the technical solution of the above embodiment, optionally, the step of extracting entities from text data using named entity recognition technology and relationship extraction technology includes: Use natural language processing technology to identify entities with specific meanings from text data; Match the identified entities with the existing knowledge base to achieve entity standardization.

[0062] Based on the technical solution of the above embodiment, optionally, the step of extracting relations from text data using named entity recognition technology and relationship extraction technology includes: Extracting relationships between entities from text data based on predefined rules or templates; Use machine learning models to automatically learn and extract relationships between entities from text data; Use the relationship information in the existing knowledge base to supplement or verify the extracted relationships.

[0063] Based on the technical solution of the above embodiment, optionally, the step of performing knowledge fusion on the preprocessed data includes: Integrate knowledge from different sources, structures, and formats to form a unified knowledge graph; The steps of knowledge calculation on preprocessed data include: Reasoning, machine learning, and network analysis are performed on the knowledge graph to enrich the semantic information of the graph.

[0064] Based on the technical solution of the above embodiment, optionally, the step of extracting key entities from user queries by using the large language model of GraphRAG includes: Identify the intent of user queries; Extract involved entities and possible relations from user queries.

[0065] Based on the technical solution of the above embodiment, optionally, the step of retrieving relevant subgraphs in the knowledge graph according to the extracted key entities includes: Map the extracted entities and relationships into Cypher query statements; Optimize Cypher statements based on query complexity and performance requirements; Execute the constructed Cypher statement in the graph database.

[0066] Based on the technical solution of the above embodiment, optionally, the step of feeding the context information into the large language model of GraphRAG for generative answering further includes: The query results are converted into a form that is easy for users to understand and returned to the users.

[0067] The present embodiment provides a large-model question-answering system based on GraphRAG, and a large-model question-answering method based on GraphRAG provided in Application Example 1, the system includes a data preprocessing module, a knowledge graph construction module, an entity extraction module, a subgraph retrieval module, and an answer generation module. Compared with the large model that does not use GraphRAG technology, the large model based on GraphRAG in this embodiment has improved the comprehensiveness of question and answer by about 30%, which means that when answering complex questions, the model can cover more relevant knowledge points and information sources and provide more comprehensive answers; for complex queries that require multi-step reasoning or multi-document information integration, the large model based on GraphRAG has improved its accuracy by more than 20%, thanks to the ability of GraphRAG technology to build a knowledge graph and use graph machine learning to mine deep information and complex relationships; when processing large-scale data sets, GraphRAG-based modular processing and community detection algorithms can reduce the complexity of traditional methods. It reduces the computing power resource requirements by about 15%, which helps to reduce operating costs and improve the sustainability and scalability of the system; the large model powered by GraphRAG performs well in reasoning about complex semantic problems across domains and data sets. On a specific test set, the model successfully answers such questions by more than 40%, demonstrating strong cross-domain integration and reasoning capabilities; by generating community summaries in parallel and aggregating these summaries to generate the final answer, the large model powered by GraphRAG improves the answer diversity by more than 25%. At the same time, the model scores and ranks each answer, making highly relevant and high-quality answers easier for users to discover and use, and the empowerment is significantly enhanced.

[0068] Example 3 A computer device 700, such as Figure 7 As shown, it includes a memory 710, a processor 720, and a computer program 730 stored in the memory and executable on the processor. When the processor executes the computer program, the steps of a large model question-answering method based on GraphRAG are implemented. For a detailed description of the method, reference can be made to the corresponding description in the above method embodiment, which will not be repeated here.

[0069] Example 4 A computer readable storage medium such as Figure 8 As shown, a computer program is stored thereon, and when the computer program is executed by the processor, the steps of a large model question-answering method based on GraphRAG are implemented. For a detailed description of the method, reference can be made to the corresponding description in the above method embodiment, which will not be repeated here.

[0070] Example 5 A computer program product, the computer program product comprising a computer program, the computer program when executed by a processor implements the steps of a large model question answering method based on GraphRAG. For a detailed description of the method, reference may be made to the corresponding description in the above method embodiment, which will not be repeated here.

[0071] The number of devices and processing scales described here are used to simplify the description of the present invention. Applications, modifications and variations of the present invention will be obvious to those skilled in the art.

[0072] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and implementation modes. They can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

[0073] The apparatus, computer device, non-volatile computer storage medium and method provided in the embodiments of this specification correspond to each other, and therefore, the apparatus, computer device and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the corresponding apparatus, computer device and non-volatile computer storage medium will not be repeated here.

[0074] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software units for implementing the method and structures within the hardware component.

[0075] The systems, devices or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described separately by functions in various units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or more software and / or hardware.

[0076] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0077] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0078] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0080] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0081] The specification may be described in the general context of computer-executable instructions executed by a computer, such as program units. Generally, program units include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program units may be located in local and remote computer storage media, including storage devices.

[0082] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0083] The above description is only an embodiment of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of one or more embodiments of this specification.

Claims

1. A large model question answering method based on GraphRAG, characterized in that: The following steps are involved: Identify available data sources and pre-process the data; Perform knowledge extraction, knowledge fusion, and knowledge calculation on the preprocessed data to build a knowledge graph; Extract key entities from user queries through GraphRAG’s large language model; Retrieving relevant subgraphs in the knowledge graph according to the extracted key entities to form context information; The context information is fed into the GraphRAG large language model for generative answering.

2. A large model question answering method based on GraphRAG as claimed in claim 1, characterized in that: The step of determining available data sources comprises: Determine the available data sources based on the purpose of building the knowledge graph.

3. A large model question answering method based on GraphRAG as claimed in claim 2, characterized in that: The available data sources include structured databases, semi-structured data, and unstructured text.

4. A large model question answering method based on GraphRAG as claimed in claim 1, characterized in that: The step of preprocessing the data comprises: Clean, transform and format the data to meet the needs of knowledge graph construction.

5. A large model question answering method based on GraphRAG as claimed in claim 1, characterized in that: The step of extracting knowledge from the preprocessed data includes: Named entity recognition technology and relationship extraction technology are used to extract entity, relationship, and attribute information from text data.

6. A large model question answering method based on GraphRAG as claimed in claim 5, characterized in that: The step of extracting entities from text data using named entity recognition technology and relationship extraction technology includes: Use natural language processing technology to identify entities with specific meanings from text data; Match the identified entities with the existing knowledge base to achieve entity standardization.

7. A large model question answering method based on GraphRAG as claimed in claim 5, characterized in that: The steps of extracting relationships from text data using named entity recognition technology and relationship extraction technology include: Extracting relationships between entities from text data based on predefined rules or templates; Use machine learning models to automatically learn and extract relationships between entities from text data; Use the relationship information in the existing knowledge base to supplement or verify the extracted relationships.

8. A large model question answering method based on GraphRAG as claimed in claim 1, characterized in that: The steps of knowledge fusion for preprocessed data include: Integrate knowledge from different sources, structures, and formats to form a unified knowledge graph; The steps of knowledge calculation on preprocessed data include: Reasoning, machine learning, and network analysis are performed on the knowledge graph to enrich the semantic information of the graph.

9. A large model question answering method based on GraphRAG as claimed in claim 1, characterized in that: The step of extracting key entities from user queries using the GraphRAG large language model includes: Identify the intent of user queries; Extract involved entities and possible relations from user queries.

10. A large model question answering method based on GraphRAG as claimed in claim 9, characterized in that: The step of retrieving relevant subgraphs in the knowledge graph according to the extracted key entities comprises: Map the extracted entities and relationships into Cypher query statements; Optimize Cypher statements based on query complexity and performance requirements; Execute the constructed Cypher statement in the graph database.

11. A large model question answering method based on GraphRAG as claimed in claim 10, characterized in that: The step of feeding the context information into the GraphRAG large language model for generative answering also includes: The query results are converted into a form that is easy for users to understand and returned to the users.

12. A large model question answering system based on GraphRAG, using the method according to any one of claims 1 to 11, characterized in that: It includes data preprocessing module, knowledge graph construction module, entity extraction module, subgraph retrieval module and answer generation module; among them, The data preprocessing module is used to determine the available data source and preprocess the data; The knowledge graph construction module is used to perform knowledge extraction, knowledge fusion, and knowledge calculation on the preprocessed data to construct a knowledge graph; The entity extraction module is used to extract key entities from user queries through GraphRAG's large language model; The subgraph retrieval module is used to retrieve relevant subgraphs in the knowledge graph according to the extracted key entities to form context information; The answer generation module is used to send the context information into the large language model of GraphRAG to generate a generative answer.

13. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

15. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

Citation Information

Cited By

  • Index anomaly root cause positioning method and system for complex process

    CN119850057A

  • A Root Cause Location Method and System for Index Abnormality in Complex Processes

    CN119850057B

  • Intelligent question answering method, system and equipment based on GraphRAG and medium

    CN119988572A

  • Branch customer service question and answer method based on GraphRAG and large language model

    CN120448491A

  • Flexible production line reconstruction method fusing GraphRAG and improved Whisper

    CN120952716A