Method and system for retrieval enhancement generation based on hierarchical tree index
Patent Information
- Application Number
- CN202610845892.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-12
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]本发明针对招生政策问答场景中结构化业务数据与非结构化文档数据并存、现有检索增强生成方法难以在同一知识组织框架内完成统一检索、且难以依据年份、学院、专业及业务意图快速定位目标条款节点的问题,本发明的目的是提供一种基于层级树索引的检索增强生成系统及方法,能够基于已有资料对答案进行支撑,从而减少模型脱离事实进行生成的情况,提高回答的准确性和可追溯性
通过构建面向招生政策领域的统一层级树索引,完整保留了原始知识中“年份/学院/专业/字段/章节”等多级业务语义结构,结合业务实体驱动的路径跳转与多条件剪枝搜索机制,显著提升了目标内容的定位精度。由于证据上下文严格限定于同一树路径下的语义一致节点,避免了跨章节、跨年份、跨学院片段混合导致的逻辑矛盾,降低了生成回答中的事实性错误率;此外,通过树瘦身机制减少无效中间节点,并结合路径跳转与剪枝策略降低平均搜索,有效优化了资源利用效率。
Smart Images

Figure CN122594409A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information retrieval technology, specifically to a retrieval enhancement generation method and system based on hierarchical tree index. Background Technology
[0002] In current applications of intelligent question answering and retrieval-augmented generation (RAG) technologies, traditional methods for policy-related knowledge bases with strong hierarchical semantic structures (such as college admissions, transfer applications, and re-examinations) typically involve segmenting documents into fixed-length text blocks and constructing vector indexes for retrieval. While this approach leverages the semantic understanding capabilities of large language models, it lacks explicit modeling of the original document's hierarchical structure (e.g., multi-level business dimensions such as "year—college—major—chapter—field"), leading to a disconnect between the hierarchical logic of titles, clause content, and their applicable scope. This results in issues such as false recalls, positioning bias, and untraceable evidence. Especially when collaboratively retrieving cross-source heterogeneous data (such as structured database records and unstructured PDF announcements), existing technologies struggle to uniformly organize field-level and chapter-level knowledge within the same semantic framework, limiting the accuracy and compliance of the question answering system.
[0003] To address these challenges, several patents in recent years have proposed improved solutions based on tree structures or metadata-driven approaches. However, existing technologies still have significant limitations: First, most solutions focus only on a single type of data (purely unstructured documents or purely structured tables), failing to effectively integrate structured field records and unstructured chapter content into a unified indexing system. This results in the inability to coordinate the location of data in complex queries that require simultaneous reference to database fields (e.g., "the number of transfer places for a certain major in 2024") and policy document clauses (e.g., "Article 5 of Chapter 3 of the Transfer Regulations"). Second, although some solutions introduce tree structures, their construction process does not strictly follow the pre-defined hierarchical relationships of the business dimension (e.g., topic → year → college → major), and lacks explicit path jumps and layer-by-layer pruning mechanisms driven by both the question intent and entity identifiers. This causes the retrieval process to still rely excessively on end-to-end semantic matching, making it difficult to achieve accurate and interpretable scope narrowing. Finally, existing methods generally do not embed the structured identifiers of the retrieval evidence (e.g., node IDs, scope tags) into the prompt template during the generation stage, resulting in a lack of clear citation sources in the generated results, affecting the credibility of the answers and compliance audit capabilities.
[0004] Therefore, there is an urgent need for a retrieval enhancement generation method that can deeply integrate heterogeneous knowledge sources, explicitly model business levels, and support precise positioning driven by both intent and entity, in order to solve the problem of accurate question answering in high-constraint scenarios such as enrollment policies. Summary of the Invention
[0005] This invention addresses the challenges of coexisting structured business data and unstructured document data in enrollment policy Q&A scenarios, the difficulty of existing retrieval enhancement generation methods to achieve unified retrieval within the same knowledge organization framework, and the difficulty of quickly locating target clause nodes based on year, college, major, and business intent. The purpose of this invention is to provide a retrieval enhancement generation system and method based on hierarchical tree indexing, which can support answers based on existing data, thereby reducing the situation where the model is generated without considering the facts, and improving the accuracy and traceability of the answers.
[0006] To achieve the above objectives, the present invention adopts the following technical solution.
[0007] The first aspect of this invention provides a retrieval enhancement generation method based on a hierarchical tree index, comprising: Obtain structured and unstructured data from the target domain, extract entity identifiers from the structured and unstructured data based on a preset business dimension hierarchy, map structured data records in the structured data to field leaf nodes, and map document content in the unstructured data to chapter leaf nodes. When the structured data record and the document content have the same entity identifier, the corresponding field leaf node and chapter leaf node are attached to the corresponding non-leaf node branch in the same hierarchical tree index to obtain a hierarchical tree index that integrates heterogeneous knowledge sources. For each node in the hierarchical tree index, construct a structured representation including node identifier, node title, node summary, range identifier, and parent-child relationship; In response to a user query request, the system performs keyword extraction, entity recognition, and question intent recognition on the query request to obtain query analysis results containing question intent, entity identifiers, and keywords. Based on the query analysis results, the system performs question intent-driven path navigation and entity identifier-guided layer-by-layer positioning on the hierarchical tree index, and performs pruning search on candidate branches based on node titles, node summaries, and range identifiers matched with keywords to obtain tree search results composed of target leaf nodes. Based on the tree search results, extract the content of the target leaf node and the node identifier and range identifier in its structured representation, and assemble them to generate an evidence context with node identifier and range identifier; The evidence context and the user query request are assembled into a generation prompt according to a preset structured template. The generation model is called to generate the answer result, and the node identifier and range identifier corresponding to the referenced target leaf node are appended to the answer result.
[0008] As an optional implementation, the acquisition of structured and unstructured data in the target domain includes: Collect structured and unstructured data from the target domain, and let the heterogeneous knowledge source set be: ; in, Represents a structured data set. Represents an unstructured data set; the structured data set This should include at least the following data: transfer policy data, admission policy data, equivalent academic qualification examination data, admission data for Hong Kong, Macao and Taiwan students, re-examination admission data, frequently asked questions data, and transfer requirements data, namely: ; in, This indicates data related to the adjustment policy. This indicates data on enrollment policies. This represents data from an equivalent academic ability test. This indicates enrollment data from Hong Kong, Macau, and Taiwan. This represents the data for the re-examination and admission process. This represents data related to common problems. This indicates the data required for adjustment.
[0009] As an optional implementation, mapping structured data records in structured data to field leaf nodes and mapping document content in unstructured data to chapter leaf nodes includes: For structured data records, they are mapped to nodes in a hierarchical tree index according to the path rule of "business theme node - year node - college node - major node - field name node"; For unstructured data, it is mapped to nodes in the hierarchical tree index according to the path rule of "business theme node - year node or college node - title level node - chapter content node".
[0010] As an optional implementation, when the structured data record and the document content have the same entity identifier, the corresponding field leaf node and chapter leaf node are attached to the corresponding non-leaf node branch in the same hierarchical tree index to obtain a hierarchical tree index that integrates heterogeneous knowledge sources, including: When structured data records and unstructured document content have the same entity identifier in terms of business theme, year, college, or major, they are linked to the same parent path to form a unified hierarchical tree index that contains both structured and unstructured knowledge.
[0011] As an optional implementation, a hierarchical tree index is constructed based on the topic relationships and hierarchical relationships of heterogeneous knowledge sources. Let the hierarchical tree index be represented as: ; in, Represents a set of nodes. Represents the set of parent-child relationships between nodes; Node set It is divided into root node, topic node, intermediate nodes, and leaf nodes, that is: ; in, Represents the root node. Represents a set of topic nodes. Represents the set of intermediate nodes. This represents the set of leaf nodes; the topic nodes include at least the adjustment information node, the enrollment policy node, the re-examination information node, the equivalent academic ability information node, the Hong Kong, Macao and Taiwan enrollment information node, and the frequently asked questions node.
[0012] As an optional implementation, constructing a structured representation for each node in the hierarchical tree index, including node identifier, node title, node summary, range identifier, and parent-child relationship, includes: Set nodes The attribute is represented as: ; in, Indicates node identifier, Indicates the node title. Represents a node summary. Indicates the range identifier, Indicates the parent node identifier. Represents the set of child node identifiers; After constructing a structured representation of each node in the hierarchical tree index, including node identifier, node title, node summary, range identifier, and parent-child relationship, the method further includes: Tree slimming processing is performed on non-leaf nodes in the hierarchical tree index that meet the preset slimming conditions; the preset slimming conditions include at least: the node does not contain the preset entity identifier and its number of child nodes is less than a preset number threshold; When the preset slimming conditions are met, the content of the child nodes of the non-leaf node is merged into its parent node, the range identifier and the node summary of the parent node are updated, and the non-leaf node is deleted.
[0013] As an optional implementation, based on the query analysis results, the process involves performing question intent-driven path navigation and entity identifier-guided layer-by-layer positioning on the hierarchical tree index, and performing pruning search on candidate branches based on node titles, node summaries, and keyword matching to obtain a tree search result composed of target leaf nodes, including: When the question's intent falls under one of the following categories: transfer application, re-examination, admission policy, equivalent academic qualifications, Hong Kong, Macao and Taiwan, or common questions, first jump directly to the corresponding topic node based on the question's intent; When a year entity is identified, only the year node branch corresponding to that year is retained; When a college entity is identified, only the college node branch corresponding to that college is retained; When a professional entity is identified, only the intermediate node branches corresponding to that professional or professional category are retained; When multiple entities are identified simultaneously, the candidate path set is obtained by filtering through the intersection of the nodes in the order of "topic node - year node - college node - major node". If no specific year entity, college entity, or major entity is identified, the process begins with the topic node and proceeds downwards layer by layer. At each layer, the node is filtered based on the matching of the node title, node summary, node range identifier, and query keywords. Nodes that meet the preset matching conditions are retained and moved to the next layer, thereby locating candidate leaf nodes layer by layer. The node pruning conditions in the tree search process include at least one of the following: the node title or node summary does not contain the core entity in the query; the business theme to which the node belongs is inconsistent with the query intent; the node coverage is inconsistent with the year, college, major or business category identified in the current query; the number of matching nodes with query keywords is lower than a preset matching threshold; the node branch that meets any pruning condition will no longer expand downwards. Continue traversing down to the leaf nodes for all unpruned node branches, and summarize to obtain a candidate leaf node set; sort the candidate leaf node set according to the semantic similarity with the user query, and retain the preset number of leaf nodes with the highest relevance as target leaf nodes to form a tree search result.
[0014] As an optional implementation, the step of extracting the content of the target leaf node and its node identifier and range identifier from its structured representation based on the tree search results, and assembling to generate an evidence context with node identifiers and range identifiers, includes: Traverse each target leaf node in the tree search results; Extract the original content of each target leaf node; Extract the node identifier, node title, and scope identifier from the structured representation of each target leaf node; The content of each target leaf node is bound to its corresponding node identifier, node title, and range identifier to generate a structured evidence unit; All structured evidence units are sorted from high to low relevance to the user query and assembled into an evidence context with node and range identifiers. After constructing a structured representation of each node in the hierarchical tree index, including node identifier, node title, node summary, range identifier, and parent-child relationship, the method further includes: Tree slimming processing is performed on non-leaf nodes in the hierarchical tree index that meet the preset slimming conditions; the preset slimming conditions include: the node does not contain the preset entity identifier and the number of its child nodes is less than a preset number threshold; When the preset slimming conditions are met, the content of the child nodes of the non-leaf node is merged into its parent node, the range identifier and the node summary of the parent node are updated, and the non-leaf node is deleted.
[0015] As an optional implementation, assembling the evidence context and the user query request into a generated prompt according to a preset structured template includes: The generated prompt includes at least a task description area, a user question area, an evidence node area, and an output constraint area; each piece of evidence in the evidence node area is represented in the following structured format: ; in, Indicates the tree node identifier. Indicates the node title. Indicates a field range, chapter range, or page number range. Indicates the content of the node; The generated prompt requires the generation model to answer the user's question based on the evidence node area, and to include the node identifier and range identifier corresponding to the cited evidence in the answer result.
[0016] A second aspect of the present invention provides a retrieval enhancement generation system based on a hierarchical tree index, which is based on the retrieval enhancement generation method based on the hierarchical tree index described in the first aspect of the present invention, comprising: The mapping module is used to acquire at least structured and unstructured data in the target domain, extract entity identifiers from the structured and unstructured data according to the preset business dimension hierarchy, map structured data records in the structured data to field leaf nodes, and map document content in the unstructured data to chapter leaf nodes. The index attaching module is used at least to attach the corresponding field leaf node and chapter leaf node to the corresponding non-leaf node branch in the same hierarchical tree index when the structured data record and the document content have the same entity identifier, so as to obtain a hierarchical tree index that integrates heterogeneous knowledge sources. The structured representation module is used at least to construct a structured representation for each node in the hierarchical tree index, including node identifier, node title, node summary, range identifier, and parent-child relationship. The response search module is at least used to respond to user query requests, extract keywords, identify entities, and identify question intent in the query requests to obtain query analysis results containing question intent, entity identifiers, and keywords; based on the query analysis results, it performs question intent-driven path jumping and entity identifier-guided layer-by-layer positioning on the hierarchical tree index, and performs pruning search on candidate branches based on node titles, node summaries, and keyword matching to obtain tree search results composed of target leaf nodes; The context generation module is at least used to extract the content of the target leaf node and the node identifier and range identifier in its structured representation based on the tree search results, and assemble and generate an evidence context with node identifier and range identifier; The result answer module is at least used to assemble the evidence context and the user query request into a generation prompt according to a preset structured template, call the generation model to generate the answer result, and attach the node identifier and range identifier corresponding to the referenced target leaf node to the answer result.
[0017] This invention has at least the following technical effects: By constructing a unified hierarchical tree index for the enrollment policy domain, the multi-level business semantic structure of "year / college / major / field / chapter" in the original knowledge is fully preserved. Combined with business entity-driven path jumps and multi-condition pruning search mechanisms, the positioning accuracy of target content is significantly improved. Since the evidence context is strictly limited to semantically consistent nodes under the same tree path, logical contradictions caused by mixing fragments across chapters, years, and colleges are avoided, reducing the factual error rate in generated answers. In addition, by reducing invalid intermediate nodes through tree slimming mechanisms and combining path jumps and pruning strategies to reduce average search, resource utilization efficiency is effectively optimized. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of a retrieval enhancement generation method based on a hierarchical tree index, according to a specific embodiment of the present invention.
[0020] Figure 2 This is a flowchart illustrating a retrieval enhancement generation system based on a hierarchical tree index in a specific embodiment of the present invention.
[0021] Figure 3This is a roadmap of document organization and retrieval matching technology based on hierarchical tree indexing, according to a specific embodiment of the present invention.
[0022] Figure 4 This is a diagram of a query-driven tree search and node location mechanism according to a specific embodiment of the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Furthermore, it should be understood that the specific embodiments described herein are only for illustration and explanation of this application and are not intended to limit this application.
[0024] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments of this application. Furthermore, the descriptions of each embodiment in the following embodiments have their own emphasis; for parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0025] like Figure 1 and Figure 2 As shown, the first aspect of the present invention provides a retrieval enhancement generation method based on a hierarchical tree index, which mainly includes the following contents.
[0026] Step S100: Knowledge Source Acquisition and Preprocessing. Acquire structured and unstructured data from the target domain, and perform field cleaning, text standardization, and knowledge unit extraction on the data.
[0027] For example, structured data includes at least data on transfer policies, admission policies, equivalent academic ability examinations, admissions data for Hong Kong, Macao and Taiwan, re-examination admissions data, frequently asked questions data and transfer requirements data, while unstructured data includes at least documents such as admission brochures, policy interpretation documents, Q&A manuals, college instructions, rule notices, policy announcements and Q&A materials.
[0028] Specifically, knowledge unit extraction is performed on the field content of structured data, including: for data on transfer requirements, at least the following fields should be extracted: transfer requirements, preliminary examination requirements, research direction, transfer quota, college contact information, supplementary instructions, and majors offered, forming a basic field set: {Requirements for transfer admission, initial examination requirements, research directions, transfer quotas, college contact information, supplementary information, and majors offered}, among which... Indicates the first The strip adjustment requires the record to contain the corresponding set of fields.
[0029] Step S200: Heterogeneous Knowledge Unified Tree Mapping and Hierarchical Tree Index Construction Steps. Based on the preset business dimension hierarchical relationship, entity identifiers are extracted from the structured and unstructured data. Structured data records in the structured data are mapped to field leaf nodes, and document content in the unstructured data is mapped to chapter leaf nodes. The preset business dimension hierarchical relationship includes the topic relationship, hierarchical relationship, and field affiliation relationship of the knowledge source. When the structured data record and the document content have the same entity identifier, the corresponding field leaf node and chapter leaf node are attached to the corresponding non-leaf node branch in the same hierarchical tree index, resulting in a hierarchical tree index that integrates heterogeneous knowledge sources. The hierarchical tree index includes topic nodes, intermediate nodes, and leaf nodes.
[0030] For example, for each business record (structured data record) in structured data, it is mapped to a field leaf node in the hierarchical tree index according to the path rule of "business theme node - year node - college node - major node - field name node"; for unstructured data, it is mapped to a chapter leaf node according to the path rule of "business theme node - year node or college node - title level node - chapter content node"; during the mapping process, entity identifiers in the business theme, year, college or major dimensions are extracted from the structured data and unstructured data.
[0031] Step S300: Node structured representation step. Construct a structured representation for each node in the hierarchical tree index, including node identifier, node title, node summary, range identifier, and parent-child relationship.
[0032] Step S400: Query parsing and path jump tree search. Responding to the user's query request, the system extracts keywords, identifies entities, and identifies the question intent, obtaining query analysis results containing the question intent, entity identifiers, and keywords. Based on the query analysis results, it performs question intent-driven path jumps and entity identifier-guided layer-by-layer positioning on the hierarchical tree index, and performs pruning search on candidate branches based on node titles, node summaries, and range identifiers matched with keywords, obtaining a tree search result composed of the target leaf nodes.
[0033] Step S500: Evidence Node Determination Step. Based on the tree search results, extract the content of the target leaf node and its node identifier and range identifier from its structured representation, and assemble them to generate an evidence context with node identifier and range identifier.
[0034] Step S600: Controlled generation of answer structure. The evidence context and the user query request are assembled into a generation prompt according to a preset structured template. The generation model is invoked to generate the answer result, and the node identifier and range identifier corresponding to the referenced target leaf node are appended to the answer result.
[0035] This invention organizes target knowledge by constructing a hierarchical tree structure, gradually determines the scope of target nodes through tree search, and then uses the content of the target nodes as evidence to generate the model, thereby improving retrieval accuracy, result interpretability, and answer traceability.
[0036] In one embodiment of the present invention, acquiring structured and unstructured data in the target domain includes: collecting structured and unstructured data in the target domain, wherein the heterogeneous knowledge source set is: ; in, Represents a structured data set. Represents an unstructured data set; the structured data set This should include at least the following data: transfer policy data, admission policy data, equivalent academic qualification examination data, admission data for Hong Kong, Macao and Taiwan students, re-examination admission data, frequently asked questions data, and transfer requirements data, namely: ; in, This indicates data related to the adjustment policy. This indicates data on enrollment policies. This represents data from an equivalent academic ability test. This indicates enrollment data from Hong Kong, Macau, and Taiwan. This represents the data for the re-examination and admission process. This indicates common problems.
[0037] In one embodiment of the present invention, mapping structured data records in structured data to field leaf nodes and mapping document content in unstructured data to chapter leaf nodes includes: For each business record in the structured data, it is mapped to a node in the hierarchical tree index according to the path rule of "business theme node - year node - college node - major node - field name node". Among them, the business theme node is determined by the data table category, the year node is determined by the enrollment year to which the record belongs, the college node is determined by the college name, the major node is determined by the enrollment major or major category, and the field name node is determined by the field names such as transfer requirements, preliminary examination requirements, research direction, transfer quota, college contact information, supplementary instructions and enrollment major. The field value content is used as the leaf node content of the corresponding field name node. For unstructured data, it is mapped to nodes in the hierarchical tree index according to the path rule of "business theme node - year node or college node - title level node - chapter content node"; among them, the title level node is determined by the chapter title or subtitle in the document, and the chapter content node is used to carry the main text content under the corresponding title. When structured data records and unstructured document content have the same entity identifier in terms of business theme, year, college, or major, they are linked to the same parent path to form a unified hierarchical tree index that contains both structured and unstructured knowledge. This allows subsequent retrieval processes to complete node location and evidence organization across data sources within the same tree structure.
[0038] In one embodiment of the present invention, a hierarchical tree index is constructed based on the topic relationships and hierarchical relationships of heterogeneous knowledge sources. Let the hierarchical tree index be represented as: ; in, Represents a set of nodes. Represents the set of parent-child relationships between nodes; Node set It is divided into root node, topic node, intermediate nodes, and leaf nodes, that is: ; in, Represents the root node. Represents a set of topic nodes. Represents the set of intermediate nodes. This represents the set of leaf nodes; the topic nodes include at least the adjustment information node, the enrollment policy node, the re-examination information node, the equivalent academic ability information node, the Hong Kong, Macao and Taiwan enrollment information node, and the frequently asked questions node.
[0039] Furthermore, for each business record in the structured data, it is mapped to a node in the hierarchical tree index according to the path rule of "business theme node - year node - college node - major node - field name node". Among them, the business theme node is determined by the data table category, the year node is determined by the enrollment year to which the record belongs, the college node is determined by the college name, the major node is determined by the enrollment major or major category, and the field name node is determined by the field names such as transfer requirements, preliminary examination requirements, research direction, transfer quota, college contact information, supplementary explanation and enrollment major. The field value content is used as the leaf node content of the corresponding field name node.
[0040] Furthermore, for unstructured document data, it is mapped to nodes in the hierarchical tree index according to the path rule of "business topic node - year node or college node - title level node - chapter content node"; among them, the title level node is determined by the chapter title or subtitle in the document, and the chapter content node is used to carry the main text content under the corresponding title.
[0041] Furthermore, when structured data records and unstructured document content have the same entity identifier in terms of business theme, year, college, or major, they are linked to the same parent path to form a unified hierarchical tree index that contains both structured and unstructured knowledge.
[0042] Furthermore, if the node For nodes If the parent node is: ; E This represents the connecting edges between all nodes in the entire heterogeneous knowledge unified tree; Through the aforementioned parent-child relationship, heterogeneous knowledge sources can be uniformly organized in the manner of "root node - topic node - intermediate node - leaf node", and path jump based on business entities can be realized in the subsequent retrieval process.
[0043] In one embodiment of the present invention, constructing a structured representation for each node in the hierarchical tree index, including node identifier, node title, node summary, range identifier, and parent-child relationship, includes: Set nodes The attribute is represented as: ; in, Indicates node identifier, Indicates the node title. Represents a node summary. Indicates the range identifier, Indicates the parent node identifier. Represents the set of child node identifiers; For leaf nodes, their original field content, original question and answer content, or original clause content are stored; for non-leaf nodes, their summary information or prefix summary information is generated to support layer-by-layer comparison during the tree search phase.
[0044] Here, by establishing node titles, node summaries, range identifiers, and parent-child relationships for each node in the hierarchical tree index, the structured representation of the nodes is used to support the layer-by-layer judgment and node location in the subsequent tree search process.
[0045] Furthermore, for leaf nodes, their original field content, original question and answer content, or original clause content are saved; for non-leaf nodes, their summary information or prefix summary information is generated to support layer-by-layer comparison during the tree search phase.
[0046] Furthermore, if the node text length is lower than a preset threshold, the original node text is used directly as the summary; if the node text length is higher than the preset threshold, the generation model is called to generate a node summary to improve the compactness and readability of the node representation.
[0047] Tree slimming processing is performed on non-leaf nodes in the hierarchical tree index that meet the preset slimming conditions; the preset slimming conditions include at least: the node does not contain the preset entity identifier and its number of child nodes is less than the preset number threshold; when the preset slimming conditions are met, the content of the child nodes of the non-leaf node is merged into its parent node, the range identifier and the node summary of the parent node are updated, and the non-leaf node is deleted.
[0048] Furthermore, tree slimming processing is performed on nodes with information content below a threshold. The criteria for determining that information content is below the threshold include at least one of the following: the original text length of the node is lower than a preset length threshold; the node does not contain a preset business entity, and the business entity includes at least one of year, college, major, exam category, or policy category; the node only serves as a title connector, and the number of its child nodes is lower than a preset number threshold.
[0049] For example, the preset slimming conditions are quantifiable business screening conditions, specifically including: The node does not contain any of the preset business entity identifiers for year, college, or major; The number of child nodes of a node is less than 3; When a non-leaf node meets both of the above conditions, it is determined to be a node that can be reduced in size, and node merging and deletion operations are performed.
[0050] When a node meets the above conditions, the content of its child nodes is merged into its parent node. During the merging process, the parent node's scope identifier is updated to the union of the original parent node's scope identifier and the scope identifier of the merged child node. The parent node's summary is updated to the concatenated summary of the original parent node's summary and the summary of the merged child node, or a newly generated summary summary. The parent node's child node list is updated to the child node list of the merged node. For intermediate nodes that do not carry independent business entities and only play a transitional role, the intermediate node is deleted after the merging is completed, thereby reducing overly fragmented node levels and avoiding hierarchical chaos.
[0051] In one embodiment of the present invention, the process of receiving a user query includes: setting the user's original query as... After standardization, a standardized query is obtained. The system performs keyword extraction, entity recognition, and question intent recognition on user queries. Let the query analysis results be: ; in, Represents a set of keywords. Represents a set of question intents. This indicates the identified entity information, such as the college, major, or year.
[0052] This invention standardizes user queries, extracts keywords, identifies entities, and identifies question intent. Based on the identified business intent and entity information, it performs path jumps and tree searches on the hierarchical tree index. Based on the query analysis results, it performs path jumps, node filtering, and pruning location on the hierarchical tree index.
[0053] Based on the query analysis results, business entity-driven path jumps and tree searches are performed on the hierarchical tree index.
[0054] In one embodiment of the present invention, based on the query analysis results, the process of performing question intent-driven path navigation and entity identifier-guided layer-by-layer positioning on the hierarchical tree index, and performing pruning search on candidate branches based on node titles, node summaries, and keyword matching to obtain a tree search result composed of target leaf nodes includes: When the question's intent falls under one of the following categories: transfer application, re-examination, admission policy, equivalent academic qualifications, Hong Kong, Macao and Taiwan, or common questions, first jump directly to the corresponding topic node based on the question's intent; When a year entity is identified, only the year node branch corresponding to that year is retained; When a college entity is identified, only the college node branch corresponding to that college is retained; When a professional entity is identified, only the intermediate node branches corresponding to that professional or professional category are retained; When multiple entities are identified simultaneously, the candidate path set is obtained by filtering through the intersection of the nodes in the order of "topic node - year node - college node - major node". If no specific year, college, or major entity is identified, the process expands downwards from the topic node, filtering at each level based on the matching of node title, node summary, node range identifier, and query keywords. Nodes that meet the preset matching conditions are retained to advance to the next level, thereby locating candidate leaf nodes layer by layer.
[0055] The preset matching conditions are quantifiable node filtering conditions, specifically including: The node title or node summary contains the core entity in the query; The business theme to which the node belongs is consistent with the intent of the query. The node range identifiers are matched with the year, college, and major entities in the query; The number of nodes that match the query keywords is greater than or equal to a preset threshold (preferably 3). Only nodes that meet all of the above conditions can proceed to the next level of search.
[0056] Correspondingly, the node pruning conditions in the tree search process include at least one of the following: the node title or node summary does not contain the core entity in the query; the business theme to which the node belongs is inconsistent with the query intent; the node coverage is inconsistent with the year, college, major or business category identified in the current query; the number of matching nodes with query keywords is lower than a preset matching threshold; the node branch that meets any pruning condition will no longer expand downwards, so as to narrow the tree search range and improve the accuracy of locating the target leaf node.
[0057] Furthermore, all unpruned node branches are traversed downwards to the leaf nodes, and a candidate leaf node set is obtained. The candidate leaf node set is sorted according to the semantic similarity with the user query, and a preset number of leaf nodes with the highest relevance are retained as target leaf nodes (i.e. evidence nodes) to form a tree search result.
[0058] Once the evidence nodes are determined, the set of target leaf nodes is determined layer by layer based on the tree search results, and an evidence context with node identifiers and range identifiers is generated.
[0059] This invention uses a hierarchical tree index as the knowledge organization skeleton to represent the hierarchical relationship between business topics, years, colleges, majors, field content, and chapter content. It drives tree path jumps and node pruning through the year, college, major, and question intent in the query, avoiding problems such as excessively large positioning range, mixed evidence, and untraceable answers caused by flat recall and indiscriminate traversal of the entire tree. Finally, it constructs an accurate, stable, and traceable retrieval enhancement generation mechanism suitable for enrollment policy Q&A scenarios.
[0060] In one embodiment of the present invention, the step of extracting the content of the target leaf node and its node identifier and range identifier from its structured representation based on the tree search results, and assembling to generate an evidence context with node identifier and range identifier, includes: The candidate node set is determined based on the tree search results. Let the first node be... t The set of candidate nodes after rounds of search is: ; in, ; The candidate node set is filtered layer by layer according to node title, node summary, node range, and query analysis results, retaining the set of nodes most relevant to the user's query. ; Repeat the filtering process until the target set of leaf nodes is obtained: ; in, This represents the final set of leaf nodes that participated in generating the answer; Generate an evidence context set based on the target leaf node set. : , ; in, This indicates the content of the fields, questions and answers, or document fragments corresponding to the leaf nodes; Traverse each target leaf node in the tree search results; Extract the original content of each target leaf node; Extract the node identifier, node title, and scope identifier from the structured representation of each target leaf node; The content of each target leaf node is bound to its corresponding node identifier, node title, and range identifier to generate a structured evidence unit; All structured evidence units are sorted from highest to lowest relevance to the user query and assembled into an evidence context with node and range identifiers.
[0061] In one embodiment of the present invention, assembling the evidence context and the user query request into a generated prompt according to a preset structured template includes: The generated prompt includes at least a task description area, a user question area, an evidence node area, and an output constraint area; each piece of evidence in the evidence node area is represented in the following structured format: ; in, Indicates the tree node identifier. Indicates the node title. Indicates a field range, chapter range, or page number range. Indicates the content of the node; The generated prompt requires the generation model to answer the user's question based on the evidence node area, and to include the node identifier and range identifier corresponding to the cited evidence in the answer result.
[0062] Furthermore, if the evidence context set is empty or insufficient to support the answer, the generation model outputs a message indicating insufficient data or a restrictive expression; if the evidence context set is sufficient, the generation model outputs the answer text and citation identifiers based on the evidence node area.
[0063] Furthermore, the reference identifier includes at least the node identifier and the range identifier of the referenced node, and is appended to the answer result in the form of "node identifier + node title + range identifier" to achieve a one-to-one correspondence between the answer content and the source of the tree node, thereby enhancing the traceability of the answer result.
[0064] In one application scenario of this invention, the query-driven tree search and node location process in this embodiment is as follows: Figure 3 As shown, this process is used to respond to user query requests, complete accurate knowledge positioning in the hierarchical tree index, and generate traceable and enhanced search results. The specific implementation steps are as follows.
[0065] First, responding to the user's query request, the system parses the user-input query text (e.g., the example query "What are the requirements for transfer to the Computer Science Department"). Through three operations—keyword extraction, entity recognition, and question intent recognition—a query analysis result containing question intent, entity identifiers, and keywords is obtained, denoted as A(q). Next, based on the query analysis result, a tree search and layer-by-layer positioning operation is performed on the hierarchical tree index. This process includes the following steps: Root node matching: Starting from the root node of the hierarchical tree index, jump directly to the corresponding topic node branch according to the question intent; Topic Node Filtering: Based on the question intent, topic nodes in the hierarchical tree (such as adjustment information nodes, enrollment policy nodes, etc.) are filtered to match the query intent. Figure 1 Thematic nodes; Intermediate node filtering: Combine the entity information in the query (such as year, college, major entities) to perform intersection filtering on the intermediate nodes under the topic node, and retain only the node branches that match the entity identifier; Leaf node location: Continue traversing downwards for unpruned branches, performing pruning search based on the matching of node title, node summary, scope identifier, and query keywords; the criteria for node matching include node title, node summary, scope identifier, and entity information, and the pruning conditions are as described above (such as inconsistent themes, entity mismatch, insufficient keyword matching, etc.). Node branches that do not meet the conditions will be pruned and will not be expanded further, ultimately locating the target leaf node set consisting of a preset number of leaf nodes with the highest relevance.
[0066] Subsequently, based on the target leaf node set, the original content of each target leaf node, as well as the node identifier, node title, and range identifier in its structured representation, are extracted. The node content is bound with the corresponding identifier information to generate a structured evidence unit. Then, the units are sorted from high to low according to their relevance to the user query and assembled to form an evidence context set with node identifiers and range identifiers. Each evidence unit contains a node identifier, title, range identifier, and content information.
[0067] Finally, the answer generation operation is performed: the evidence context and the user query request are assembled into a generation prompt according to a preset structured template. The generation prompt includes a task description area, a user question area, an evidence node area, and an output constraint area, wherein each piece of evidence in the evidence node area is represented in a structured format; the generation model is called to generate an answer based on the generation prompt, and the node identifier and range identifier corresponding to the referenced target leaf node are added to the answer result to achieve the traceability of the answer result.
[0068] Through the above process, this invention achieves accurate knowledge positioning and traceable retrieval enhancement generation based on hierarchical tree index, ensuring that the answer results are based on heterogeneous knowledge sources in the target domain and can be traced back to specific knowledge nodes.
[0069] Compared with the prior art, the beneficial effects of the present invention include at least the following:
[0070] This invention proposes a heterogeneous knowledge unified treeification method for enrollment policy Q&A scenarios. It can link the field content of structured business data and the chapter content of unstructured documents to the same level tree index according to a unified path rule. This makes knowledge organization no longer limited to a single document tree or a single field set, but forms a unified knowledge structure that simultaneously carries business themes, years, colleges, majors, field content and chapter content, thereby improving the consistency and retrieval of multi-source knowledge organization.
[0071] This invention introduces a path jump and node pruning mechanism based on business intent and entity information during the retrieval phase. It can directly jump to the corresponding topic node or intermediate node branch based on the business intent such as adjustment, re-examination, and enrollment policies identified in the user query, as well as entity information such as year, college, and major. It stops expanding downwards for node branches that do not meet the conditions, thereby avoiding retrieval redundancy caused by full tree traversal and indiscriminate expansion, and improving the efficiency of target leaf node positioning and retrieval accuracy.
[0072] This invention sets tree slimming rules to merge nodes that are insufficient in information, lack business entities, or only serve a transitional role. During the merging process, the scope identifier of the parent node, the node summary, and the list of child nodes are updated synchronously. This reduces the interference of overly fragmented nodes on the retrieval process while maintaining the integrity of the hierarchical relationship, thereby improving the compactness and stability of the hierarchical tree index.
[0073] In the generation stage, this invention adopts an evidence context assembly method with node identifiers and range identifiers. The content of the target leaf node is input into the generation model in a structured form, and the node identifier, node title and range identifier of the referenced node are simultaneously attached to the answer result. This enables the answer content to establish a one-to-one correspondence with the evidence node, thereby enhancing the interpretability, traceability and reliability of the answer result in the application scenario of enrollment policy Q&A.
[0074] like Figure 4 As shown, a second aspect of the present invention provides a retrieval enhancement generation system based on a hierarchical tree index, which is based on the retrieval enhancement generation method based on the hierarchical tree index described in any of the above embodiments, comprising: The mapping module is used to acquire at least structured and unstructured data in the target domain, extract entity identifiers from the structured and unstructured data according to the preset business dimension hierarchy, map structured data records in the structured data to field leaf nodes, and map document content in the unstructured data to chapter leaf nodes. The index attaching module is used at least to attach the corresponding field leaf node and chapter leaf node to the corresponding non-leaf node branch in the same hierarchical tree index when the structured data record and the document content have the same entity identifier, so as to obtain a hierarchical tree index that integrates heterogeneous knowledge sources. The structured representation module is used at least to construct a structured representation for each node in the hierarchical tree index, including node identifier, node title, node summary, range identifier, and parent-child relationship. The response search module is at least used to respond to user query requests, extract keywords, identify entities, and identify question intent in the query requests to obtain query analysis results containing question intent, entity identifiers, and keywords; based on the query analysis results, it performs question intent-driven path jumping and entity identifier-guided layer-by-layer positioning on the hierarchical tree index, and performs pruning search on candidate branches based on node titles, node summaries, and keyword matching to obtain tree search results composed of target leaf nodes; The context generation module is at least used to extract the content of the target leaf node and the node identifier and range identifier in its structured representation based on the tree search results, and assemble and generate an evidence context with node identifier and range identifier; The result answer module is at least used to assemble the evidence context and the user query request into a generation prompt according to a preset structured template, call the generation model to generate the answer result, and attach the node identifier and range identifier corresponding to the referenced target leaf node to the answer result.
[0075] Here, this invention employs a hierarchical tree index as the knowledge organization framework to reflect the hierarchical relationship between target domain knowledge at the business topic layer, year layer, college layer, major layer, field layer, and content layer. By mapping structured data records to field leaf nodes and unstructured documents to chapter leaf nodes, heterogeneous knowledge sources are linked to the same tree path. Simultaneously, based on the business intent, year entity, college entity, and major entity identified in the user query, path jumps and pruning searches are performed on the hierarchical tree index to avoid false recall problems caused by fixed blocks and full tree traversal. Furthermore, the content of the target node is assembled into evidence context according to the node identifier and range identifier, thereby constructing an accurate, stable, and traceable retrieval enhancement generation mechanism.
[0076] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0077] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a system including a processing module or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0078] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. 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. Such 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 retrieval enhancement generation method based on hierarchical tree index, characterized in that, include: Obtain structured and unstructured data from the target domain, extract entity identifiers from the structured and unstructured data based on a preset business dimension hierarchy, map structured data records in the structured data to field leaf nodes, and map document content in the unstructured data to chapter leaf nodes. When the structured data record and the document content have the same entity identifier, the corresponding field leaf node and chapter leaf node are attached to the corresponding non-leaf node branch in the same hierarchical tree index to obtain a hierarchical tree index that integrates heterogeneous knowledge sources. For each node in the hierarchical tree index, construct a structured representation including node identifier, node title, node summary, range identifier, and parent-child relationship; In response to a user's query request, the system performs keyword extraction, entity recognition, and question intent recognition on the query request to obtain query analysis results containing question intent, entity identifiers, and keywords. Based on the query analysis results, the question intent-driven path jump and entity identifier-guided layer-by-layer positioning are performed on the hierarchical tree index, and the candidate branches are pruned based on node title, node summary and range identifier and keyword matching to obtain the tree search results composed of the target leaf nodes. Based on the tree search results, extract the content of the target leaf node and the node identifier and range identifier in its structured representation, and assemble them to generate an evidence context with node identifier and range identifier; The evidence context and the user query request are assembled into a generation prompt according to a preset structured template. The generation model is called to generate the answer result, and the node identifier and range identifier corresponding to the referenced target leaf node are appended to the answer result.
2. The retrieval enhancement generation method based on hierarchical tree index according to claim 1, characterized in that, The acquisition of structured and unstructured data in the target domain includes: Collect structured and unstructured data from the target domain, and let the heterogeneous knowledge source set be: ; in, Represents a structured data set. Represents an unstructured data set; the structured data set This should include at least the following data: transfer policy data, admission policy data, equivalent academic qualification examination data, admission data for Hong Kong, Macao and Taiwan students, re-examination admission data, frequently asked questions data, and transfer requirements data, namely: ; in, This indicates data related to the adjustment policy. This indicates data on enrollment policies. This represents data from an equivalent academic ability test. This indicates enrollment data from Hong Kong, Macau, and Taiwan. This represents the data for the re-examination and admission process. This represents data related to common problems. This indicates the data required for adjustment.
3. The retrieval enhancement generation method based on hierarchical tree index according to claim 1, characterized in that, The process of mapping structured data records in structured data to field leaf nodes and mapping document content in unstructured data to chapter leaf nodes includes: For structured data records, they are mapped to nodes in a hierarchical tree index according to the path rule of "business theme node - year node - college node - major node - field name node"; For unstructured data, it is mapped to nodes in the hierarchical tree index according to the path rule of "business theme node - year node or college node - title level node - chapter content node".
4. The retrieval enhancement generation method based on hierarchical tree index according to claim 3, characterized in that, When the structured data record and the document content have the same entity identifier, the corresponding field leaf node and chapter leaf node are attached to the corresponding non-leaf node branch in the same hierarchical tree index to obtain a hierarchical tree index that integrates heterogeneous knowledge sources, including: When structured data records and unstructured document content have the same entity identifier in terms of business theme, year, college, or major, they are linked to the same parent path to form a unified hierarchical tree index that contains both structured and unstructured knowledge.
5. The retrieval enhancement generation method based on hierarchical tree index according to claim 1, characterized in that, Construct a hierarchical tree index based on the topic and hierarchical relationships of heterogeneous knowledge sources. Let the hierarchical tree index be represented as: ; in, Represents a set of nodes. Represents the set of parent-child relationships between nodes; Node set It is divided into root node, topic node, intermediate nodes, and leaf nodes, that is: ; in, Represents the root node. Represents a set of topic nodes. Represents the set of intermediate nodes. This represents the set of leaf nodes; the topic nodes include at least the adjustment information node, the enrollment policy node, the re-examination information node, the equivalent academic ability information node, the Hong Kong, Macao and Taiwan enrollment information node, and the frequently asked questions node.
6. The retrieval enhancement generation method based on hierarchical tree index according to claim 1, characterized in that, The construction of a structured representation for each node in the hierarchical tree index, including node identifier, node title, node summary, range identifier, and parent-child relationship, includes: Set nodes The attribute is represented as: ; in, Indicates node identifier, Indicates the node title. Represents a node summary. Indicates the range identifier, Indicates the parent node identifier. Represents the set of child node identifiers; After constructing a structured representation of each node in the hierarchical tree index, including node identifier, node title, node summary, range identifier, and parent-child relationship, the method further includes: Tree slimming processing is performed on non-leaf nodes in the hierarchical tree index that meet the preset slimming conditions; the preset slimming conditions include at least: the node does not contain the preset entity identifier and its number of child nodes is less than a preset number threshold; When the preset slimming conditions are met, the content of the child nodes of the non-leaf node is merged into its parent node, the range identifier and the node summary of the parent node are updated, and the non-leaf node is deleted.
7. The retrieval enhancement generation method based on hierarchical tree index according to claim 1, characterized in that, Based on the query analysis results, the process involves performing intent-driven path navigation and entity-identifier-guided layer-by-layer positioning on the hierarchical tree index, and conducting pruning search on candidate branches based on node titles, node summaries, and keyword matching to obtain a tree search result composed of target leaf nodes, including: When the question's intent falls under one of the following categories: transfer application, re-examination, admission policy, equivalent academic qualifications, Hong Kong, Macao and Taiwan, or common questions, first jump directly to the corresponding topic node based on the question's intent; When a year entity is identified, only the year node branch corresponding to that year is retained; When a college entity is identified, only the college node branch corresponding to that college is retained; When a professional entity is identified, only the intermediate node branches corresponding to that professional or professional category are retained; When multiple entities are identified simultaneously, the candidate path set is obtained by filtering through the intersection of the nodes in the order of "topic node - year node - college node - major node". If no specific year entity, college entity, or major entity is identified, the process begins with the topic node and proceeds downwards layer by layer. At each layer, the node is filtered based on the matching of the node title, node summary, node range identifier, and query keywords. Nodes that meet the preset matching conditions are retained and moved to the next layer, thereby locating candidate leaf nodes layer by layer. The node pruning conditions in the tree search process include at least one of the following: the node title or node summary does not contain the core entity in the query; the business theme to which the node belongs is inconsistent with the query intent; the node coverage is inconsistent with the year, college, major or business category identified in the current query; the number of matching nodes with query keywords is lower than a preset matching threshold; the node branch that meets any pruning condition will no longer expand downwards. Continue traversing down to the leaf nodes for all unpruned node branches, and summarize to obtain a candidate leaf node set; sort the candidate leaf node set according to the semantic similarity with the user query, and retain the preset number of leaf nodes with the highest relevance as target leaf nodes to form a tree search result.
8. The retrieval enhancement generation method based on hierarchical tree index according to claim 1, characterized in that, The step of extracting the content of the target leaf node and its node identifier and range identifier from its structured representation based on the tree search results, and assembling it to generate an evidence context with node identifier and range identifier, includes: Traverse each target leaf node in the tree search results; Extract the original content of each target leaf node; Extract the node identifier, node title, and scope identifier from the structured representation of each target leaf node; The content of each target leaf node is bound to its corresponding node identifier, node title, and range identifier to generate a structured evidence unit; All structured evidence units are sorted from highest to lowest relevance to the user query and assembled into an evidence context with node and range identifiers.
9. The retrieval enhancement generation method based on hierarchical tree index according to claim 1, characterized in that, The step of assembling the evidence context and the user query request into a generated prompt according to a preset structured template includes: The generated prompt includes at least a task description area, a user question area, an evidence node area, and an output constraint area; each piece of evidence in the evidence node area is represented in the following structured format: ; in, Indicates the tree node identifier. Indicates the node title. Indicates a field range, chapter range, or page number range. Indicates the content of the node; The generated prompt requires the generation model to answer the user's question based on the evidence node area, and to include the node identifier and range identifier corresponding to the cited evidence in the answer result.
10. A retrieval enhancement generation system based on a hierarchical tree index, according to any one of claims 1 to 9, characterized in that, include: The mapping module is used to acquire at least structured and unstructured data in the target domain, extract entity identifiers from the structured and unstructured data according to the preset business dimension hierarchy, map structured data records in the structured data to field leaf nodes, and map document content in the unstructured data to chapter leaf nodes. The index attaching module is used at least to attach the corresponding field leaf node and chapter leaf node to the corresponding non-leaf node branch in the same hierarchical tree index when the structured data record and the document content have the same entity identifier, so as to obtain a hierarchical tree index that integrates heterogeneous knowledge sources. The structured representation module is used at least to construct a structured representation for each node in the hierarchical tree index, including node identifier, node title, node summary, range identifier, and parent-child relationship. The response search module is at least used to respond to user query requests, perform keyword extraction, entity recognition, and question intent recognition on the query requests, and obtain query analysis results containing question intent, entity identifiers, and keywords; Based on the query analysis results, the question intent-driven path jump and entity identifier-guided layer-by-layer positioning are performed on the hierarchical tree index, and the candidate branches are pruned based on node title, node summary and range identifier and keyword matching to obtain the tree search results composed of the target leaf nodes. The context generation module is at least used to extract the content of the target leaf node and the node identifier and range identifier in its structured representation based on the tree search results, and assemble and generate an evidence context with node identifier and range identifier; The result answer module is at least used to assemble the evidence context and the user query request into a generation prompt according to a preset structured template, call the generation model to generate the answer result, and attach the node identifier and range identifier corresponding to the referenced target leaf node to the answer result.