Image retrieval enhancement generation method and device, and electronic device

CN122594500APending Publication Date: 2026-08-18WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610723439.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-25
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0005]本发明提供一种图检索增强生成方法、装置及电子设备,用以解决现有技术中因知识组织不充分、异构知识难以统一建模、图谱检索易引入无关路径以及检索结果难以直接支撑答案生成所导致的技术文档问答准确性、可追溯性和可解释性不足的缺陷

Benefits of technology

1、本发明以技术文档的章节层级作为知识组织边界,在章节语义作用域内划分正文、表格和代码等多类型知识单元,能够减少跨章节错误关联,提高技术文档知识表示的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122594500A_ABST
    Figure CN122594500A_ABST
Patent Text Reader

Abstract

The application provides a graph retrieval enhancement generation method and device and electronic equipment, and relates to the technical field of natural language processing. The method comprises the following steps: obtaining a technical document to be processed, performing chapter-level analysis on the technical document to be processed and determining a semantic scope, dividing a plurality of types of knowledge units in the semantic scope, respectively constructing knowledge sub-graphs corresponding to the plurality of types of knowledge units, performing cross-chapter entity fusion and heterogeneous knowledge alignment on the knowledge sub-graphs, and obtaining a document-level heterogeneous knowledge graph. A user query is obtained, the query anchor point and the candidate retrieval path are determined in the document-level heterogeneous knowledge graph according to the user query, the candidate retrieval path is adjusted and optimized to obtain a target path, and retrieval is performed according to the target path to obtain a target retrieval result. Through the application, the accuracy, traceability and interpretability of technical document question answering are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and in particular to a graph retrieval enhancement generation method, apparatus, and electronic device. Background Technology

[0002] Technical documentation serves as a crucial medium for conveying system descriptions, interface definitions, parameter constraints, operational procedures, and code examples. Unlike open-domain text, technical documentation exhibits a clear hierarchical structure, with different formats such as text, tables, and code often collectively expressing different aspects of the same technical object. When users ask questions based on technical documentation, the questions typically involve cross-chapter connections, multi-step factual combinations, conditional constraint judgments, and confirmation of source evidence.

[0003] Existing retrieval-enhanced generation methods typically retrieve several text fragments from technical documents and then input these fragments into a large language model to generate answers. While these methods can provide external information for the generation process, they still have the following drawbacks in the context of technical documents: First, concepts, parameters, interfaces, and operational steps in technical documents are constrained by chapter levels and local semantic spheres, and direct retrieval by text fragments can easily lead to incorrect cross-chapter associations; Second, heterogeneous knowledge carriers such as text, tables, and code have different modes of expression, making it difficult to model uniformly using a single text segmentation method; Third, if knowledge graph retrieval uses a fixed number of hops for expansion, it can easily introduce a large number of irrelevant nodes and relationships, making it difficult to control the search space; Fourth, graph retrieval results are usually represented as combinations of paths, triples, and source text, and if these are directly concatenated and input into a large language model, it can easily lead to evidence stacking, unclear reasoning chains, and insufficient source explanations.

[0004] Therefore, existing technologies have problems when processing technical documents, such as insufficient knowledge organization, difficulty in unifying the modeling of heterogeneous knowledge, easy introduction of irrelevant paths in graph retrieval, and difficulty in directly supporting answer generation with retrieval results. As a result, the accuracy, traceability, and interpretability of question answering need to be improved. Summary of the Invention

[0005] This invention provides a graph retrieval enhancement generation method, apparatus, and electronic device to address the shortcomings of existing technologies, such as insufficient knowledge organization, difficulty in unifying the modeling of heterogeneous knowledge, easy introduction of irrelevant paths in graph retrieval, and difficulty in directly supporting answer generation with retrieval results, resulting in insufficient accuracy, traceability, and interpretability of technical document question and answer.

[0006] In a first aspect, the present invention provides a graph retrieval enhancement generation method, comprising: The process involves acquiring a technical document to be processed, performing chapter-level parsing on the document and determining its semantic scope, dividing the document into multiple types of knowledge units within the semantic scope, constructing knowledge subgraphs corresponding to the multiple types of knowledge units, and performing cross-chapter entity fusion and heterogeneous knowledge alignment on the knowledge subgraphs to obtain a document-level heterogeneous knowledge graph. Obtain user queries, determine query anchors and candidate retrieval paths in the document-level heterogeneous knowledge graph based on the user queries, adjust and optimize the candidate retrieval paths to obtain target paths, and perform retrieval according to the target paths to obtain target retrieval results; Based on the user query, the target retrieval results are grouped into knowledge groups, local conclusions within groups are summarized, and joint reasoning is performed between groups to generate the target answer and the source basis corresponding to the target answer.

[0007] According to a graph retrieval enhancement generation method provided by the present invention, a technical document to be processed is obtained, the technical document to be processed is parsed at the chapter level and the semantic scope is determined, multiple types of knowledge units are divided within the semantic scope, and knowledge subgraphs corresponding to the multiple types of knowledge units are constructed respectively, including: Identify the chapter titles, title levels, title numbers, title positions, and hierarchical relationships between titles in the document to be processed, and construct the chapter hierarchy structure; The semantic scope of each chapter is determined based on the chapter hierarchy structure. Within the semantic scope, at least two types of knowledge units are divided into textual knowledge units, tabular knowledge units, and code knowledge units. Knowledge extraction and unified modeling are performed on the various types of knowledge units respectively to obtain knowledge subgraphs corresponding to different types of knowledge units.

[0008] According to the graph retrieval enhancement generation method provided by the present invention, knowledge extraction and unified modeling of the multi-type knowledge units are performed respectively, including: Entities and entity relationships are extracted from the text knowledge units to obtain text knowledge subgraphs; Structured attributes, attribute values, and corresponding relationships are extracted from the tabular knowledge units to obtain tabular knowledge subgraphs; Semantic objects, parameter relationships, return relationships, and call relationships are extracted from the code knowledge units to obtain a code knowledge subgraph; Preserve the source mapping relationship between the graph facts in each knowledge subgraph and the original source content.

