A knowledge question and answer method and system based on topic knowledge graph retrieval enhancement
By employing a top-down topic-guided and semantically aware retrieval mechanism, the limitations of existing knowledge graph indexing and retrieval are addressed, enabling a global perspective and semantic richness of the knowledge graph, and improving the accuracy and comprehensiveness of the knowledge question-answering system.
Patent Information
- Application Number
- CN202511971820.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-20
- Estimated Expiration
- 2045-12-25
AI Technical Summary
Existing knowledge graph indexing methods have a limited local perspective, lack global understanding, lose semantic information, and have inaccurate retrieval semantics. They cannot fully capture the deep semantic relationships between questions and graph nodes, thus limiting the system's ability to respond to complex problems.
We adopt a top-down topic-guided knowledge graph construction and semantic-aware retrieval mechanism. Through local topic triple representation, cluster fusion, hybrid knowledge graph construction and semantic-aware personalized PageRank algorithm, we design a three-level progressive retrieval mechanism to ensure global vision and semantic richness, and achieve accurate knowledge positioning.
It significantly improves the semantic integrity and retrieval accuracy of knowledge graphs, ensuring the accuracy, comprehensiveness, and empowerment of generated answers, outperforming traditional methods in complex knowledge-intensive tasks.
Smart Images

Figure CN121388124B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of natural language processing and information retrieval, and relates to a knowledge question answering method and system based on topic knowledge graph retrieval enhancement. BACKGROUND
[0002] In recent years, large language models (LLMs) have achieved remarkable success in a wide range of real-world tasks, including question answering. However, hallucinations become a key challenge, which is often caused by containing outdated information or lacking domain-specific knowledge. Retrieval-augmented generation (RAG) methods bring new possibilities for the development of large language models, by combining external knowledge sources, RAG methods overcome the limitations of model parameterized knowledge, by retrieving relevant knowledge from documents and incorporating it into LLMs' prompts to generate responses, thereby alleviating hallucinations. However, in existing research, keyword-based or semantic-based methods are usually used to retrieve documents with the highest similarity to user queries, and these retrieved blocks may be homogeneous and redundant, resulting in the inability to further activate the reasoning ability of LLMs.
[0003] As a structured representation of entities and relationships, knowledge graphs are expected to complement semantic-based RAG methods.
[0004] Knowledge graph indexing and knowledge graph retrieval are two key processes of RAG based on knowledge graphs, and many studies have been conducted on these two processes, but there are still some limitations. First, for knowledge graph indexing, existing research adopts a bottom-up indexing strategy, that is, entities and relationships are extracted from raw documents, and then entity nodes are aggregated into communities. Although this method can capture information in a local context, the localized view makes the entity extraction process too one-sided, lacking a comprehensive understanding of the overall content of the document, resulting in the omission of implicit relationships and detailed information during extraction. Second, after the construction of the knowledge graph, community detection algorithms are usually used to aggregate dispersed but semantically related nodes into communities, and LLM-based methods are used to generate community summaries. During retrieval, both node and community summaries are used to enhance the context. Although community summaries provide a global perspective, they lose the coherent semantics and fine-grained information of the original text. The triples in the knowledge graph only retain structured facts, and the implicit knowledge in the text passages (such as argumentation processes, context descriptions) cannot be effectively encoded, especially when dealing with text-intensive tasks, these defects are particularly evident.
[0005] In the retrieval strategy of the knowledge graph, most of the existing researches adopt the method of directly matching the query and the knowledge graph entity node similarity, ignoring the association between the graph nodes. Some optimization and improvement algorithms have been proposed, among which the Personalized PageRank (PPR) algorithm was first introduced in the RAG system. The algorithm calculates the importance weight of the nodes in the graph relative to a specific query node through random walk with restart, so as to query the information related to the problem in the graph. However, the algorithm mainly depends on the graph structure itself and lacks explicit modeling of the user query semantics, which cannot fully capture the deep semantic association between the problem and the graph node, thereby limiting the response capability of the system to complex problems. SUMMARY
[0006] In order to overcome the shortcomings of the existing researches, the present application provides a knowledge question answering method and system based on topic knowledge graph retrieval enhancement, which aims to solve the problems of local visual limitation, semantic information loss and retrieval semantic misalignment existing in the current graph enhanced RAG system through a top-down topic guided index construction and semantic perception retrieval mechanism, thereby comprehensively improving the performance of the RAG system in complex knowledge intensive tasks and effectively improving the accuracy and comprehensiveness of the retrieval enhancement generation system in knowledge intensive tasks.
[0007] The innovation of the present application lies in the RAG framework which integrates topic guided knowledge graph construction and semantic perception retrieval. The framework ensures the global vision and semantic richness of the knowledge graph construction through a top-down knowledge graph index construction strategy; the query semantic depth is integrated into the retrieval process through the improved semantic perception personalized PageRank (SP-PPR) algorithm to realize accurate knowledge positioning; through the three-level progressive retrieval mechanism of entity-community summary-original text, the structured knowledge advantage is retained while the fine-grained information of the original context is completely obtained.
[0008] In one aspect of the present application, the specific steps of the knowledge question answering method based on topic knowledge graph retrieval enhancement are as follows:
[0009] Step one: block processing is performed on the original document, and a large language model is used to extract local topics from each text block, wherein the local topics are represented in the form of triplets containing topics, semantic anchors and topic summaries;
[0010] Step two: cluster all the local topic triplets extracted from the text blocks, and fuse the triplets in each cluster to generate a global topic triplet set representing the global perspective of the whole document;
[0011] Step 3: Based on the global topic triple set, a topic-guided entity and relation extraction method is used to extract entities and relations from each text block, and construct a hybrid knowledge graph containing entity nodes, community nodes and original text paragraph nodes.
[0012] Step 4: Propose a semantically aware personalized PageRank algorithm (SP-PPR). The traditional PageRank algorithm is a link analysis algorithm used to measure the importance of nodes. By incorporating the semantic information of nodes into the process of measuring node importance, the SP-PPR algorithm is obtained. That is, during the retrieval process, the semantics of the query are matched with the semantics of the edges in the hybrid knowledge graph, and the weights of score propagation between nodes are dynamically adjusted.
[0013] Step 5: Design a three-level progressive retrieval mechanism, using the semantically aware personalized PageRank algorithm from Step 4 to retrieve multi-level information related to the user query from the hybrid knowledge graph;
[0014] Step Six: Input the multi-level information retrieved in Step Five into the large language model to generate the final answer.
[0015] In step three, entities and relationships are extracted from the original document, and each entity is associated with an original text paragraph node, thereby constructing a complete hybrid knowledge graph containing entity nodes, community nodes, and original text paragraph nodes. The construction of the hybrid knowledge graph consists of the following steps:
[0016] 3.1 Document Chunking: Given a document Divided into a series of blocks Each block The length satisfies the input constraints of LLM, and each block... All will be passed to the LLM The prompt words are used to extract various elements from the graph index. The specific content of these prompt words includes the global topic triplet set obtained in step two, aiming to extract elements based on topic guidance. Entity extraction is performed using prompts.
[0017] 3.2 Entity Extraction: After document segmentation, entity extraction is performed based on a large language model and using multiple prompt words. , and Collaborative work was conducted to extract entities and relationships under a theme-guided framework. Three carefully designed prompts guided the large language model to complete the assigned task. This included... Entity and relation extraction is performed. The prompt consists of three parts, among which... Represents topic triple information. It provides guidance to the large model in extracting entities and relationships from the chunks. A few examples for context learning. By All relevant entity sets and relation sets under the current topic can be identified 、 Each entity is defined as , where represents the name of the entity, represents the type of the entity, represents the detailed description information of the entity, and each relation is defined as , where represents the name of the source entity in the relation, represents the name of the target entity in the relation, represents the detailed description information of the relation. The above process is repeated for each topic information under each block for multiple rounds of entity relation extraction, and the entities and relations obtained in each round are merged to obtain an initial knowledge graph representation .
[0018] Under the condition of considering efficiency and quality, a multi-round collection strategy is applied. For each initial extraction set of each block, based on a large language model and through a prompt word to evaluate whether all entities have been extracted. If the LLM response does not extract all entities, use prompt word to continue extracting related entities, and repeat the above process until all entities are extracted.
[0019] 3.3 Entity deduplication: adopt deduplication and merging strategy to process repeated entities and relations among different segments, specifically, , based on pre-trained language model to obtain entity and relation embedding representation and . For each pair of entities in the set, calculate the similarity , if the similarity exceeds a certain preset threshold , it is considered that there may be redundancy in this group of entities, through a large prediction model and based on prompt word to merge entities and into and generate new entity description information, and the relation also performs the same operation, is the prompt word for entity merging. The relation also performs the same operation, replacing the original information with the merged entity or relation, and updating the set and ;
[0020] 3.4 Community and Paragraph Node Construction: In the initial knowledge graph, the set of nodes extracted under each topic is considered a community. Each community contains multiple entities from the knowledge graph, and an entity may appear in multiple communities. For each community... It uses a large language model to generate interpretable semantic reports. Each entity node Not only associated with the corresponding community It also associates with the corresponding text paragraphs. Text paragraph It provides coherent semantics and fine-grained information, compensating for the information loss caused by relying solely on the community, and is used in subsequent retrieval processes. Finally, a hybrid knowledge graph is obtained.
[0021] In step four, based on the personalized PageRank algorithm, the weights of the two nodes are redefined: First, the triples representing the relationship between the two nodes are transformed into numerical vectors using an embedding model; second, the user-input query is also transformed into a numerical vector using an embedding model. Finally, the similarity between the numerical vectors transformed from the triples and the query is calculated, and this similarity is used as the weight of the two nodes. Weights of score propagation ; and use weights The original personalized PageRank algorithm score is weighted and combined with the user's personalized vector for the node to calculate the score of the next node.
[0022] In step five, the three-level progressive retrieval mechanism specifically includes:
[0023] 5.1 Obtaining Local Information: First, using the semantic-aware personalized SP-PPR algorithm from step four, the scores of all entity nodes in the knowledge graph are calculated, and the Top-N entity nodes with the highest scores are selected as local precise knowledge.
[0024] 5.2 Obtaining Global Information: Based on the core entity set, further identify the community sets to which these entities belong. First, find the community sets associated with the retrieved entities. As described below. Subsequently, community reports from these communities were retrieved, representing coarse-grained knowledge relevant to user queries. This process extracts coarse-grained, relational knowledge at the community level related to user queries to understand the broader context.
[0025] 5.3 Obtaining Original Information: To provide the most basic detailed support for the above information, based on the entity nodes retrieved in step 5.1, the associated original text paragraph nodes are located and retrieved. The complete context and fine-grained information obtained in this step are used to support and verify the credibility and specific meaning of the entity and its community summary.
[0026] Another aspect of the present application also provides a knowledge question and answer system based on topic knowledge graph retrieval enhancement, comprising the following modules:
[0027] A local topic representation module is used for block processing of the original document, and a large language model is used to extract a local topic in the form of a triple representing a topic, a semantic anchor and a topic summary from each text block.
[0028] A triple set module is used for clustering of the local topic triples and fusion of the triples in each cluster to generate a global topic triple set representing the global perspective of the entire document.
[0029] A hybrid knowledge graph construction module is used to construct a hybrid knowledge graph containing entity nodes, community nodes and original text paragraph nodes based on the global topic triple set and using topic-guided entity and relationship extraction.
[0030] An information retrieval module proposes a semantic-aware personalized PageRank algorithm SP-PPR, which matches the query semantics with the semantics of the edges in the hybrid knowledge graph during the retrieval process, dynamically adjusts the weight of the score propagation between nodes, and designs a three-level progressive retrieval mechanism to retrieve multi-level information related to the user query from the hybrid knowledge graph.
[0031] A question and answer output module is used to input the multi-level information into a large language model to generate a final answer.
[0032] Compared with the prior art, the present application has the following advantages:
[0033] The present application proposes a knowledge question and answer method based on topic knowledge graph retrieval enhancement, which systematically solves the key bottlenecks in the index construction and retrieval process of the existing graph-enhanced RAG through a top-down topic-guided knowledge construction, a semantic-aware graph retrieval algorithm and a multi-level progressive retrieval mechanism. The framework significantly improves the semantic integrity and retrieval accuracy of the knowledge graph, ensuring the accuracy, comprehensiveness and empowerment of the generated answers.
[0034] Experimental results show that the method can effectively improve the performance of the RAG system in complex knowledge question and answer tasks: in the comprehensive evaluation on multiple benchmark datasets, the framework proposed in the present application is superior to traditional Naive RAG, Raptor, GraphRAG and LightRAG and other advanced baseline methods in terms of the comprehensiveness, diversity, empowerment and overall performance of the generated answers. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0036] Figure 1 The flowchart of the knowledge question and answer method based on the subject knowledge graph retrieval enhancement of the present application;
[0037] Figure 2 The schematic diagram of the subject extraction method of the present application;
[0038] Figure 3 The schematic diagram of the three-level progressive retrieval mechanism of the present application. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0040] As shown in Figure 1 , in one aspect of the present application, the specific steps of the knowledge question and answer method based on the subject knowledge graph retrieval enhancement are as follows:
[0041] Step 1: Perform block processing on the original document, and use a large language model to extract local topics from each text block, wherein the local topics are represented in the form of a triple containing a topic, a semantic anchor and a topic summary;
[0042] Step 2: Cluster the local topic triples extracted from all text blocks, and fuse the triples within each cluster to generate a global topic triple set representing the global perspective of the entire document, as shown in Figure 2 ;
[0043] Step 3: Based on the global topic triple set, use a topic-guided entity and relationship extraction method to extract entities and relationships from each text block, and construct a hybrid knowledge graph containing entity nodes, community nodes and original text paragraph nodes, which provides accurate structured knowledge, coarse-grained associated context and fine-grained original text support for the RAG system, and fundamentally enhances the accuracy and credibility of the answers;
[0044] Step four: propose a semantic-aware personalized PageRank algorithm (SP-PPR). The traditional PageRank algorithm is a link analysis algorithm for measuring the importance of nodes. By introducing semantic information of nodes into the process of measuring the importance of nodes, the SP-PPR algorithm is obtained. In the retrieval process, the semantic of the query is matched with the semantic of the edge in the hybrid knowledge graph, and the weight of the score propagation between nodes is dynamically adjusted. Through this method, the retrieval system is freed from the dependence on pre-defined and fixed paths, and truly semantic-driven retrieval is realized, which intelligently and adaptively focuses on the most relevant semantic area in the vast knowledge graph.
[0045] Step five: design a three-level progressive retrieval mechanism. The semantic-aware personalized PageRank algorithm in step four is used to retrieve multi-level information related to user queries from the hybrid knowledge graph. The advantages of this method are that it gradually integrates precision, context, and verifiability through a structured retrieval process, avoiding the one-sidedness of single-granularity retrieval, and effectively enhancing the factuality and credibility of the answers generated by large language models through the final native text anchoring. The three-level progressive retrieval mechanism is shown in Figure 3 .
[0046] Step six: input the multi-level information retrieved in step five into the large language model to generate the final answer.
[0047] In step one, the extraction of local topic triples is as follows: the original document is divided into blocks according to a fixed length to obtain , which meets the input limit of the large language model. For each text segment , the strong semantic analysis capability of the large language model is used to construct a triple structure , to represent the core content of the text block, to define the semantic range of the topic, is the topic summary, which retains the background information and detail information of the topic.
[0048] In step two, the fusion of triple topics in the cluster includes: using an embedding model to vectorize each local topic triple; using the K-means algorithm to cluster the vectorized triples; for each cluster, constructing a prompt and using the large language model to fuse multiple triples in the cluster into a new, more general global topic triple. This process can be represented as:
[0049]
[0050] where is an embedding model that can embed triple information, is the embedding representation of the triple, These are clusters with similar themes. For clusters A function that processes the format of triples within a language model to adapt them to the input. It is a large language model used for final fusion.
[0051] In step three, entities and relationships are extracted from the original document, and each entity is associated with an original text paragraph node, thereby constructing a complete hybrid knowledge graph containing entity nodes, community nodes, and original text paragraph nodes. The construction of the hybrid knowledge graph consists of the following steps:
[0052] 3.1 Document Chunking: Given a document Divide it into a series of blocks Each block The length satisfies the input constraints of LLM, and each block... All will be passed to the LLM The prompt words are used to extract various elements from the graph index. The specific content of these prompt words includes the global topic triplet set obtained in step two, aiming to extract elements based on topic guidance. Entity extraction is performed using prompts;
[0053] 3.2 Entity Extraction: After document segmentation, entity extraction is performed based on a large language model and using multiple prompt words. , and Collaborative work was conducted to extract entities and relationships under a theme-guided framework. Three carefully designed prompts guided the large language model to complete the assigned task. This included... Entity and relation extraction is performed. The prompt consists of three parts, among which... Represents topic triple information. It provides guidance to the large model in extracting entities and relationships from the chunks. A few examples for context learning. (Through) It can identify all relevant entity sets and relation sets of the chunk under the current topic. , Each entity Defined as ,in Indicates the name of the entity. Indicates the type of entity. This represents detailed descriptions of the entity and each relationship. Defined as ,in Indicates the name of the source entity in the relation. Indicates the name of the target entity in the relation. Detailed description information of the relationship. For each chunk, the detailed description information of each subject information The above process is repeated for multiple rounds of entity relationship extraction, and the entities and relationships obtained in each round are merged to obtain an initial knowledge graph representation , which can be represented as:
[0054]
[0055]
[0056] Under the condition of considering efficiency and quality, the multi-round collection strategy is applied to the initial extraction set of each block Based on the large language model and through the prompt word to evaluate whether all entities are extracted, if the LLM response does not extract all entities, the prompt word is used to continue extracting related entities, and the above process is repeated until all entities are extracted.
[0057] 3.3 Entity deduplication: adopt deduplication and merging strategy to process repeated entities and relationships between different segments, specifically, Based on the pre-trained language model, the entity and relationship embedding representation is obtained and . For each pair of entities in the set , the similarity is calculated If the similarity exceeds a certain preset threshold , it is considered that this group of entities may be redundant, and the entity is merged into and new entity description information is generated through the large prediction model based on prompt word, and the relationship is also operated in the same way, is the prompt word used for entity merging. Replace the original information with the merged entity or relationship, and update the set and ;
[0058] 3.4 Community and paragraph node construction: in the initial knowledge graph, the node set extracted under each topic is taken as a community, and each community contains multiple entities from the knowledge graph, while an entity may also appear in multiple communities. For each community , use the large language model to generate an interpretable semantic report. Each entity node is not only associated with the corresponding community , but also associated with the corresponding text paragraph The original text provides coherent semantics and fine-grained information, making up for the information loss caused by relying solely on the community, and is used in subsequent retrieval processes. Finally, a hybrid knowledge graph is obtained.
[0059] In step four, a semantic-aware personalized PageRank algorithm (SP-PPR) is proposed. Specifically, the score iteration propagation process of the traditional personalized PageRank algorithm is optimized. The score weight transmitted by a node to its neighbor node is no longer equal, but depends on the semantic matching degree of the relationship triple (head entity, relationship, tail entity) connecting the node and its neighbor node with the user query. On the basis of the personalized PageRank algorithm, the weights of the two nodes are redefined as:
[0060]
[0061] where is an embedding model used to convert text into a numerical vector, represents the query problem input by the user, represents the two nodes to be calculated in the knowledge graph, the relationship triple between the two nodes, represents a similarity function, which is usually the cosine similarity between two embedding vectors. The score of each node is iteratively calculated using the following method:
[0062]
[0063] where, is the adjacent node, represents the score of node , represents the set of nodes pointing to , represents the number of outlinks of node , represents the personalized vector, which represents the user's preference probability for the node. This vector is usually sparse, with only some nodes being non-zero, is the damping factor representing the probability of the user continuing to click on the link.
[0064] This method is defined as SP-PPR, which is a query topic-aware PPR algorithm. Three steps of SP-PPR calculation are defined: (1) selection of personalized vector: according to the user Query, the personalized vector is obtained, which is usually directly related to the entity in the Query. (2) initialization: assign initial PageRank values to all nodes, initialize to accelerate convergence. (3) iterative update: iteratively calculate according to the following formula until convergence.
[0065]
[0066]
[0067] In step four, the initialization of the personalized vector specifically includes: using the LLM for the user input query question and obtaining the answer based on the thought chain , extracting entities using the LLM for each step and the original query question to obtain a candidate entity set, and mapping the entities back to the nodes of the hybrid knowledge graph. For each node, the first-order neighbor is obtained as the context, which is input into the LLM for semantic scoring to determine the contribution score of each entity to the original question, and finally the entity with the highest score is selected as the preference node, and the corresponding personalized probability is the inverse of , and the personalized probability of the remaining entities is 0, and the combination of the personalized probabilities of all entities obtains the initialized personalized vector .
[0068] In step five, the three-level progressive retrieval mechanism specifically includes:
[0069] 5.1 Obtain local information: first, use the semantic perception personalized SP-PPR algorithm in step four to calculate the scores of all entity nodes in the knowledge graph, and select the top-N entity nodes with the highest scores as local precise knowledge. This step aims to locate the core entities most directly related to the query from the graph as anchor points for subsequent retrieval.
[0070]
[0071] 5.2 Obtain global information: based on the obtained core entity set, further find the community set to which these entities belong. First, find the community set associated with the retrieved entities , as follows. Then retrieve the community reports of these communities, which represent the coarse-grained knowledge related to the user query. From the community level, obtain coarse-grained and related knowledge related to the user query to understand a broader context.
[0072]
[0073] 5.3 Obtain original information: to provide the bottom layer of details for the above information, according to the entity nodes retrieved in step 5.1, locate and retrieve the original text paragraph nodes associated with them. This step obtains complete context and fine-grained information to support and verify the credibility and specific meaning of entity and community summaries.
[0074] In step 5.3, the retrieval of the original text paragraph node adopts one of the following two ways:
[0075] Method one: the original text paragraph node is regarded as a virtual node and does not participate in the iteration process of the semantic-aware personalized PageRank algorithm, and after the algorithm converges, the score of the paragraph node is calculated by summing and multiplying the scores of all entity nodes connected thereto and the similarity between the query question input by the user and the original text paragraph node;
[0076] Method two: the original text paragraph node is regarded as a formal node in the hybrid knowledge graph and participates in the iteration and score propagation process of the semantic-aware personalized PageRank algorithm.
[0077] Another aspect of the present application also provides a knowledge question answering system based on topic knowledge graph retrieval enhancement, comprising the following modules:
[0078] A local topic representation module is used for block processing of the original document, and a large language model is used to extract local topics in the form of triplets containing topics, semantic anchors and topic summaries from each text block.
[0079] A triplet set module is used for clustering of the local topic triplets, and the triplets in each cluster are fused to generate a global topic triplet set representing the global perspective of the entire document.
[0080] A hybrid knowledge graph construction module is used for construction of a hybrid knowledge graph containing entity nodes, community nodes and original text paragraph nodes based on the global topic triplet set and using topic-guided entity and relationship extraction.
[0081] An information retrieval module proposes a semantic-aware personalized PageRank algorithm SP-PPR, which matches the query semantics with the semantics of the edges in the hybrid knowledge graph during the retrieval process, dynamically adjusts the weight of the score propagation between nodes, and designs a three-level progressive retrieval mechanism to retrieve multi-level information related to the user query from the hybrid knowledge graph.
[0082] A question and answer output module is used for inputting the multi-level information into a large language model to generate a final answer.
[0083] The application takes GPT-4o as a basic model and is evaluated on the UltraDomain benchmark dataset. Advanced methods such as Naive RAG (basic RAG method), Raptor (RAG method for building tree index), GraphRAG (knowledge graph-based RAG method), and LightRAG (lightweight knowledge graph-based RAG method) are used as benchmarks. The comprehensive evaluation score in four dimensions of comprehensiveness, diversity, empowerment and overall performance is the benchmark value. Three sub-datasets in the UltraDomain benchmark test dataset are used for testing: CS (computer science dataset), Agriculture (agriculture dataset), and Mix (mixed dataset of multiple fields). On this basis, the knowledge retrieval and answer generation are carried out by applying the knowledge question answering method based on the topic knowledge graph retrieval enhancement proposed in the application. The comprehensive evaluation score under the same evaluation dimension is improved as shown in Table 1 compared with the benchmark model.
[0084] Table 1
[0085]
[0086] The experimental results show that the method proposed in the application is significantly better than all baseline methods in four evaluation dimensions. Compared with the basic Naive RAG method, the performance is improved by about 10%-20% on different datasets. This is due to the fact that the knowledge graph can accurately capture the entities and relationships related to the question, and on this basis, more rich and relevant answers can be generated. Compared with other knowledge graph-based RAG methods, there is about 5% improvement, which proves that the application can effectively improve the comprehensive performance of the RAG system in complex knowledge question answering tasks through the topic-guided construction, semantic-aware retrieval and three-level progressive mechanism.
[0087] The embodiments of the application are described in detail above in combination with the drawings, but the application is not limited to the described embodiments. For those skilled in the art, various changes, modifications, replacements and variations of the embodiments can be made without departing from the principles and spirits of the application, and still fall within the protection scope of the application.
Claims
1. A knowledge question answering method based on topic knowledge graph retrieval enhancement, characterized in that, Includes the following steps: Step 1: Divide the original document into chunks and use a large language model to extract local topics from each text chunk in the form of triples containing topic, semantic anchor, and topic summary; Step 2: Cluster the local topic triples and merge the triples within each cluster to generate a set of global topic triples representing the global perspective of the entire document; Step 3: Based on the global topic triple set, use topic-guided entity and relation extraction to construct a hybrid knowledge graph containing entity nodes, community nodes, and original text paragraph nodes; Step 4: Propose a semantically aware personalized PageRank algorithm, SP-PPR. During the retrieval process, the query semantics are matched with the semantics of edges in the hybrid knowledge graph, and the weights of score propagation between nodes are dynamically adjusted. The specific implementation process is as follows: Based on the personalized PageRank algorithm, the weights of the two nodes are redefined as follows: First, the triplet representing the relationship between two nodes is transformed into a numerical vector using an embedding model; Secondly, the user's query is transformed into a numerical vector through an embedding model; Finally, the similarity between the numerical vectors transformed from the triples and the query question is calculated, serving as the nodes of the two pairs. Weights of score propagation ; Use weights The original personalized PageRank algorithm score is weighted and combined with the user's personalized vector for the node to calculate the score of the next node. The initialization of the personalized vector specifically involves: using LLM to obtain the answer to the user-input query based on the thought process, and then performing a series of reasoning steps. For each step and the original query question, LLM is used to extract entities to obtain a set of candidate entities, and the entities are mapped back to the nodes of the hybrid knowledge graph. For each node, its first-order neighbors are obtained as context and input into the LLM for semantic scoring. This determines the contribution score of each entity to the original problem, and finally, the result is... individual entities As a preference node, the corresponding personalization probability is The reciprocal of the initialization vector is given, and the personalized probability of the remaining entities is 0. The combination of the personalized probabilities of all entities yields the initial personalized vector. ; Step 5: After dynamically adjusting the weights of score propagation between nodes, design a three-level progressive retrieval mechanism to retrieve multi-level information related to the user query from the hybrid knowledge graph; The three-level progressive retrieval mechanism specifically includes: Step 5.1 Obtain local information: Using the semantic perception personalized SP-PPR algorithm in Step 4, calculate the scores of all entity nodes in the knowledge graph, and select the Top-N entity nodes with the highest scores as local precise knowledge. Step 5.2 Obtain global information: Find the community set associated with the Top-N highest-scoring entity nodes. Then, we retrieved community reports from these communities to obtain coarse-grained, relevant knowledge about user queries from the community level. Step 5.3 Obtain original information: Based on the entity nodes retrieved in Step 5.1, locate and retrieve the original text paragraph nodes associated with them; Step Six: Input the multi-level information into the large language model to generate the final answer.
2. The knowledge question answering method based on topic knowledge graph retrieval enhancement according to claim 1, characterized in that, The extraction of local topics, represented as triplets containing the topic, semantic anchors, and topic summaries, specifically involves dividing the original document into blocks of fixed length. For each text fragment By leveraging the strong semantic analysis capabilities of large language models, a triplet structure is constructed. , The core content of this text block is the theme. To define the semantic scope of a topic by using semantic anchors, This is a topic summary.
3. The knowledge question answering method based on topic knowledge graph retrieval enhancement according to claim 1, characterized in that, The specific implementation process of step two is as follows: The local topic triples are vectorized using an embedding model; the vectorized triples are clustered using the K-means algorithm; for each cluster, a hint is constructed, and multiple triples within the cluster are merged into a global topic triple using a large language model.
4. The knowledge question answering method based on topic knowledge graph retrieval enhancement according to claim 3, characterized in that, The specific implementation process of step three is as follows: Step 3.1, Given document Divide it into a series of blocks, where each block The length satisfies the input constraints of LLM, and each block... All will be passed to the LLM The prompt extracts various elements from the graph index. The specific content of the prompt includes a global set of topic triples, aiming to guide users based on topic-specific information. Entity extraction is performed using prompts. Represents topic triple information. It provides guidance to the large model in extracting entities and relationships from the chunks. This is an example used for contextual learning; Step 3.2 Entity Extraction: After completing document segmentation, entity extraction is performed based on a large language model and using prompt words. Complete the entity and relation extraction guided by the theme, including through Entity and relation extraction is performed through... Identify all relevant entity sets and relation sets of the chunk under the current topic. , Entity set Each entity Includes entity name, type, and description information, and relationship set. Each relationship This includes the names of the source entities, the names of the target entities, and the descriptive information of the relationships. For each block, the above process is repeated under each topic information to perform multiple rounds of entity and relationship extraction. The entities and relationships obtained in each round are then merged to obtain the initial knowledge graph representation. ; Step 3.3 Entity Deduplication: Deduplication and merging strategies are used to process duplicate entities and relations between different segments, and entity and relation embeddings are obtained based on the pre-trained language model. and For each pair of entities in the set Calculate the similarity of each pair. If the similarity exceeds a preset threshold, use the large oracle model and based on... The prompt words will entity and merged into It also generates new entity description information; the same operation is performed on relations, replacing the original information with the merged entities or relations, and updating the set. and ; Step 3.4 Community and Paragraph Node Construction: In the initial knowledge graph, the set of nodes extracted under each topic is considered as a community. Each community contains multiple entities from the knowledge graph, and an entity can appear in multiple communities. For each community... Generate interpretable semantic reports using a large language model; each entity node Not only associated with the corresponding community It also associates with the corresponding text paragraphs. This yields a hybrid knowledge graph.
5. The knowledge question answering method based on topic knowledge graph retrieval enhancement according to claim 4, characterized in that, Step 3.2 further includes applying a multi-round collection strategy. For each block's initial extracted set, based on a large language model and using prompt words... Evaluate whether to extract all entities. If the LLM response does not extract all entities, then use... The prompt words continue to extract related entities, and the above process is repeated iteratively until all entities are extracted.
6. The knowledge question answering method based on topic knowledge graph retrieval enhancement according to claim 5, characterized in that, In step 5.3, locating and retrieving the associated original text paragraph node uses one of the following two methods: Method 1: Treat the original text paragraph nodes as virtual nodes and do not participate in the iteration process of the semantically aware personalized PageRank algorithm. After the algorithm converges, calculate the score of the paragraph node by summing the scores of all connected entity nodes and multiplying them by the similarity between the user's input query question and the original text paragraph node. Method 2: Treat the original text paragraph nodes as formal nodes in the hybrid knowledge graph and participate in the iteration and score propagation process of the semantic perception personalized PageRank algorithm.
7. A knowledge question answering system based on topic knowledge graph retrieval enhancement, used to implement the knowledge question answering method according to any one of claims 1 to 6, characterized in that, Includes the following modules: The local topic representation module is used to divide the original document into blocks and use a large language model to extract local topics from each text block in the form of triples containing topic, semantic anchor and topic summary; The triplet set module is used to cluster local topic triples and merge the triples within each cluster to generate a global topic triplet set that represents the global perspective of the entire document. The hybrid knowledge graph construction module, based on a global topic triple set, uses topic-guided entity and relation extraction to construct a hybrid knowledge graph containing entity nodes, community nodes, and original text paragraph nodes. The information retrieval module proposes a semantically aware personalized PageRank algorithm, SP-PPR. During the retrieval process, the query semantics are matched with the semantics of the edges in the hybrid knowledge graph, the weights of score propagation between nodes are dynamically adjusted, and a three-level progressive retrieval mechanism is designed to retrieve multi-level information related to the user query from the hybrid knowledge graph. The question-and-answer output module is used to input multi-level information into a large language model and generate the final answer.
Citation Information
Patent Citations
Knowledge graph-based efficient and accurate RAG question and answer method and device and storage medium
CN120763299A