A boiler design document retrieval method and system based on packet reordering
Patent Information
- Application Number
- CN202610911166.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-23
- Publication Date
- 2026-10-30
AI Technical Summary
这导致最终排序靠前的结果可能只是从不同角度重复相同的信息,而忽略了其他可能同样相关但主题或角度不同的重要信息
[0016]有益效果:本公开提供的一种基于分组重排序的锅炉设计文档检索方法及系统,通过对粗召回候选文档片段进行层次聚类并按与查询的相关度按比例分配各语义簇的待选名额,进而在每个簇内采用大语言模型进行迭代分组比较,使每个候选片段参与多次组内相对排序并计算其平均排名以选出各簇中最优片段,最后将来自不同语义簇的最佳片段汇集并进行全局精细排序,从而在排序过程中引入了候选间的相对比较机制并保证了结果的语义多样性,达到了显著提升检索排序准确性、增强结果信息覆盖广度、充分发挥大语言模型上下文理解能力以及有效改善下游检索增强生成整体输出质量。
Smart Images

Figure CN123012163A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of information retrieval and natural language processing, and in particular to a method and system for retrieving boiler design documents based on grouping and reordering. Background Technology
[0002] In Retrieval Augmentation (RAG) applications targeting specialized fields such as boiler design, a two-stage retrieval strategy of "coarse recall + re-ranking" is typically employed to balance retrieval efficiency and accuracy. The coarse recall stage utilizes an efficient dual-tower model to quickly filter hundreds of potentially relevant candidate document fragments from a large-scale document database. However, these initial recall results require further fine-tuning and ranking using a re-ranking model to determine the few most relevant contexts ultimately provided to the generative model.
[0003] Currently, the mainstream reranking method is point-wise reranking. The core idea of this model is to independently evaluate the relevance of each candidate document fragment to the user query, calculate an absolute relevance score for each fragment, and finally rank them according to their scores. However, this method has two significant drawbacks. First, in terms of accuracy, because the scoring of each candidate fragment is independent, the model cannot directly compare the relative merits of different candidate results during the ranking process. This lack of a relative comparison mechanism makes it difficult for the model to distinguish subtle differences when dealing with semantically similar or ambiguous relevance judgment boundaries, thus affecting the final ranking accuracy.
[0004] Secondly, regarding diversity, point ranking models tend to recall candidate results with highly similar content. When multiple candidate document fragments contain the core keywords of the query or are highly semantically overlapping, point ranking models may assign them similar high scores. This results in top-ranked results potentially simply repeating the same information from different perspectives, while ignoring other important information that may be equally relevant but with different themes or angles. This homogenization of results reduces the breadth of information coverage and practical value of the retrieval system, failing to provide users or downstream generative models with comprehensive, multi-dimensional contextual information.
[0005] Therefore, designing a re-ranking method that can effectively compare the relative merits of candidate documents and improve the diversity of search results is a key technical challenge for improving the performance of RAG systems in complex scenarios such as boiler design documents. Summary of the Invention
[0006] A first aspect of this disclosure provides a boiler design document retrieval method based on grouping and reordering, which includes the following steps after obtaining a set of candidate document fragments generated by the coarse recall stage: S1: Perform bottom-up hierarchical clustering on the semantic vectors of all candidate document fragments to construct a binary clustering tree, and allocate the number of candidate samples to each branch of the clustering tree in a top-down proportion based on the similarity between the semantic center of each cluster and the user query vector. S2: For each cluster that has been assigned a candidate slot, an iterative grouping comparison strategy based on a large language model is used to accurately select the most relevant fragments, including: grouping the candidate fragments within the cluster, inputting a group of candidate fragments along with the user query into the large language model each time to obtain the relative ranking within the group, recording the ranking in each comparison by having each fragment participate in multiple comparisons of different groups, calculating the average ranking of each fragment, and selecting the candidate fragment with the highest average ranking. S3: The candidate segments with the highest average ranking selected from each cluster are aggregated to form the final candidate set. The final candidate set is then input into the large language model for global sorting to generate the final ordered search result list.
[0007] In conjunction with the first aspect, the hierarchical clustering specifically includes: initializing each candidate document fragment as an independent cluster, and then iteratively merging the two clusters with the highest cosine similarity until all candidate fragments are merged into the same root node to form a complete binary clustering tree.
[0008] In conjunction with the first aspect, based on the similarity between the semantic center of each cluster and the user query vector, the number of candidate samples is allocated proportionally to each branch from top to bottom, specifically including: Starting from the root node, for any node that needs to be selected... Nodes of a sample Its left and right child nodes are respectively and Candidate slots are allocated proportionally based on the cosine similarity between the left and right subclusters and the query vector, with the left subcluster receiving a certain number of slots. , Right subcluster allocation quota The allocation process is then recursively executed until the number of candidate nodes allocated to a node is 1.
[0009] In conjunction with the first aspect, the candidate segments within the cluster are grouped. Each time, a group of candidate segments is input into the large language model along with the user query to obtain the relative ranking within the group. Each candidate segment needs to participate in at least a preset threshold d comparisons. During each comparison, b candidate segments with the fewest comparisons are selected from the current cluster to form a ranking group, where b is the number of segments that the large language model can effectively rank in a single time.
[0010] In conjunction with the first aspect, the calculation of the average rank of each segment is as follows: For any candidate segment within the cluster Its average ranking ,in For the set of ranking records of the segment across all participating comparisons, select the candidate segment with the smallest average ranking as the representative of the cluster.
[0011] In conjunction with the first aspect, the number of the final candidate sets formed by aggregating the candidate fragments with the highest average ranking selected from each cluster is m, where m ranges from 10 to 20.
[0012] In conjunction with the first aspect, the candidate document fragments are document fragments in the fields of boiler design, manufacturing, or operation and maintenance.
[0013] A second aspect of this disclosure provides a boiler design document retrieval system based on group reordering, comprising: The coarse recall module is used to quickly filter out a set of candidate document fragments from the document library; The hierarchical clustering module is used to perform bottom-up hierarchical clustering on the semantic vectors of all candidate document fragments, construct a binary clustering tree, and allocate the number of candidate samples to each branch in a top-down proportion based on the similarity between the semantic center of each cluster and the user query vector. The intra-cluster grouping and sorting module is used to select the most relevant segments for each cluster that has been assigned a number of candidate segments by using an iterative grouping and comparison strategy based on a large language model. This includes grouping candidate segments within the cluster and inputting them into the large language model to obtain the relative ranking within the group, recording the ranking of each segment in multiple comparisons and calculating the average ranking, and selecting the segment with the highest average ranking. The global aggregation module is used to aggregate the best fragments selected from each cluster and input them into the large language model for a global fine-grained sorting, generating a final ordered list of search results.
[0014] A third aspect of this disclosure provides an electronic device comprising: One or more processors; A storage unit for storing one or more programs that, when executed by one or more processors, enable the one or more processors to implement the method.
[0015] A fourth aspect of this disclosure provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method.
[0016] Beneficial Effects: This disclosure provides a boiler design document retrieval method and system based on grouping and reordering. By hierarchically clustering coarsely recalled candidate document fragments and allocating candidate fragments to each semantic cluster proportionally according to their relevance to the query, iterative grouping comparison is performed within each cluster using a large language model. This allows each candidate fragment to participate in multiple relative rankings within the group, and its average ranking is calculated to select the optimal fragment in each cluster. Finally, the best fragments from different semantic clusters are aggregated and globally fine-ranked. This introduces a relative comparison mechanism between candidates during the ranking process and ensures the semantic diversity of the results. It significantly improves the accuracy of retrieval ranking, enhances the breadth of information coverage in the results, fully leverages the contextual understanding capabilities of the large language model, and effectively improves the overall output quality of downstream retrieval enhancement generation. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating a boiler design document retrieval method based on group reordering according to an embodiment of this disclosure; Figure 2 This is a schematic diagram of the structure of a boiler design document retrieval system based on group reordering, according to an embodiment of this disclosure. Figure 3 An electronic device according to an embodiment of this disclosure. Detailed Implementation
[0018] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those disclosed herein.
[0019] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0020] Figure 1 This is a flowchart illustrating a boiler design document retrieval method based on grouping and reordering according to an embodiment of the present disclosure. After obtaining the candidate document fragment set generated by the coarse recall stage, the method includes the following steps: S1: Perform bottom-up hierarchical clustering on the semantic vectors of all candidate document fragments to construct a binary clustering tree, and allocate the number of candidate samples to each branch of the clustering tree in a top-down proportion based on the similarity between the semantic center of each cluster and the user query vector. The hierarchical clustering specifically includes: initializing each candidate document fragment as an independent cluster, and then iteratively merging the two clusters with the highest cosine similarity until all candidate fragments are merged into the same root node, forming a complete binary clustering tree.
[0021] Based on the similarity between the semantic center of each cluster and the user query vector, the number of candidate samples is allocated proportionally to each branch from top to bottom, specifically including: Starting from the root node, for any node that needs to be selected... Nodes of a sample Its left and right child nodes are respectively and Candidate slots are allocated proportionally based on the cosine similarity between the left and right subclusters and the query vector, with the left subcluster receiving a certain number of slots. , Right subcluster allocation quota The allocation process is then recursively executed until the number of candidate nodes allocated to a node is 1.
[0022] Let the set of k candidate document fragments obtained in the coarse recall phase be: , The goal of the reordering phase is to generate an ordered list of length m. , , To address the lack of diversity in traditional reordering methods and to provide effective context for subsequent grouping and sorting, this algorithm first performs a coarse review of the candidate document fragment set. Perform hierarchical clustering.
[0023] This stage aims to group semantically similar document fragments together, while ensuring that the final result covers different semantic topics in subsequent sampling. Assume each candidate document fragment... All have been converted into their corresponding vector representations using a pre-trained encoding model. .
[0024] Hierarchical clustering employs a bottom-up agglomerative clustering strategy. Initially, each candidate fragment... Each is considered an independent cluster A cluster vector representation Defined as the mean of all candidate segment vectors it contains: , In each iteration, the algorithm calculates the cosine similarity between all pairs of clusters and selects the two clusters with the highest similarity. and Merge to form a new parent cluster. This merging process is equivalent to constructing a binary tree where the leaf nodes are the original candidate fragments, and each internal node represents the new cluster resulting from merging the clusters of its child nodes. This process is repeated until all candidate fragments are merged into the same root node. In the tree, a complete cluster tree is formed.
[0025] After constructing the clustering tree, the algorithm allocates the number of samples to be selected to each cluster from top to bottom based on the correlation between the cluster and the user query vector q. Let the total number of results to be selected be m. Starting from the root node... Initially, m is allocated as the number of candidates.
[0026] For any one that needs to be selected Nodes of a sample Its left and right child nodes are respectively and The algorithm allocates candidate slots proportionally based on the similarity between the left and right subclusters and the query. Specifically, slots are allocated to the left subcluster. quota The calculation is as follows: , in This represents the cosine similarity function. Correspondingly, it is assigned to the right sub-cluster. The number of places is This allocation process proceeds recursively along the clustering tree until a certain node is reached. One candidate is allocated.
[0027] These nodes (clusters) assigned a quota of 1 will serve as the basic units for subsequent grouping and sorting stages. In this way, semantic branches that are more relevant to the query will be allocated more quotas, while branches that are less relevant to the query but still have potential value will also have a chance to be displayed, thus ensuring the semantic diversity of the final result.
[0028] S2: For each cluster that has been assigned a candidate slot, an iterative grouping comparison strategy based on a large language model is used to accurately select the most relevant fragments, including: grouping the candidate fragments within the cluster, inputting a group of candidate fragments along with the user query into the large language model each time to obtain the relative ranking within the group, recording the ranking in each comparison by having each fragment participate in multiple comparisons of different groups, calculating the average ranking of each fragment, and selecting the candidate fragment with the highest average ranking. Candidate segments within a cluster are grouped. Each time, a group of candidate segments is input into the large language model along with the user query to obtain the relative ranking within the group. Each candidate segment must participate in at least a preset threshold of d comparisons. During each comparison, b candidate segments with the fewest comparisons from the current cluster are selected to form a ranking group, where b is the number of segments that the large language model can effectively rank in a single time.
[0029] The average rank of each segment is calculated as follows: For any candidate segment within the cluster Its average ranking ,in For the set of ranking records of the segment across all participating comparisons, select the candidate segment with the smallest average ranking as the representative of the cluster.
[0030] After determining which clusters each cluster needs to select the most relevant candidate fragment from, the algorithm enters the intra-cluster grouping and sorting phase. The goal of this phase is to select the most relevant candidate fragment from each labeled cluster. In the middle, accurately filter out the query results The most matching segment. Due to the limited context length of the large model, it is impossible to sort all segments within a cluster at once. Therefore, this algorithm adopts an iterative group comparison strategy. Suppose that the large model can effectively sort b candidate segments in a single step. To ensure the robustness of the sorting results, each segment needs to participate in at least d comparisons.
[0031] For a cluster to be processed The algorithm is for each candidate fragment. Maintain a comparison counter count( ) and a list of ranking records Initially, count( )=0 and Empty. In each round of comparison, the algorithm selects b candidate segments with the smallest current count value from this cluster to form a sorted group. If fragments with the same count value exist, a random fragment will be selected. Then, a query will be performed. and sorting groups The system inputs b segments into a large language model and asks the model to output a ranking from 1 to b for these b segments based on their relevance to the query.
[0032] Assume the model returns the following ranking result: Then for any fragment within the group If it is ranked p, then add ranking p to its ranking record list. Meanwhile, the comparison counter (count) value for all segments within the group is incremented by one. This process is repeated until all candidate segments within the cluster are found. count of comparisons All values are not less than the preset threshold d. This mechanism ensures that each segment undergoes sufficient cross-comparison, reducing the impact of positional bias or accidental model misjudgment in a single sorting.
[0033] S3: The candidate segments with the highest average ranking selected from each cluster are aggregated to form the final candidate set. The final candidate set is then input into the large language model for global sorting to generate the final ordered search result list.
[0034] The number of candidate sets formed by aggregating the best candidate fragments from different clusters is m, where m ranges from 10 to 20.
[0035] The candidate document fragments are document fragments from the fields of boiler design, manufacturing, or operation and maintenance.
[0036] After the intra-cluster grouping and sorting are completed, it is necessary to start from each cluster. The final winning candidate segment is determined by calculating the average rank of each segment. For any candidate segment within a cluster... Its average ranking Defined as:
[0037] Algorithm selects average ranking Minimum candidate fragment As a representative of this cluster, namely By performing this operation on all labeled clusters, a set of m best candidate fragments from different semantic clusters is obtained. }
[0038] Finally, the algorithm enters the global aggregation phase, which processes the set. The m candidate segments are sorted to generate an ordered list L. Because... The fragments in the dataset have undergone preliminary screening, exhibiting high relevance and diversity, and their number m is typically within a reasonable range (e.g., 10-20). Therefore, a final global ranking can be directly performed using a large language model, resulting in a ranked list. This list serves as the final response to user queries. It is not only highly relevant to the query as a whole, but also possesses good content diversity due to its members coming from different semantic clusters.
[0039] like Figure 2 The diagram shown is a structural schematic of a boiler design document retrieval system based on grouping and reordering, as disclosed in this disclosure, including: The coarse recall module 210 is used to quickly filter out a set of candidate document fragments from the document library; The hierarchical clustering module 220 is used to perform bottom-up hierarchical clustering on the semantic vectors of all candidate document fragments, construct a binary clustering tree, and allocate the number of candidate samples to each branch in a top-down proportion based on the similarity between the semantic center of each cluster and the user query vector. The intra-cluster grouping and sorting module 230 is used to select the most relevant segments for each cluster that has been assigned a number of candidate segments by adopting an iterative grouping and comparison strategy based on a large language model. This includes grouping candidate segments within the cluster and inputting them into the large language model to obtain the relative ranking within the group, recording the ranking of each segment in multiple comparisons and calculating the average ranking, and selecting the segment with the highest average ranking. The global aggregation module 240 is used to aggregate the best fragments selected from each cluster and input them into the large language model for a global fine sorting, generating a final ordered list of search results.
[0040] The coarse recall module 210 is used to quickly filter out a set of candidate document fragments from the boiler design document library. In this embodiment, the module uses a pre-trained dual-tower model to efficiently retrieve the top k document fragments that are semantically relevant to the user query from a large-scale document library, forming a candidate set as the basis for subsequent re-ranking processing.
[0041] Hierarchical clustering module 220, connected to coarse recall module 210, performs bottom-up hierarchical clustering of the semantic vectors of all candidate document fragments, constructs a binary clustering tree, and allocates the number of candidate samples to each branch proportionally from top to bottom based on the similarity between the semantic center of each cluster and the user query vector. Specifically, this module first calls a pre-trained encoding model to convert each candidate fragment into a semantic vector; then it performs agglomerative hierarchical clustering: initially, each fragment forms its own cluster, iteratively merging the two clusters with the highest cosine similarity until a complete binary clustering tree is formed; after clustering, starting from the root node, candidate samples are recursively allocated according to the cosine similarity ratio between the left and right sub-clusters and the query vector until the node is allocated 1 sample. These labeled clusters serve as the basic units for subsequent intra-cluster grouping and sorting.
[0042] The intra-cluster grouping and ranking module 230, connected to the hierarchical clustering module 220, is used to select the most relevant fragments for each cluster allocated candidate slots using an iterative grouping and comparison strategy based on a large language model. This module groups the candidate fragments within each cluster into groups of b fragments (b being the number of fragments that the large language model can effectively rank in a single pass), inputting these fragments along with the user query into the large language model to obtain the relative ranking within each group. Each fragment must participate in at least d comparisons with different groups, recording its ranking in each comparison. After all comparisons are completed, the average ranking of each fragment is calculated, and the fragment with the smallest average ranking is selected as the representative of that cluster. In this way, a unique optimal candidate fragment is selected within each cluster.
[0043] The global aggregation module 240, connected to the intra-cluster grouping and sorting module 230, is used to aggregate the best fragments selected from each cluster and input them into the large language model for a global fine-grained sorting, generating a final ordered list of search results. Since the number of candidate fragments m after aggregation is usually between 10 and 20, the large language model can be directly used to perform the final sorting of these high-quality, diverse fragments from different semantic clusters, outputting an ordered list L as the final response to the user query.
[0044] The above modules work together to realize the boiler design document retrieval function based on group reordering, which can effectively improve the accuracy of reordering and the diversity of retrieval results.
[0045] Processor 301 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0046] The memory 302 can be an internal storage unit of the electronic device 300, such as a hard disk or RAM of the electronic device 300. The memory 302 can also be an external storage device of the electronic device 300, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the electronic device 300. Furthermore, the memory 302 can include both internal and external storage units of the electronic device 300. The memory 302 is used to store the computer program 303 and other programs and data required by the electronic device. The memory 302 can also be used to temporarily store data that has been output or will be output.
[0047] The above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit it. Although this disclosure 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 this disclosure, and should all be included within the protection scope of this disclosure.
Claims
1. A boiler design document retrieval method based on grouping and reordering, characterized in that, After obtaining the set of candidate document fragments generated by the coarse recall phase, the following steps are included: S1: Perform bottom-up hierarchical clustering on the semantic vectors of all candidate document fragments to construct a binary clustering tree, and allocate the number of candidate samples to each branch of the clustering tree in a top-down proportion based on the similarity between the semantic center of each cluster and the user query vector. S2: For each cluster that has been assigned a candidate slot, an iterative grouping comparison strategy based on a large language model is used to accurately select the most relevant fragments, including: grouping the candidate fragments within the cluster, inputting a group of candidate fragments along with the user query into the large language model each time to obtain the relative ranking within the group, recording the ranking in each comparison by having each fragment participate in multiple comparisons of different groups, calculating the average ranking of each fragment, and selecting the candidate fragment with the highest average ranking. S3: The candidate segments with the highest average ranking selected from each cluster are aggregated to form the final candidate set. The final candidate set is then input into the large language model for global sorting to generate the final ordered search result list.
2. The method according to claim 1, characterized in that, The hierarchical clustering specifically includes: initializing each candidate document fragment as an independent cluster, and then iteratively merging the two clusters with the highest cosine similarity until all candidate fragments are merged into the same root node, forming a complete binary clustering tree.
3. The method according to claim 2, characterized in that, Based on the similarity between the semantic center of each cluster and the user query vector, the number of candidate samples is allocated proportionally to each branch from top to bottom, specifically including: Starting from the root node, for any node that needs to be selected... Nodes of a sample Its left and right child nodes are respectively and Candidate slots are allocated proportionally based on the cosine similarity between the left and right subclusters and the query vector, with the left subcluster receiving a certain number of slots. , Right subcluster allocation quota The allocation process is then recursively executed until the number of candidate nodes allocated to a node is 1.
4. The method according to claim 1, characterized in that, Candidate segments within a cluster are grouped. Each time, a group of candidate segments is input into the large language model along with the user query to obtain the relative ranking within the group. Each candidate segment must participate in at least a preset threshold of d comparisons. During each comparison, b candidate segments with the fewest comparisons from the current cluster are selected to form a ranking group, where b is the number of segments that the large language model can effectively rank in a single time.
5. The method according to claim 4, characterized in that, The average rank of each segment is calculated as follows: For any candidate segment within the cluster Its average ranking ,in For the set of ranking records of the segment across all participating comparisons, select the candidate segment with the smallest average ranking as the representative of the cluster.
6. The method according to claim 1, characterized in that, The number of candidate sets formed by aggregating the best candidate fragments from different clusters is m, where m ranges from 10 to 20.
7. The method according to claim 1, characterized in that, The candidate document fragments are document fragments from the fields of boiler design, manufacturing, or operation and maintenance.
8. A boiler design document retrieval system based on grouping and reordering, characterized in that, include: The coarse recall module is used to quickly filter out a set of candidate document fragments from the document library; The hierarchical clustering module is used to perform bottom-up hierarchical clustering on the semantic vectors of all candidate document fragments, construct a binary clustering tree, and allocate the number of candidate samples to each branch in a top-down proportion based on the similarity between the semantic center of each cluster and the user query vector. The intra-cluster grouping and sorting module is used to select the most relevant segments for each cluster that has been assigned a number of candidate segments by using an iterative grouping and comparison strategy based on a large language model. This includes grouping candidate segments within the cluster and inputting them into the large language model to obtain the relative ranking within the group, recording the ranking of each segment in multiple comparisons and calculating the average ranking, and selecting the segment with the highest average ranking. The global aggregation module is used to aggregate the best fragments selected from each cluster and input them into the large language model for a global fine-grained sorting, generating a final ordered list of search results.
9. An electronic device, characterized in that, include: One or more processors; A storage unit for storing one or more programs that, when executed by one or more processors, enable the one or more processors to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.