[0009] According to a graph retrieval enhancement generation method provided by the present invention, cross-chapter entity fusion and heterogeneous knowledge alignment are performed on the knowledge subgraph to obtain a document-level heterogeneous knowledge graph, including: Based on entity name, semantic representation, context information, and chapter position, entities in different chapters are matched to determine the entities to be merged; The entities to be merged are merged into a unified entity node, and the mapping relationship between the unified entity node and the original chapter and source content is retained; Based on the entity correspondence or semantic association between the text knowledge units, the table knowledge units, and the code knowledge units, establish cross-type knowledge relationships; The document-level heterogeneous knowledge graph is obtained based on the unified entity node, the cross-type knowledge relationship, and the knowledge subgraph.

[0010] According to a graph retrieval enhancement generation method provided by the present invention, a user query is obtained, and query anchor points and candidate retrieval paths are determined in the document-level heterogeneous knowledge graph based on the user query. The candidate retrieval paths are then adjusted and optimized to obtain a target path, including: Entity identification is performed on the user query to obtain candidate query entities; The query anchor is determined based on the name similarity, semantic similarity, and context matching relationship between the candidate query entity and the entity nodes in the document-level heterogeneous knowledge graph; the query anchor is determined by a domain text embedding encoder. Candidate search paths are generated starting from the query anchor point; The pre-trained path scoring model is invoked to determine the path score between the candidate retrieval path and the user query. The candidate retrieval paths are dynamically expanded, filtered, and pruned based on the path scores to obtain the target path.

[0011] According to the graph retrieval enhancement generation method provided by the present invention, the path scoring model is trained using path-level weak supervision signals; The path-level weak supervision signal is constructed based on the source mapping relationship between the supporting statements corresponding to the training query and the graph facts in the document-level heterogeneous knowledge graph. The positive and negative sample paths are determined using the path-level weak supervision signal, and the path scoring model is trained using the training query, the positive sample paths, and the negative sample paths.

[0012] According to a graph retrieval enhancement generation method provided by the present invention, candidate retrieval paths are dynamically expanded, filtered, and pruned based on the path scores to obtain a target path, including: Based on the path score of the candidate retrieval paths in the current round, retain the candidate retrieval paths that meet the preset conditions; The retained candidate retrieval paths are expanded by adjacency to obtain the next round of candidate retrieval paths; Candidate search paths that do not meet the preset conditions, are duplicates of existing paths, or have reached the stopping condition are deleted, and the remaining candidate search paths are the target paths.

[0013] According to a graph retrieval enhancement generation method provided by the present invention, the target retrieval results are grouped into knowledge groups, local conclusions within groups are summarized, and joint reasoning between groups are performed based on the user query to generate a target answer and the source basis corresponding to the target answer, including: Determine the target response based on the user query; Based on the answer objective, the target retrieval results are grouped into knowledge groups, and the target paths, graph facts and source content that jointly support the same answer objective or the same semantic aspect are divided into the same knowledge group; For each knowledge group, local conclusions are summarized within the group to obtain the corresponding local conclusions. Based on the semantic, entity, or reasoning dependencies between different knowledge groups, joint reasoning is performed on multiple local conclusions to generate the target answer and its source basis.

[0014] Secondly, the present invention also provides a graph retrieval enhancement generation apparatus, comprising: The heterogeneous knowledge graph construction module is used to acquire the technical document to be processed, perform chapter-level parsing on the technical document to be processed and determine the semantic scope, divide the document into multiple types of knowledge units within the semantic scope, construct knowledge subgraphs corresponding to the multiple types of knowledge units, and perform cross-chapter entity fusion and heterogeneous knowledge alignment on the knowledge subgraphs to obtain a document-level heterogeneous knowledge graph. The graph dynamic retrieval module is used to obtain user queries, determine query anchors and candidate retrieval paths in the document-level heterogeneous knowledge graph based on the user queries, adjust and optimize the candidate retrieval paths to obtain the target path, and perform retrieval according to the target path to obtain the target retrieval results. The knowledge joint reasoning module is used to perform knowledge grouping, intra-group local conclusion summarization, and inter-group joint reasoning on the target retrieval results based on the user query, and generate the target answer and the source basis corresponding to the target answer.

[0015] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the graph retrieval enhancement generation method as described in the first aspect above.

[0016] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention uses the chapter hierarchy of technical documents as the knowledge organization boundary, and divides multiple types of knowledge units such as text, tables and code within the semantic scope of the chapter, which can reduce cross-chapter erroneous associations and improve the accuracy of knowledge representation in technical documents.

[0017] 2. This invention utilizes a large language model to extract differentiated knowledge from text, tables, and code, and combines cross-chapter entity fusion and heterogeneous knowledge alignment to form a document-level heterogeneous knowledge graph that covers the conceptual relationships in the main text, the parameter constraints in the tables, and the operation information in the code.

[0018] 3. This invention improves the accuracy of query anchor recognition and entity alignment by using a domain text embedding encoder and low-rank adaptation fine-tuning to map query text, technical terms, entity aliases and source text to a semantic space more suitable for technical document question answering.

[0019] 4. In a preferred embodiment, the present invention employs a path scoring model that includes a bidirectional gated loop unit, query-aware gating, bilinear attention, and a path scoring layer, which can model the sequential dependency, query relevance, and path support capability of multi-hop candidate paths.

[0020] 5. This invention utilizes the source mapping between supporting statements and graph facts to construct path-level weak supervision signals, which can train path scoring models in technical document scenarios where explicit path annotations are lacking.

[0021] 6. This invention employs a dynamic path expansion, filtering, and pruning mechanism, eliminating the need for fixed-hop expansion of all candidate branches. This reduces the accumulation of noisy paths in multi-hop retrieval, thereby improving retrieval efficiency and critical path hit rate.

[0022] 7. This invention performs knowledge grouping, intra-group local conclusion summarization, and inter-group joint reasoning through a large language model, organizing scattered paths, graph facts, and source content into a reasoning structure oriented towards the answer target, thereby improving the completeness of the target answer and the interpretability of the source. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0024] Figure 1 This is a flowchart of the graph retrieval enhancement generation method provided by the present invention; Figure 2 This is a schematic diagram illustrating the construction process of a document-level heterogeneous knowledge graph in an embodiment of the present invention; Figure 3 This is a schematic diagram of the dynamic map retrieval process in an embodiment of the present invention; Figure 4 This is a schematic diagram of the knowledge joint reasoning process in an embodiment of the present invention; Figure 5 This is a structural block diagram of the graph retrieval enhancement generation device provided by the present invention; Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0026] Please see Figure 1 This application provides a graph retrieval enhancement generation method, aiming to address the problems in existing technologies such as insufficient knowledge organization in technical documents, difficulty in unifying the modeling of heterogeneous knowledge, easy introduction of irrelevant paths in graph retrieval, and difficulty in directly supporting answer generation with retrieval results. The method first constructs a structured document-level heterogeneous knowledge graph through deep analysis of technical documents. Then, upon receiving a user query, the method performs a dynamic, query-aware retrieval process on the graph to accurately locate relevant knowledge paths. Finally, it intelligently reasons and organizes the retrieved results to generate accurate and traceable answers.

[0027] Specifically, the first stage of this method involves constructing a heterogeneous knowledge graph. The goal of this stage is to transform unstructured or semi-structured technical documents into a machine-understandable knowledge network. This process begins by acquiring the technical document to be processed and performing chapter-level parsing to determine the semantic scope of each chapter. This step is designed to leverage the inherent chapter structure of the technical document to constrain the scope of knowledge associations and prevent semantic confusion caused by global processing. Within the determined semantic scope, the method further divides the document into various knowledge units, such as text, tables, and code, and constructs corresponding knowledge subgraphs for each type of knowledge unit. Finally, through cross-chapter entity fusion and alignment between different types of knowledge, the subgraphs are integrated into a unified document-level heterogeneous knowledge graph. In this way, this method provides a unified and structured representation of the document's structural information, multimodal content, and complex relationships between entities, providing a solid foundation for subsequent accurate retrieval.

[0028] Furthermore, in a preferred embodiment, the process of constructing the heterogeneous map described above can be refined. Please refer to [link to relevant documentation]. Figure 2 The process begins by identifying chapter titles, heading levels, numbering, positions, and hierarchical relationships within the document to be processed, thus constructing the document's chapter hierarchy. Based on this structure, the semantic scope of each chapter can be clearly defined. Within these scopes, the system divides the content into at least two types of knowledge units: textual knowledge units, tabular knowledge units, and code knowledge units. Subsequently, the system performs knowledge extraction and unified modeling on these various knowledge units, obtaining their respective corresponding knowledge subgraphs. This divide-and-conquer followed by unified modeling strategy ensures that the characteristics of different types of knowledge are fully preserved during the extraction stage, while achieving a unified representation at the graph level.

[0029] In another preferred embodiment, the process of knowledge extraction and unified modeling for multiple types of knowledge units involves more refined operations. For text knowledge units, the system extracts the entities they contain and the relationships between them to form a text knowledge subgraph. For table knowledge units, it extracts their structured attributes, attribute values, and their correspondences to construct a table knowledge subgraph. For code knowledge units, it extracts the defined semantic objects, parameter relationships, return relationships, and call relationships between different code blocks to generate a code knowledge subgraph. A key step is to always maintain the source mapping relationship between facts in the graph (such as a triple) and their source content in the original document (such as a paragraph of text or a table cell) throughout the construction of all these knowledge subgraphs. This design ensures the traceability of the final answer and is the technical guarantee for realizing the "source basis" function.

[0030] In one optional implementation, to form the final document-level heterogeneous knowledge graph, the various knowledge subgraphs constructed above need to be merged. This process includes cross-chapter entity fusion and heterogeneous knowledge alignment. The system matches entities in different chapters that may refer to the same thing based on the entity's name, semantic representation, context information, and its chapter position, and merges these entities into a unified entity node, while retaining the mapping between this unified node and all original chapters and source content. In addition, the system establishes cross-type knowledge relationships based on the entity correspondence or semantic association between text, table, and code knowledge units. For example, a parameter name mentioned in the text can be associated with the attribute of that parameter defined in the table. Finally, using these unified entity nodes, cross-type knowledge relationships, and the original knowledge subgraphs, the document-level heterogeneous knowledge graph is constructed.

[0031] The second stage of this method involves dynamic graph retrieval. After acquiring a user query, the goal of this stage is to efficiently and accurately find query-related evidence within the constructed document-level heterogeneous knowledge graph. This process first identifies one or more query anchors in the graph based on the user query, and then generates candidate retrieval paths from these anchors. Unlike traditional fixed-hop expansion, this method introduces a path scoring model to score these candidate paths in real time. Based on the path scores, the system dynamically adjusts and optimizes the candidate paths, including expansion, filtering, and pruning, ultimately obtaining a high-quality set of target paths. Retrieving along these target paths yields target retrieval results that include the path itself, the graph facts along the path, and the original source content of these facts. The core advantage of this dynamic retrieval mechanism lies in its query-awareness capability, which effectively suppresses the expansion of irrelevant information and focuses on the most promising reasoning paths.

[0032] Furthermore, in a preferred embodiment, the above-described dynamic map retrieval process also includes several detailed steps. Please refer to [link / reference]. Figure 3 The process begins with entity recognition of the user query to obtain candidate query entities. Then, the system determines query anchors as the starting point for retrieval based on the name similarity, semantic similarity, and contextual matching between these candidate query entities and entity nodes in the graph. The calculation of semantic similarity and contextual matching can rely on an embedding encoder fine-tuned for the domain text. Once the query anchor is determined, the system generates candidate retrieval paths based on it. Subsequently, a pre-trained path scoring model is invoked to calculate the path score between each candidate retrieval path and the user query. Finally, based on these path scores, the candidate paths are dynamically expanded, filtered, and pruned to obtain the final target path. This series of operations ensures the accuracy and efficiency of the retrieval process.

[0033] The domain text embedding encoder is used to semantically encode user queries, candidate query entities, and entity nodes in document-level heterogeneous knowledge graphs, and to perform entity alignment based on the encoding results. The domain text embedding encoder is also used for semantic representation of path elements in candidate retrieval paths and for calculating the relevance of source content.

[0034] The path scoring model is used to jointly represent user queries and candidate retrieval paths, and outputs a path score based on the entity semantic representation, relation semantic representation, source content semantic representation, and path structure information in the candidate retrieval paths. The path score characterizes the degree to which the candidate retrieval path supports the answer corresponding to the user query.

[0035] In another preferred embodiment, the path scoring model is trained using path-level weak supervision signals. This training method is designed to address the difficulty of obtaining a large number of labeled "correct" retrieval paths in real-world applications. Specifically, the path-level weak supervision signals are constructed based on the source mapping relationship between the supporting statements (i.e., text fragments that answer the query) corresponding to the training query and the graph facts. Using this indirect supervision information, it is possible to automatically determine which paths are "positive sample paths" likely to lead to the correct answer and which are irrelevant "negative sample paths." Then, using these training queries, positive sample paths, and negative sample paths, the path scoring model can be effectively trained.

[0036] In one optional implementation, the details of dynamically adjusting candidate retrieval paths based on path scores are as follows: In each iteration, the system first retains only those paths that meet preset conditions based on the path scores of the current candidate paths. Then, these retained paths are expanded by adjacency, i.e., moving forward one step along the edge of the graph to generate candidate paths for the next round. During this process, the system actively deletes candidate paths whose path scores do not meet preset conditions, duplicate existing paths, or have reached preset stopping conditions (such as maximum path length). After multiple iterations, the remaining candidate retrieval paths are the final target paths. This "scoring-expansion-pruning" cyclical mechanism effectively controls the search space and avoids the path explosion problem common in multi-hop retrieval.

[0037] The third stage of this method involves performing joint knowledge reasoning to generate the final answer. The core task of this stage is to organize the potentially fragmented target retrieval results obtained in the second stage into a coherent, complete, and well-supported answer. This process first groups the target retrieval results according to the user query, grouping evidence supporting the same key point of the answer together. Then, it summarizes the local conclusions within each knowledge group to form the core viewpoint of that group. Finally, based on these local conclusions, it performs joint reasoning between groups, synthesizing different viewpoints to generate the final target answer, along with the corresponding source evidence for each part of the answer. This hierarchical reasoning approach significantly improves the logicality and interpretability of the answers generated by the large language model.

[0038] Furthermore, in a preferred embodiment, the above-described knowledge joint reasoning process can be further refined. See also... Figure 4The process begins by determining the target of the answer based on the user query. Then, based on this target, the target retrieval results obtained in the second stage are grouped into knowledge groups. Specifically, target paths, graph facts, and source content that jointly support the same answer target or the same semantic aspect are grouped into the same knowledge group. Next, local conclusions within each knowledge group are summarized, extracting the direct conclusions that can be drawn from the evidence in that group. Finally, the system analyzes the semantic relationships, entity relationships, or inference dependencies (such as causality, conditionality, and parallelism) between different knowledge groups, and based on these relationships, performs joint inference between multiple local conclusions to generate a logically rigorous and comprehensive target answer along with its corresponding source evidence.

[0039] Please see Figures 1 to 4 The following is a detailed description of a complete embodiment of the present invention. This embodiment provides a graph retrieval enhancement generation method, which includes three main stages: heterogeneous graph construction (S100), dynamic graph retrieval (S200), and knowledge joint reasoning (S300).

[0040] For step S100, for example, in step S110, the technical document to be processed is obtained, chapter-level parsing is performed, and multiple types of knowledge units are divided within the semantic scope of the chapters. The technical document to be processed can be a single technical document or a collection of multiple technical documents under the same technical topic. Each technical document may include natural language text, tables, code blocks, command examples, parameter descriptions, return value descriptions, and chapter titles, etc. After reading the technical document to be processed, the system converts it into a unified internal representation.

[0041] The technical document to be processed can be represented by the following data structure:

[0042] in, This indicates a technical document awaiting processing. Indicates the first i Chapters Indicates the number of chapters. Each chapter It can further include headings, body paragraphs, tables, code blocks, and source location information.

[0043] The system identifies chapter titles, title levels, title numbers, title positions, and hierarchical relationships within the technical document to be processed, and constructs a chapter hierarchy tree accordingly. In one implementation, the system can determine the chapter hierarchy based on title numbers, style levels, indentation formats, font size variations, or document structure tags. For chapter nodes... The system establishes relationships between parent chapter nodes, child chapter nodes, and sibling chapter nodes. The chapter hierarchy tree is used not only to determine the document structure but also to define the local semantic scope for subsequent knowledge extraction.

[0044] In this embodiment, the semantic scope of a chapter can be represented as:

[0045] Among them, Anc( () indicates a chapter The collection of superior chapters, Chapter The system prioritizes using chapters as a sub-category of knowledge extraction. The context and its related elements serve as local semantic boundaries, avoiding the direct association of semantically inconsistent concepts across different chapters.

[0046] The system divides knowledge into textual knowledge units, tabular knowledge units, and code knowledge units based on the semantic scope of each chapter. For chapters... Its set of knowledge units can be represented as:

[0047] in, Represents a set of textual knowledge units. Represents a set of knowledge units in a table. This represents a collection of code knowledge units.

[0048] For text knowledge units, the system divides them based on paragraph boundaries, semantic continuity, heading affiliation, and inter-sentence dependencies. A text knowledge unit may include a paragraph, several consecutive sentences, or explanatory text surrounding the same technical object. For table knowledge units, the system identifies table boundaries, table titles, table headers, row headers, column headers, and cell content. Table knowledge units include not only cell text but also the cell's row and column position, its table header, and chapter origin. For code knowledge units, the system identifies code block boundaries, function names, class names, variable names, parameters, return values, call statements, comments, and adjacent explanatory text. Code knowledge units include not only the code snippet itself but also the chapter in which the code snippet is located and adjacent natural language descriptions.

[0049] In step S120, the large language model is invoked to perform entity extraction, entity disambiguation, and incremental triple generation on the text knowledge units.

[0050] In this step, the system inputs textual knowledge units into a large language model and calls the large language model to extract candidate entities and candidate relations. To avoid entity duplication within the same knowledge unit and entity ambiguity across knowledge units, the system performs two-stage entity disambiguation.

[0051] The first stage involves unifying entities within the text knowledge unit. The system merges candidate entities based on entity name, context description, and chapter, resulting in a unified entity set within the unit. The second stage involves aligning entities within the existing document-level entity set. For entities to be aligned... and existing entities The system calculates the fusion score:

[0052] in, Indicates name similarity. Indicates semantic similarity. Indicates contextual similarity, Indicates the similarity of chapter positions. , , and This represents the weighting coefficient. If the fusion score meets the preset conditions, then the entity... With entity Merge; otherwise, merge entities. It is added to the text knowledge subgraph as a new entity node.

[0053] If the fusion score meets the preset conditions, then the entity will be... With entity Merge; otherwise, merge entities. As new entity nodes, they are added to the text subgraph. During the incremental triple generation process, the large language model not only receives the current text knowledge unit, but also the existing entities and local graph structures related to the current knowledge unit, so that the newly generated triples can be consistent with the existing knowledge.

[0054] A text knowledge subgraph can be represented as:

[0055] in, Represents a set of text entity nodes. This represents the set of text relation edges. Each text relation edge corresponds to a triple (h, r, t) and stores its source text. .

[0056] In step S130, the large language model and table parsing rules are invoked to construct a table knowledge subgraph.

[0057] In this step, the system performs structured parsing of the table knowledge unit, identifying the table title, header, row titles, column titles, cell content, and the chapter in which the table belongs. For table knowledge units... The system first establishes a local table ontology. The local table ontology is used to describe the constraint relationships between objects, attributes, and values ​​in the table.

[0058] A table-based knowledge subgraph can be represented as:

[0059] in, Includes table entity nodes, attribute nodes, and value nodes. This includes attribute edges, constraint edges, and source mapping edges. As a result, the system can preserve the structural correspondence between table headers, row headers, column headers, and data units, allowing the graph retrieval module to utilize the parameter constraints, value ranges, and configuration descriptions in the tables.

[0060] In step S140, the large language model and code parsing rules are invoked to construct a code knowledge subgraph.

[0061] In this step, the system performs semantic abstraction on code knowledge units. First, the system parses functions, classes, variables, parameters, return values, exception information, and call statements in the code; second, the system combines code comments, adjacent explanatory text, and chapter titles, and calls a large language model to extract the theme, function, and example meaning of the code snippets; third, the system models the above information into a code knowledge subgraph.

[0062] The code knowledge subgraph can be represented as:

[0063] in, This includes code object nodes, function nodes, parameter nodes, return value nodes, and function description nodes; This includes relationships such as inclusion, parameter, return, call, and function description.

[0064] For example, for a function description code block, the system can establish relationships such as "function-parameters-parameter names", "function-return-return value", "example code-call-function", and "function-implementation-functionality description". Thus, code snippets are no longer just text fragments participating in retrieval, but rather as connectable and traversable structured knowledge participating in graph retrieval.

[0065] In step S150, cross-chapter entity fusion and heterogeneous knowledge alignment are performed on the multi-type knowledge subgraphs.

[0066] like Figure 2 As shown, the document-level heterogeneous knowledge graph construction process includes the generation of text knowledge subgraphs, table knowledge subgraphs, and code knowledge subgraphs, as well as cross-chapter entity fusion and heterogeneous knowledge alignment. In this step, the system will generate the text knowledge subgraph... Table knowledge subgraph and code knowledge subgraph To integrate.

[0067] The merged document-level heterogeneous knowledge graph can be represented as:

[0068] in, Represents a set of nodes. Denotes the set of edges. Represents a set of relation types. S This represents the source mapping set. The node set includes at least one of the following: chapter nodes, knowledge unit nodes, entity nodes, table object nodes, and code object nodes; the source mapping set... S Used to record the correspondence between graph facts and source paragraphs, source tables, or source code in the original technical documents.

[0069] Cross-chapter entity fusion is used to handle the recurrence of the same technical object across different chapters. For example, the same parameter might appear in the overview chapter, configuration chapter, and example chapter. The system determines whether they are the same entity based on the entity name, semantic representation, chapter position, and context information, and merges entities that meet the criteria into a unified entity node.

[0070] Heterogeneous knowledge alignment is used to establish cross-type relationships between text, tables, and code. For example, parameter entities appearing in the text can be aligned with parameter attributes in a table, function descriptions in the text can be aligned with function nodes in a code subgraph, and configuration items in a table can be aligned with parameter calls in a code example. After alignment, the system establishes cross-type knowledge relationships in the graph, enabling knowledge from different carriers to participate in retrieval within the same graph structure.

[0071] For step S200, for example, in step S210, the domain text embedding encoder is established and fine-tuned.

[0072] like Figure 3 As shown, the domain text embedding encoder is used to semantically encode user queries and graph entities, and, in conjunction with entity recognition and entity alignment results, determines query anchors. In this step, the system uses a pre-trained text embedding model as the basic encoder. To adapt to domain terms, abbreviations, aliases, mixed Chinese and English expressions, and similar concepts in technical documents, the system performs domain fine-tuning on the basic encoder using a low-rank adaptation method.

[0073] The low-rank adaptation module is injected into the query projection layer and numerical projection layer of the attention module, while the remaining pre-trained parameters remain frozen. For any linear layer weights... The weights after low-rank adaptation can be expressed as:

[0074] in, and It is a low-rank trainable matrix. Therefore, the system learns the semantics of technical documents with a relatively low number of parameters while retaining the general representational capabilities of the base model.

[0075] During training, the system constructs query text. Positive sample text and negative sample text set The encoder outputs the query vector. and text vector And the degree of matching is calculated using cosine similarity:

[0076] The system is trained using a multi-negative-sample contrastive learning loss:

[0077] in, For temperature parameters. After training, the domain text embedding encoder is used for query anchor recognition, entity alignment, semantic representation of path elements, and source text relevance calculation.

[0078] In step S220, candidate entities in the user query are identified and mapped to query anchors in the document-level heterogeneous knowledge graph.

[0079] In this step, the system obtains the user query. The system then calls the entity recognition module to identify candidate query entities in the query. The entity recognition module can be implemented using a large language model, a domain dictionary matching model, or a sequence labeling model.

[0080] For candidate query entities Candidate entities in document-level heterogeneous knowledge graphs The system calculates the name matching score, semantic matching score, and context matching score respectively, and obtains the entity alignment score:

[0081] in, , and This refers to the weighting coefficient. The query anchor point is determined as follows:

[0082] in, This indicates the query anchor point. If a user query contains multiple candidate query entities, the system can determine multiple query anchor points and initiate dynamic path retrieval from each of the different query anchor points.

[0083] In step S230, candidate retrieval paths are generated and path input sequences are constructed.

[0084] In this step, the system uses the query anchor point. Starting with the document-level heterogeneous knowledge graph, adjacency expansion is performed to obtain candidate retrieval paths. A candidate retrieval path can be represented as:

[0085] in, To query the anchor point, Indicates the first Relationship, Indicates the first 1 path node Indicates the path length.

[0086] For the path in the first With local triples, the system can be represented as:

[0087] The system converts each local triple into a path element input representation. The path element input representation consists of entity semantic representation, relation semantic representation, source text semantic representation, and hop count embedding.

[0088] in, Represents a triplet The corresponding source content, This represents the learnable path hop count embedding. By incorporating hop count embedding, the model can distinguish the structural role of the same triple at different path positions.

[0089] In step S240, a path sequence encoder containing a bidirectional gated loop unit is invoked to encode the candidate path.

[0090] like Figure 3 As shown, the neural network path scoring model includes a path element embedding layer, a hop count embedding layer, a path sequence encoder, a query-aware gating module, a query-aware bilinear attention module, and a path scoring layer. In this step, the system inputs the path input sequence into the path sequence encoder. The path input sequence can be represented as:

[0091] in, This represents the path input sequence. Preferably, the path sequence encoder is a bidirectional gated cyclic unit, i.e., a BiGRU. The forward GRU models path sequence information from the path start point to the path end point, while the reverse GRU models reverse dependency information from the path end point to the path start point.

[0092] For the Each path element, including its forward hidden state, reverse hidden state, and local hidden state, can be represented as follows:

[0093]

[0094]

[0095] in, It includes both path prefix and path suffix information. Through BiGRU, the model can identify the combinational relationships between preceding and following graph facts in a path, avoiding the need to judge path relevance based solely on a single node or edge.

[0096] In some embodiments, the GRU unit includes an update gate, a reset gate, and candidate states. For input... and the hidden state at the previous moment The calculation process can be expressed as follows:

[0097]

[0098]

[0099]

[0100] in, Indicates an update to the door. This indicates that the door is being reset. This indicates the candidate state. The above gating structure can control the proportion of historical path information retained in the current path representation.

[0101] In step S250, the query perception gating module is used to filter relevant information in the path.

[0102] In this step, the system processes user queries. Encode to obtain the query representation The query representation can be output by a domain text embedding encoder or by the query encoding layer in a path scoring model. For path latent states... The system is based on the query representation Calculate the query relevance threshold:

[0103] And obtain the hidden state of the filtered path:

[0104] in, Used to characterize the Path elements and queries The degree of relevance.

[0105] If a path element has low relevance to the query, its corresponding gate value is small, reducing its impact on the final path representation; conversely, if a path element has high relevance to the query, its corresponding gate value is large, preserving its semantic information. This query-aware gating module reduces the interference of irrelevant entities, generalized relationships, or weakly related source text in the path scoring, enabling the path scoring model to focus more on local graph facts directly relevant to the user query.

[0106] In step S260, path information is aggregated using a query-aware bilinear attention module.

[0107] In this step, the system further utilizes a query-aware bilinear attention module to perform weighted aggregation of the hidden states of the filtered paths. For the path... The attention weights for each element are calculated as follows:

[0108] in, These are learnable bilinear attention parameters. Attention weights. Reflecting the path The importance of each element in answering the current query. The query-aware path representation of candidate paths is as follows:

[0109] This module enables the model to distinguish between key triples and auxiliary triples within a multi-hop path and aggregate a path-level representation for the current query.

[0110] In step S270, the path score is output through the path scoring layer.

[0111] In this step, the system will query the perceived path representation. Input path scoring layer to obtain candidate paths Path score:

[0112] in, Indicate candidate path Compared to user query Path score, and These are the parameters for the path scoring layer. Path score. Used to characterize candidate paths Support user queries The degree of correspondence with the answer.

[0113] In some embodiments, the path scoring layer can be a single linear layer or a multilayer perceptron containing a nonlinear activation function. If a multilayer perceptron is used, the path score can be expressed as:

[0114] In step S280, a path-level weak supervision signal is constructed and a path scoring model is trained.

[0115] In this step, the system constructs path-level weak supervision signals using the source mapping relationship between supporting statements and graph facts. Let the triples... The corresponding set of source statements is S( ), query The corresponding set of supported statements is ,path The set of triples contained is ( If the path is associated with the source statement set, then the set of source statements is:

[0116] The current quality score measures the degree of match between the source statement of the current path association and the query supporting statements:

[0117] The extended value score measures the potential of the current path prefix to achieve higher support coverage in subsequent extensions:

[0118] The overall weak supervision label is:

[0119] in, This is the balance coefficient.

[0120] During model training, the mean squared error loss function is used:

[0121] With the training method described above, the model can learn the correspondence between queries and candidate paths by utilizing text-level support statement supervision signals without explicit path labeling.

[0122] In step S290, dynamic path expansion, filtering, and pruning are performed based on path scores.

[0123] like Figure 3 As shown, the dynamic path retrieval process includes candidate path adjacency expansion, path scoring, high-scoring path retention, duplicate or low-scoring path pruning, and output of the target retrieval results. In this step, the system performs multiple rounds of path expansion starting from the query anchor point. Unlike fixed-hop expansion, the system calls the path scoring model to score the candidate paths after each round of expansion and only retains high-scoring paths for further expansion.

[0124] Let the first t The candidate path set for each round is The set of paths after adjacency expansion is Expand( If the path set is not specified, then the next set of retained paths will be:

[0125] in, This indicates that the previous score should be retained based on the path score. A path.

[0126] The dynamic retrieval process includes the following steps: First, deleting candidate paths with scores below a preset threshold; second, deleting candidate paths that are duplicates or highly similar to existing paths; third, retrieving paths that have reached the maximum path length. The path is stopped from expanding; fourth, the path that has covered sufficient source evidence or meets the termination condition is stopped from expanding; fifth, the triples and source content in the final retained path are deduplicated and used as the target retrieval result.

[0127] The target search results can be represented as:

[0128] in, Indicates the target path. This represents the set of facts in the path-corresponding graph. This represents the set of source content corresponding to the triple.

[0129] For step S300, for example, in step S310, the large language model is invoked to perform knowledge grouping on the target retrieval results.

[0130] like Figure 4 As shown, the knowledge grouping and joint reasoning generation process includes target retrieval result input, knowledge group construction, intra-group local conclusion summarization, inter-group joint reasoning, and target answer and source evidence output. In this step, the system will input the user query... The target path, path-corresponding triples, and source content are input into the large language model, and the knowledge grouping is first performed by generating prompts to constrain the large language model.

[0131] The knowledge grouping results can be represented as:

[0132] Each knowledge group includes paths, graph facts, and source content that jointly support the same key point of the answer. The construction of knowledge groups is not solely based on the order of paths and sources, but rather on the answer objective and semantic support relationships.

[0133] In some embodiments, the large language model constructs knowledge groups according to the following rules: if multiple search results jointly explain the meaning of the same parameter, the same operating condition, the same error cause, or the same configuration constraint, they are grouped into the same knowledge group; if the search results support different aspects of the answer, they are grouped into different knowledge groups; if a search result cannot support the user's query, it is excluded or its priority is reduced.

[0134] In step S320, the large language model is invoked to summarize local conclusions within the group.

[0135] In this step, the large language model targets each knowledge group. Integrate information within the group to obtain partial conclusions. :

[0136] in, This indicates that the large language model revolves around user queries. For knowledge groups The operation involves summarizing the path, triples, and source text.

[0137] The in-group local conclusion summarization includes: removing duplicate evidence, retaining key facts, completing the correspondence between the path and the source text, converting structured triples into natural language conclusions, and marking the source content corresponding to the local conclusion.

[0138] In step S330, the large language model is invoked to perform inter-group joint reasoning and generate the target answer.

[0139] In this step, the large language model integrates multiple local conclusions and performs joint reasoning based on the complementary, constraining, progressive, causal, or parallel relationships between these local conclusions to generate the target answer.

[0140] in, This indicates that the large language model revolves around user queries. An operation that performs joint reasoning on multiple partial conclusions.

[0141] The large language model is subject to the following constraints when generating target answers: First, it generates answers based solely on the target retrieval results and their source content, without introducing external knowledge; second, it prioritizes the use of facts that can be directly supported by the source content; third, when multiple knowledge groups have conditional constraints or causal relationships, they are logically integrated before outputting the answer; and fourth, when outputting the answer, the source evidence corresponding to the answer fragment is retained.

[0142] In step S340, the target answer and its source are output.

[0143] In this step, the system outputs the source evidence based on the correspondence between the target answer and the target search results. The source evidence includes the target path supporting the answer, the corresponding graph facts, and the source text fragments. In some embodiments, the system can divide the target answer into several answer fragments and bind a corresponding set of source content to each answer fragment. Thus, users can not only obtain the final answer but also view the document location, graph facts, and search path upon which the answer is based.

[0144] In summary, through the above implementation methods, this embodiment achieves enhanced graph retrieval generation by having three modules—heterogeneous graph construction, dynamic graph retrieval, and joint knowledge reasoning—work collaboratively.

[0145] This invention also provides a graph retrieval enhancement generation apparatus. The graph retrieval enhancement generation apparatus provided by this invention will be described below. The graph retrieval enhancement generation apparatus described below can be referred to in correspondence with the graph retrieval enhancement generation method described above. For example... Figure 5 As shown, the device includes: The heterogeneous graph construction module 401 is used to acquire the technical document to be processed, perform chapter-level parsing on the technical document to be processed and determine the semantic scope, divide the document into multiple types of knowledge units within the semantic scope, construct knowledge subgraphs corresponding to the multiple types of knowledge units, perform cross-chapter entity fusion and heterogeneous knowledge alignment on the knowledge subgraphs, and obtain a document-level heterogeneous knowledge graph. The graph dynamic retrieval module 402 is used to obtain user queries, determine query anchors and candidate retrieval paths in the document-level heterogeneous knowledge graph based on user queries, adjust and optimize candidate retrieval paths to obtain target paths, and perform retrieval according to target paths to obtain target retrieval results. The knowledge joint reasoning module 403 is used to perform knowledge grouping, local conclusion summarization within groups, and joint reasoning between groups on the target retrieval results based on the user query, and generate the target answer and the source basis corresponding to the target answer.

[0146] Specifically, the heterogeneous knowledge graph construction module 401 corresponds to step S100, the dynamic knowledge graph retrieval module 402 corresponds to step S200, and the knowledge joint reasoning module 403 corresponds to step S300. Each module's implementation details are elaborated through steps S110 to S150, S210 to S290, and S310 to S340. Compared to schemes that rely solely on text fragment retrieval, this device explicitly utilizes chapter-level, heterogeneous knowledge carriers, path-level neural network scoring, and large language model reasoning capabilities, thereby improving the accuracy and interpretability of answers in technical document question answering.

[0147] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6As shown, the electronic device may include: a processor 601, a communication interface 602, a memory 603, and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other via the communication bus 604. The processor 601 can call logical instructions in the memory 603 to execute a graph retrieval enhancement generation method, which includes: The process involves acquiring the technical document to be processed, performing chapter-level parsing and determining the semantic scope of the document, dividing it into multiple types of knowledge units within the semantic scope, constructing knowledge subgraphs corresponding to the multiple types of knowledge units, and performing cross-chapter entity fusion and heterogeneous knowledge alignment on the knowledge subgraphs to obtain a document-level heterogeneous knowledge graph. Get the user query, determine the query anchor and candidate retrieval path in the document-level heterogeneous knowledge graph based on the user query, adjust and optimize the candidate retrieval path to obtain the target path, and perform retrieval according to the target path to obtain the target retrieval result; Based on the user's query, the target search results are grouped into knowledge groups, local conclusions within groups are summarized, and joint reasoning is performed between groups to generate the target answer and the source basis corresponding to the target answer.

[0148] Furthermore, the logical instructions in the aforementioned memory 603 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A graph retrieval enhancement generation method, characterized in that, include: The process involves acquiring a technical document to be processed, performing chapter-level parsing on the document and determining its semantic scope, dividing the document into multiple types of knowledge units within the semantic scope, constructing knowledge subgraphs corresponding to the multiple types of knowledge units, and performing cross-chapter entity fusion and heterogeneous knowledge alignment on the knowledge subgraphs to obtain a document-level heterogeneous knowledge graph. Obtain user queries, determine query anchors and candidate retrieval paths in the document-level heterogeneous knowledge graph based on the user queries, adjust and optimize the candidate retrieval paths to obtain target paths, and perform retrieval according to the target paths to obtain target retrieval results; Based on the user query, the target retrieval results are grouped into knowledge groups, local conclusions within groups are summarized, and joint reasoning is performed between groups to generate the target answer and the source basis corresponding to the target answer.

2. The graph retrieval enhancement generation method according to claim 1, characterized in that, The process involves acquiring a technical document to be processed, performing chapter-level parsing on the document, determining its semantic scope, dividing it into multiple knowledge units within the semantic scope, and constructing knowledge subgraphs corresponding to each knowledge unit, including: Identify the chapter titles, title levels, title numbers, title positions, and hierarchical relationships between titles in the document to be processed, and construct the chapter hierarchy structure; The semantic scope of each chapter is determined based on the chapter hierarchy structure. Within the semantic scope, at least two types of knowledge units are divided into textual knowledge units, tabular knowledge units, and code knowledge units. Knowledge extraction and unified modeling are performed on the various types of knowledge units respectively to obtain knowledge subgraphs corresponding to different types of knowledge units.

3. The graph retrieval enhancement generation method according to claim 2, characterized in that, The knowledge extraction and unified modeling of the various types of knowledge units include: Entities and entity relationships are extracted from the text knowledge units to obtain text knowledge subgraphs; Structured attributes, attribute values, and corresponding relationships are extracted from the tabular knowledge units to obtain tabular knowledge subgraphs; Semantic objects, parameter relationships, return relationships, and call relationships are extracted from the code knowledge units to obtain a code knowledge subgraph; Preserve the source mapping relationship between the graph facts in each knowledge subgraph and the original source content.

4. The graph retrieval enhancement generation method according to claim 2, characterized in that, Cross-chapter entity fusion and heterogeneous knowledge alignment are performed on the knowledge subgraph to obtain a document-level heterogeneous knowledge graph, including: Based on entity name, semantic representation, context information, and chapter position, entities in different chapters are matched to determine the entities to be merged; The entities to be merged are merged into a unified entity node, and the mapping relationship between the unified entity node and the original chapter and source content is retained; Based on the entity correspondence or semantic association between the text knowledge units, the table knowledge units, and the code knowledge units, establish cross-type knowledge relationships; The document-level heterogeneous knowledge graph is obtained based on the unified entity node, the cross-type knowledge relationship, and the knowledge subgraph.

5. The graph retrieval enhancement generation method according to claim 1, characterized in that, Obtain user queries, determine query anchors and candidate retrieval paths in the document-level heterogeneous knowledge graph based on the user queries, adjust and optimize the candidate retrieval paths to obtain the target path, including: Entity identification is performed on the user query to obtain candidate query entities; The query anchor is determined based on the name similarity, semantic similarity, and context matching relationship between the candidate query entity and the entity nodes in the document-level heterogeneous knowledge graph; the query anchor is determined by a domain text embedding encoder. Candidate search paths are generated starting from the query anchor point; The pre-trained path scoring model is invoked to determine the path score between the candidate retrieval path and the user query. The candidate retrieval paths are dynamically expanded, filtered, and pruned based on the path scores to obtain the target path.

6. The graph retrieval enhancement generation method according to claim 5, characterized in that, The path scoring model is trained using path-level weakly supervised signals; The path-level weak supervision signal is constructed based on the source mapping relationship between the supporting statements corresponding to the training query and the graph facts in the document-level heterogeneous knowledge graph. The positive and negative sample paths are determined using the path-level weak supervision signal, and the path scoring model is trained using the training query, the positive sample paths, and the negative sample paths.

7. The graph retrieval enhancement generation method according to claim 5, characterized in that, The candidate retrieval paths are dynamically expanded, filtered, and pruned based on the path scores to obtain the target path, including: Based on the path score of the candidate retrieval paths in the current round, retain the candidate retrieval paths that meet the preset conditions; The retained candidate retrieval paths are expanded by adjacency to obtain the next round of candidate retrieval paths; Candidate search paths that do not meet the preset conditions, are duplicates of existing paths, or have reached the stopping condition are deleted, and the remaining candidate search paths are the target paths.

8. The graph retrieval enhancement generation method according to claim 5, characterized in that, Based on the user query, the target retrieval results are grouped into knowledge groups, local conclusions are summarized within each group, and joint reasoning is performed between groups to generate the target answer and the source evidence corresponding to the target answer, including: Determine the target response based on the user query; Based on the answer objective, the target retrieval results are grouped into knowledge groups, and the target paths, graph facts and source content that jointly support the same answer objective or the same semantic aspect are divided into the same knowledge group; For each knowledge group, local conclusions are summarized within the group to obtain the corresponding local conclusions. Based on the semantic, entity, or reasoning dependencies between different knowledge groups, joint reasoning is performed on multiple local conclusions to generate the target answer and its source basis.

9. A graph retrieval enhancement generation device, characterized in that, include: The heterogeneous knowledge graph construction module is used to acquire the technical document to be processed, perform chapter-level parsing on the technical document to be processed and determine the semantic scope, divide the document into multiple types of knowledge units within the semantic scope, construct knowledge subgraphs corresponding to the multiple types of knowledge units, and perform cross-chapter entity fusion and heterogeneous knowledge alignment on the knowledge subgraphs to obtain a document-level heterogeneous knowledge graph. The graph dynamic retrieval module is used to obtain user queries, determine query anchors and candidate retrieval paths in the document-level heterogeneous knowledge graph based on the user queries, adjust and optimize the candidate retrieval paths to obtain the target path, and perform retrieval according to the target path to obtain the target retrieval results. The knowledge joint reasoning module is used to perform knowledge grouping, intra-group local conclusion summarization, and inter-group joint reasoning on the target retrieval results based on the user query, and generate the target answer and the source basis corresponding to the target answer.

10. An electronic 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 program, it implements the graph retrieval enhancement generation method as described in any one of claims 1 to 8.