Document query method and device
By identifying query categories and determining corresponding configuration parameters, the document query process is driven, solving the accuracy and adaptability issues of traditional document retrieval methods in complex office scenarios, and improving retrieval accuracy and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional document retrieval methods struggle to accurately understand query intent in complex office scenarios and lack targeted modeling, resulting in inaccurate search results, missing information, and unreasonable sorting, which negatively impacts user experience and the level of office automation.
By receiving query requests, identifying query categories, and determining query configuration parameters based on the categories, the document query process is driven, achieving strategic control and accurate result output.
It improves the accuracy and flexibility of document retrieval, enhances adaptability, and is suitable for various document management systems and information retrieval application scenarios.
Smart Images

Figure CN121833912A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a document retrieval method and apparatus. Background Technology
[0002] With the rapid growth of enterprise digitalization and knowledge management needs, traditional retrieval-based office document search is widely used in scenarios such as enterprise knowledge bases, meeting minutes, policy documents, and report management. However, due to the limitations of traditional retrieval methods in understanding query intent, strategy selection, and result optimization, users often face problems such as inaccurate search results, missing information, or unreasonable sorting in complex office scenarios, which directly affects document utilization efficiency and the office automation experience.
[0003] Existing technologies primarily rely on fixed-process document retrieval procedures, including query preprocessing, document matching, and result ranking. They acquire relevant content fragments through keyword matching or vector retrieval, and then fuse and filter the results. However, these methods typically employ a uniform processing strategy, lacking targeted modeling for different types of office queries. When query intent is complex or document types are diverse, traditional retrieval methods struggle to accurately understand query needs and rationally select retrieval strategies, leading to problems such as low relevance, insufficient information coverage, and unreasonable ranking of search results. These issues not only reduce the efficiency of document retrieval but also constrain the intelligence level of automated office systems, impacting user experience and decision support capabilities. Summary of the Invention
[0004] This application provides a document retrieval method and apparatus that addresses the shortcomings of existing general retrieval methods in terms of query accuracy, strategy adaptation, and result ranking optimization. The method determines the query category based on the acquired query request, selects corresponding query parameters according to the query category, and uses these parameters to retrieve relevant documents from a document database to obtain query results. By introducing query category awareness and query configuration parameter constraints during the retrieval process, this method can intelligently select the most suitable retrieval strategy, processing flow, and parameter configuration, achieving high relevance and coverage of query results, significantly improving the accuracy of document retrieval and user experience. This solution is applicable to various office scenarios such as enterprise knowledge base management, office document search, meeting minutes retrieval, report summary generation, and policy document retrieval.
[0005] Firstly, this application provides a document retrieval method, including: Receive a query request and determine the corresponding query category based on the query request; Determine the query configuration parameters based on the query category; The document is queried using the query configuration parameters to obtain the query results corresponding to the query request.
[0006] Secondly, this application provides a document retrieval device, comprising: The query identification module is used to receive query requests and determine the corresponding query category based on the query requests. The query configuration module is used to determine query configuration parameters based on the query category. The document query module is used to perform document queries using the query configuration parameters and obtain the query results corresponding to the query request.
[0007] Thirdly, this application provides a document retrieval device, comprising: One or more processors; A memory that stores one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the document query method as described in the first aspect.
[0008] Fourthly, this application provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the document query method as described in the first aspect.
[0009] This application constructs a document query method driven by query categories, achieving structured identification of user query intent and accurate acquisition of query results. The method first receives and analyzes a query request to determine the corresponding query category. Then, based on the determined query category, it matches associated query configuration parameters. These parameters define the search scope, indexing method, sorting rules, and filtering conditions used in the document query process. Finally, using the determined query configuration parameters, it performs document query processing on the target document set, generating query results that match the query request. Through this linked processing flow of query category determination and query configuration parameter-driven execution, this application achieves strategic control of the document query process and accurate result output, improving the accuracy, flexibility, and adaptability of document queries. It is applicable to various document management systems and information retrieval application scenarios. Attached Figure Description
[0010] Figure 1 This is a flowchart of a document query method provided in an embodiment of this application; Figure 2 This is a flowchart of a query result determination method provided in an embodiment of this application; Figure 3 This is a flowchart of a second recall result determination method provided in an embodiment of this application; Figure 4 This is a flowchart of a query result generation method based on query category provided in an embodiment of this application; Figure 5 This is a flowchart of a query result generation method based on recall level provided in an embodiment of this application; Figure 6 This is a flowchart illustrating the steps of a document retrieval method provided in an embodiment of this application; Figure 7 This is a structural block diagram of a document retrieval device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a document query device provided in an embodiment of this application. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as being processed sequentially, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. A process can be terminated when its operation is completed, but it may also have additional steps not included in the drawings. A process can correspond to a method, function, procedure, subroutine, subroutine, etc.
[0012] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0013] Currently, with the widespread application of digital office systems, knowledge management platforms, and intelligent collaboration systems in various organizations, how to efficiently and accurately retrieve information that meets actual work needs from massive and diverse office document resources has become a key technical issue in office information processing systems. In typical office scenarios, users often need to initiate searches based on various document contents such as policy documents, meeting minutes, project plans, and analysis reports, further supporting tasks such as information retrieval, content summarization, solution comparison, and decision support. However, as the scale of documents continues to expand, document types become increasingly complex, and query needs become more diversified, traditional document retrieval processes are gradually revealing significant limitations in terms of query comprehension depth, scenario adaptability, and result quality control, directly impacting office efficiency and the value of information utilization.
[0014] Related office document retrieval technologies typically employ a phased processing framework. The overall process mainly includes query preprocessing, document retrieval and matching, and result sorting and output. In the query preprocessing stage, the system performs basic analysis and standardization on the user-input office query. It breaks the query text into lexical units and removes redundant noise information through word segmentation and cleaning techniques. Simultaneously, it extracts key query terms using statistical methods such as TF-IDF (Term Frequency–Inverse Document Frequency) and expands the query semantics using synonym expansion or word vector models to improve the recall scope of subsequent searches. Subsequently, in the document retrieval and matching stage, the system performs content retrieval in the document database based on the preprocessed query information. Common methods include keyword matching based on inverted indexes and the BM25 (Best Matching25) algorithm, vectorized semantic retrieval based on Word2Vec (Word to Vector) or BERT (Bidirectional Encoder Representations from Transformers) models, and hybrid retrieval strategies that fuse multiple retrieval results through linear weighting to obtain the most relevant document fragments to the query. Finally, in the result sorting and output stage, the retrieved candidate content is fused with relevance scores and thresholded, and the document titles, content summaries, and relevance information are output according to a unified display template, thus presenting the final search results to the user.
[0015] The aforementioned office document retrieval process has a clear structure and direct implementation path, enabling rapid return of relevant document content in office scenarios with relatively simple query intent and basic retrieval needs. Its overall architecture is relatively simple, relying mainly on the optimization of retrieval algorithms and ranking models to meet basic usage requirements. However, in complex office environments, this technology still has several shortcomings. First, the traditional process has limited ability to perceive query intent, making it difficult to distinguish the essential differences in objectives, processing logic, and output formats of different office queries. This leads to diverse office needs being processed uniformly, thus affecting retrieval results. Second, the process lacks an adaptation mechanism for office document types and business attributes, failing to dynamically adjust retrieval strategies for different document characteristics such as meeting minutes, policy documents, or structured reports, weakening the practical application value of office documents. Furthermore, the overall processing flow is highly homogenized, lacking differentiated strategy support for different tasks such as content retrieval, information summarization, keyword positioning, and document comparison, making it difficult to optimize processing paths according to the characteristics of office scenarios. Finally, in the results output stage, traditional retrieval systems usually adopt fixed quality control standards and cannot dynamically adjust the result screening and quality assurance mechanisms according to the importance of the query or the sensitivity of the business. This poses a risk of information omission or quality loss when dealing with key or sensitive office documents.
[0016] Therefore, this invention aims to propose a document query method and apparatus. This method, without introducing complex manual configuration or additional external rules, receives and parses query requests, accurately identifies the query category corresponding to the query request, and achieves a structured characterization of the user's query intent. Based on this, it adaptively determines matching query configuration parameters according to the query category and uses these parameters to drive the document query process, thereby obtaining query results highly matched to the query request. This solution effectively improves the retrieval accuracy and strategy adaptability in various office query scenarios, while possessing good versatility and scalability, meeting the application needs for efficient and accurate document queries in document management systems, enterprise knowledge bases, and intelligent office platforms.
[0017] Figure 1 A flowchart of a document query method provided in an embodiment of this application is given. (Reference) Figure 1 The document search methods specifically include: S110. Receive a query request and determine the corresponding query category based on the query request.
[0018] In some embodiments, a query request initiated by a client is first received. This query request can be an information retrieval request initiated by a user for a target data object. The query request may include at least one of query keywords, query conditions, and query instruction types. Query keywords can be the target data object or core semantic content that the user wishes to retrieve, typically appearing in the form of text words, phrases, or identifiers. They are the basic semantic elements in the query request used to directly locate the target information. For example, query keywords could be "order records," "device operation logs," "user login failure," or "2024 sales report." Query conditions can be used to impose constraint rules on the target data object corresponding to the query keywords to limit the search scope, filter target results, or refine matching rules. These are typically manifested as structured or semi-structured constraint parameters. Query conditions can include time conditions, attribute conditions, numerical conditions, or logical combinations of conditions. Time conditions can be used to limit the time range of data generation or updates, such as "log records within the last 7 days" or "order data from January 1, 2024 to January 31, 2024". Attribute conditions can be based on the attribute fields of the target data object, such as "work orders with a completed status" or "alarm records of device type sensor". Numerical conditions can be used to limit the value range of numerical fields, such as "transaction records with an amount greater than 1000" or "tasks with fewer than 3 errors". Logical combinations of conditions can be used to logically combine multiple conditions, such as "tasks with a failed status and high priority". Query instruction types can be the category of query operation or processing intent expected to be executed in the query request, used to guide the system to adopt appropriate query strategies, parsing methods, or processing flows. Query instruction types can include retrieval instructions, analysis instructions, filtering instructions, retrieval instructions, and judgment instructions. Retrieval commands can be used to retrieve data sets that meet certain conditions, such as "query," "search," and "get list." Analysis commands can be used to aggregate or statistically process target data, such as "count," "calculate average," and "summarize by type." Filtering commands can be used to specify sorting rules or filtering methods for result sets, such as "sort in descending order of time" and "return only the first 10 results." Retrieval commands can be used to retrieve detailed information about a single data object, such as "view details" and "get record details." Judgment commands can be used to determine whether data exists or whether its status meets certain conditions, such as "whether there are any abnormal records" and "check if a device is online." The client can be a terminal device, a business system, or a third-party service interface. Upon receiving a query request, the query category corresponding to the query request is determined based on the content characteristics and request attributes of the query request. In one embodiment, the query category can be determined by parsing the query keywords, query semantic features, or command identifiers in the query request, matching the parsing results with preset query category rules or query category models, and determining the query category based on the matching results.
[0019] In one embodiment, the query category can be determined by generating query structure features based on the number of query conditions, the type of conditions, and the logical relationship carried in the query request, and mapping the query structure features to the corresponding query category.
[0020] In one embodiment, determining the query category can be achieved by inputting the query request into a trained query classification model, which then outputs the target query category matching the query request. This enables automated classification of query requests and selection of processing strategies. The query classification model can be a supervised learning model that analyzes the content or features of the query request and outputs a query category label or category vector corresponding to the query request.
[0021] Optionally, the corresponding query category can be determined based on the query request, including: The query request is input into the trained large language model, which performs semantic decoding and intent recognition on the query request to obtain the query category corresponding to the query request.
[0022] For example, a query request initiated by a client is input into a trained large language model. The query request may include at least one of query keywords, query conditions, or query command types. The client can be a terminal device, a business system, or a third-party service interface. After the query request is input into the large language model, semantic decoding and intent recognition are performed accordingly to obtain the query category corresponding to the query request. The query category can be at least one of exact query, fuzzy query, range query, or combined query. An exact query can be used to find data objects that are completely identical to or highly definite in the query request. For example, the query keyword is "order number 202405180001", the query condition is "user ID equals 10086", or the query command type is "get record details". In the case of an exact query, the system directly matches based on completely identical field values to obtain a unique or highly definite query result. A fuzzy query can be used to obtain semantically related or approximately matching data objects when the query request information is incomplete or uncertain. It allows for fuzzy matching, similarity matching, or semantic expansion of query keywords. For example, if the query keywords are "login error" or "device disconnection issue," and no unique identifier is explicitly specified, only a natural language description is provided, the system will return data objects related to "login failure," "authentication error," and "connection interruption." Range queries can be used to limit the value range or time range of data objects based on query conditions. For example, query conditions such as "creation time between January 1, 2024 and March 31, 2024" or "amount greater than 1000 and less than 5000" will return multiple records that meet the range conditions. Combined queries can be used to combine multiple query methods or query elements for comprehensive matching. A single query request can include exact matching, fuzzy matching, and range conditions. For example, if the query keyword is "order" and the fuzzy matching is for order name or description, or the query condition is "creation time within the last 30 days," the system will first locate relevant order data using fuzzy matching, then further filter by time range and status conditions, ultimately obtaining query results that meet multiple conditions. In one embodiment, the query category may further include at least one of retrieval queries, summary queries, keyword queries, and comparison queries. Retrieval queries can be used to find and return data objects or sets of records that meet certain conditions from a target dataset, such as: "Query order records from the last 30 days" or "Get a list of devices with an abnormal status." Summary queries can be used to summarize, generalize, or extract key information based on the retrieved data, such as: "Summarize the main types of system alarms from the past week" or "Outline the main reasons for user complaints this month."Keyword queries can be used to locate relevant content or information snippets around specified keywords, such as: "Find logs containing the keyword 'timeout'" or "Search for work order records containing 'payment failed'". Comparison queries can be used to perform comparative analysis on two or more data objects, data sets, or time periods, such as: "Compare the change in order quantity this month with last month" or "Compare the performance metric differences between version A and version B". In one embodiment, the query category can be determined by analyzing the semantic features in the query request and matching the analysis results with preset query category rules or models to output the target query category.
[0023] In one embodiment, the query category can be determined by: using a large language model to identify the user's intent based on the keywords, semantic representation, and contextual information of the query request, and generating the query category accordingly.
[0024] In one embodiment, the query category can be determined by jointly inputting the query request and features from historical query samples into a trained large language model, which then automatically infers and outputs the query category that matches the query request. The large language model can automatically infer the category of the query request based on the input information, thereby supporting the automatic selection of subsequent processing strategies, such as routing the request to a specified service, triggering specific business logic, or generating response content.
[0025] In one embodiment, the large language model can be a general intent understanding model built on a large-scale pre-trained corpus, such as Qwen-14B (Tongyi Qianwen Large Language Model with 14 Billion Parameters), which outputs the corresponding query category and its confidence information by vectorizing the query text, extracting intent features, and performing multi-intent discrimination.
[0026] S120. Determine the query configuration parameters based on the query category.
[0027] In some embodiments, query configuration parameters can be parameters that constrain and guide the subsequent query execution process.
[0028] In one embodiment, the query configuration parameters can be determined by: pre-configuring corresponding parameter templates for different query categories, and after identifying the query category of the query request, retrieving the query configuration parameters corresponding to that query category from the parameter template library.
[0029] In one embodiment, the query configuration parameters can be determined by: using the query category as an input feature, combining it with the context information of the query request, and inputting it into a parameter generation model, which then outputs query configuration parameters that match the query category. The parameter generation model can be a deep neural network model, capable of automatically generating query configuration parameters that match the query category based on the input features.
[0030] In one embodiment, query configuration parameters may include at least one of the following: query scope parameters, result return rules, sorting strategy parameters, index selection parameters, and timeout control parameters. Query scope parameters are used to limit the data boundaries or scope covered by the query operation to avoid irrelevant data from participating in the retrieval, thereby improving query efficiency and result relevance. For example, this parameter can be used to limit the query to be executed only within a specific time interval, a specific business type, a specific data table, or a specific data partition; in geographic information or user data scenarios, it can also be limited to a certain region, a certain user group, or a certain set of devices. Result return rules are used to constrain the output method and content structure of query results to adapt to the needs of different clients or business scenarios. For example, the maximum number of results to be returned, whether to return in pages, the set of fields to be returned, field anonymization rules, or only returning summary information of the hit results instead of complete data can be specified, thereby controlling data volume and security while ensuring availability. Sorting strategy parameters are used to determine the priority order among multiple query results to ensure the business rationality of the results presentation. For example, sorting can be based on time order, relevance score, weight value, numerical size, or comprehensive score; in some embodiments, multi-field combination sorting or custom sorting strategies based on business rules can also be supported. Index selection parameters indicate the preferred index type or set of indexes to use during the query process to optimize the query execution path. For example, when multiple index structures exist, full-text indexes, inverted indexes, primary key indexes, or composite indexes can be specified to reduce full table scans, improve query response speed, and reduce system resource consumption. Timeout control parameters limit the maximum allowed execution time for a single query to prevent complex or abnormal queries from occupying system resources for extended periods. For example, when the query execution time exceeds a preset threshold, the query can be automatically interrupted and a timeout message can be returned, or partially calculated results can be returned to ensure overall system stability and concurrent processing capabilities. In one embodiment, after determining the query configuration parameters, the method further includes dynamically calculating or adjusting the query configuration parameters based on the query complexity level, real-time requirements, and data scale characteristics corresponding to the query category, thereby optimizing query response efficiency while ensuring query accuracy.
[0031] Optionally, query configuration parameters can be determined based on the query category, including: Based on the query category, the system matches the corresponding query configuration parameters in the pre-set routing matrix. The query configuration parameters include recall configuration parameters, fusion configuration parameters, filtering configuration parameters, and processing configuration parameters.
[0032] For example, query configuration parameters guide each stage of the query execution process, including recall configuration parameters, fusion configuration parameters, filtering configuration parameters, and processing configuration parameters, to ensure that the query results meet the request requirements. Recall configuration parameters guide the data acquisition strategy in the initial stage of the query, determining which data sources, index structures, or candidate sets to recall potentially relevant results from. For example, this parameter can specify one or more methods such as keyword recall, semantic vector recall, or rule matching recall, and limit the number of candidates, recall priority, or recall threshold for each recall method, thereby controlling the size of the candidate set while ensuring coverage. Fusion configuration parameters unify and integrate candidate results from different recall channels or different processing modules to form a comparable and sortable candidate result set. For example, this parameter can define the merging strategy, deduplication rules, and weight allocation methods for different recall channels, and generate a unified result score based on weighted scoring or rule fusion to improve the overall relevance of multi-source results after collaboration. Filtering configuration parameters perform further filtering on the fused candidate result set to remove results that do not meet specific conditions. For example, this parameter can be used to set threshold conditions, rule constraints, or business restrictions to perform legality checks, permission checks, or quality assessments on candidate results, retaining only those that meet preset conditions, thereby improving the accuracy and usability of the final returned results. Processing configuration parameters guide the post-processing behavior of query results before output, adapting to different application scenarios or client needs. For example, the sorting method, grouping strategy, formatting rules, summary generation method, or result pruning strategy can be specified to perform structured processing and expression optimization on the filtered results, thereby forming a final query response that meets the request requirements.
[0033] In one embodiment, the method for determining the query configuration parameters may be: searching for the configuration entry corresponding to the query category in the routing matrix, and obtaining the recall configuration parameters, fusion configuration parameters, filtering configuration parameters, and processing configuration parameters contained in the entry.
[0034] In one embodiment, after determining the query configuration parameters, the method further includes: dynamically adjusting the query configuration parameters by combining the feature information of the query request with the query category, so as to generate query configuration parameters suitable for the current query request.
[0035] S130. Use the query configuration parameters to perform a document query and obtain the query results corresponding to the query request.
[0036] In some embodiments, the target document set can be document resources in a local document library, a distributed document storage system, or a remote document service. A local document library can refer to a document storage unit deployed within the same computing node or the same business system, used to store structured or unstructured document data. A distributed document storage system can refer to a document storage architecture composed of multiple storage nodes working together. A remote document service can refer to a service system that provides document access capabilities to the outside world through a network interface, used to obtain document resources across systems or regions. The query result can be document content or document identification information that meets the query request conditions. Document content can include the full text of the document, structured field content, or summary information. Document identification information can include the document's unique identifier, storage location identifier, access path, or index number, used to indicate the target document that meets the conditions.
[0037] In one embodiment, document querying can be performed by: performing retrieval calculations on the target document set based on the query scope, index type, and matching rules specified in the query configuration parameters, and generating query results according to the configured sorting strategy and result filtering rules.
[0038] In one embodiment, document querying can be performed by scheduling and controlling the document query process according to the concurrency strategy, timeout control parameters, and caching strategy indicated in the query configuration parameters, and generating query results by combining the recall results of multiple concurrency strategies.
[0039] Optionally, Figure 2 A flowchart of a query result determination method provided in an embodiment of this application is given. (Reference) Figure 2 The specific methods for determining the query results include: S1301. Execute multiple recall strategies according to the recall configuration parameters to obtain multiple first recall results corresponding to the multiple recall strategies.
[0040] For example, recall strategies can be keyword-based, vector-based, rule-based, or historical behavior-based. Keyword-based recall strategies quickly recall candidate results by matching text keywords in the query request with keywords, field content, or index items in the candidate data. Vector-based recall strategies map the query request and candidate data into vector representations and perform retrieval based on vector similarity, achieving semantic-level matching recall. Rule-based recall strategies match and filter candidate data based on predefined business rules or logical conditions before recalling. Historical behavior-based recall strategies utilize historical behavior data of users or groups to predict potentially relevant results for the current query. After executing multiple recall strategies, a first recall result set corresponding to each strategy is obtained, where each first recall result can be a candidate document or data object that satisfies the conditions of that recall strategy.
[0041] In one embodiment, the recall strategy can be executed by: independently executing the recall operation for each strategy according to the strategy type, parameter settings and weights indicated in the recall configuration parameters, and generating the corresponding first recall result.
[0042] In one embodiment, after executing the recall strategy, the method further includes: performing preliminary deduplication or sorting processing on the generated first recall results.
[0043] In one embodiment, the recall strategy can be executed by inputting the recall configuration parameters and the query request into the recall strategy execution module, which then controls the strategy execution according to the configuration parameters and outputs multiple corresponding first recall results.
[0044] S1302. Based on the recall configuration parameters and the fusion configuration parameters, the multiple first recall results are fused and sorted to obtain the second recall results.
[0045] For example, fusion ranking can be a unified integration of candidate results generated by different recall strategies according to relevance, weight, or priority.
[0046] In one embodiment, the fusion sorting method may be: according to the weight of each recall strategy in the recall configuration parameters and the sorting rules defined in the fusion configuration parameters, the first recall result is weighted and merged, and the second recall result is generated by sorting according to the weighted score.
[0047] In one embodiment, the fusion ranking method may be: based on the fusion algorithm in the fusion configuration parameters, jointly evaluate and re-rank each first recall result to generate a more comprehensive second recall result.
[0048] In one embodiment, the fusion ranking method can be as follows: combining the context features of the query request with the recall strategy output, inputting the first recall result into the fusion module, and having the module automatically calculate the final ranking weight based on the fusion configuration parameters, and outputting the ranked second recall result.
[0049] Optionally, Figure 3 A flowchart of a second recall result determination method provided by an embodiment of this application is given. (Reference) Figure 3 The specific methods for determining the results of this second recall include: S13021. Based on the recall configuration parameters and fusion configuration parameters, perform fusion calculation on each candidate recall object in multiple first recall results to obtain the fusion score of each candidate recall object.
[0050] For example, fusion computing can be used to combine the scores or relevance information of different recall strategies for the same candidate object to obtain a fusion score for each candidate object.
[0051] In one embodiment, the fusion calculation can be performed by: taking a weighted average of the scores of candidate objects under different strategies according to the weights of each recall strategy in the recall configuration parameters, and calculating the fusion score.
[0052] In one embodiment, the fusion calculation can be performed by using a fusion algorithm defined in the fusion configuration parameters, such as linear weighting, sorting fusion, learning sorting, or neural network fusion methods, to uniformly calculate the multi-strategy scores of candidate objects and output a fusion score.
[0053] In one embodiment, the fusion calculation method may be: combining the feature information of the query request, inputting the candidate objects and their scores under each recall strategy into the fusion calculation module, and having the module automatically generate the final fusion score based on the recall configuration parameters and fusion configuration parameters.
[0054] Optionally, the recall configuration parameters include multiple recall strategies and their corresponding strategy weights, and the fusion configuration parameters include strategy adjustment factors, which are used to control the impact of the ranking position of the candidate recalled objects on the fusion score according to the query category.
[0055] For example, strategy weights can be used to indicate the relative importance of each recall strategy in the fusion calculation; fusion configuration parameters include strategy adjustment factors, which can be used to adjust the influence of the ranking position of candidate recall objects on the fusion score according to the query category, thereby achieving adaptive optimization of the fusion results under different query categories.
[0056] Based on the recall configuration parameters and fusion configuration parameters, a fusion calculation is performed on each candidate recalled object from multiple first recall results to obtain a fusion score for each candidate recalled object, including: For each candidate object in the multiple first recall results, perform the following processing: Obtain the sorting position of each candidate object in each first recall result.
[0057] For example, the ranking position can be used to characterize the priority or relevance ranking of candidate objects under each recall strategy, providing a ranking basis for subsequent fusion calculation.
[0058] In one embodiment, the sorting position can be obtained by: traversing each first recall result list, recording the index position or ranking value of the candidate object in the list, and using the recorded index position or ranking value as the sorting position of the candidate object under the corresponding recall strategy.
[0059] In one embodiment, the sorting position can also be obtained by combining the original score output by the recall strategy with the ranking rules to perform sorting mapping on the candidate objects and generate a unified sorting position representation for fusion calculation.
[0060] In one embodiment, the ranking position can also be obtained by inputting the candidate recall object and its appearance information in each first recall result into the ranking analysis module, and the module automatically calculates the ranking position of the candidate object in each result for subsequent fusion score calculation.
[0061] Based on each ranking position and strategy adjustment factor, generate the first score corresponding to each candidate in each first recall result.
[0062] For example, based on the ranking position of the candidate recalled object in each first recall result and the strategy adjustment factor in the fusion configuration parameters, a first score is generated for each candidate recalled object in each first recall result, wherein the first score is used to characterize the effective contribution of the candidate recalled object under the corresponding recall strategy.
[0063] In one embodiment, the first score can be generated by performing a position mapping calculation on the candidate recall objects based on their sorting positions, and adjusting the mapping results in conjunction with a policy adjustment factor to obtain the corresponding first score.
[0064] In one embodiment, the first score can be generated by inputting the sorting position and the strategy adjustment factor into the scoring calculation module, which then automatically outputs the first score corresponding to each candidate recall object in each first recall result according to the preset scoring rules, providing a basis for the calculation of the subsequent fusion score.
[0065] In one embodiment, the first score can be generated by constructing a position decay function based on the sorting position and controlling the decay magnitude using a policy adjustment factor to calculate the first score of the candidate object in each first recall result. For example, the candidate object is in the first... The formula for calculating the first score corresponding to the first recall result of the route is as follows:
[0066] in, For the candidate recall targets in the first The first score corresponding to the first recall result of the route. This refers to the ranking position of the candidate object in the first recall result. This is the strategy adjustment factor corresponding to the query category.
[0067] The fusion score of the candidate recall objects is calculated based on each first score and its corresponding recall strategy weight.
[0068] For example, the fusion score can be used to comprehensively characterize the overall relevance and priority of candidate recall objects under multiple recall strategies.
[0069] In one embodiment, the fusion score can be calculated by multiplying each first score by the strategy weight of the corresponding recall strategy, and summing or normalizing the weighted result to obtain the fusion score of the candidate recall object.
[0070] In one embodiment, the fusion score can be calculated by: using a preset fusion function, jointly calculating the first score and the strategy weight as input parameters, and outputting the fusion score of the candidate recall object.
[0071] In one embodiment, the fusion score can be calculated by inputting the first score of the candidate recall object under each recall strategy and the strategy weight into the fusion calculation module, which then automatically generates the final fusion score based on the fusion configuration parameters.
[0072] Optionally, the fusion configuration parameters also include a global adjustment factor, which is used to proportionally adjust the fusion score according to the query category; the fusion score of the candidate recall object is calculated based on each first score and its corresponding recall strategy weight, including: Each first score is multiplied by the corresponding recall strategy weight and the global adjustment factor to generate the second score of the candidate object under each recall strategy.
[0073] For example, the second score can be used to characterize the actual contribution of each recall strategy to the candidate recall objects under the combined weight and global adjustment effects.
[0074] In one embodiment, the second score can be generated as follows: for each recall strategy, based on the calculation rule of "first score × strategy weight × global adjustment factor", the candidate recall objects are calculated strategy-by-strategy to obtain the corresponding second score. Specifically, the calculation formula for the second score is as follows:
[0075] in, For the candidate recall targets in the first The second score corresponding to the first recall result of the route. To query the global adjustment factor corresponding to the category, For the first The strategy weight corresponding to the road recall strategy.
[0076] In one embodiment, the second score can also be generated by dynamically adjusting the value of the global adjustment factor based on the query category or system operating status, thereby uniformly scaling the second scores under different recall strategies.
[0077] In one embodiment, the second score can also be generated by inputting the first score, strategy weights, and global adjustment factors into the scoring calculation module, which then outputs the second score of the candidate recall object under each recall strategy according to a preset scoring model, providing a basis for the calculation of the final fusion score.
[0078] The second score is combined to obtain the fusion score of the candidate recall objects.
[0079] For example, the fusion score is used to comprehensively characterize the overall contribution and ranking priority of multiple recall strategies to the candidate recall objects.
[0080] In one embodiment, the second score can be calculated by summing, weighted summing, or normalizing the summations of the second scores to obtain the fusion score of the candidate recall objects. For example, the fusion score of the candidate recall objects can be obtained by summing the second scores, as shown in the following formula:
[0081] in, The number of recall strategies.
[0082] In one embodiment, the method for merging and calculating the second score can be: based on a preset fusion function or aggregation model, jointly calculate multiple second scores and output the fusion score of the candidate recall object.
[0083] In one embodiment, the method for merging and calculating the second score can be: inputting each second score into the fusion calculation module, and having the module automatically generate the fusion score of the candidate recall object based on the fusion configuration parameters.
[0084] S13022. Sort each candidate recall object according to the fusion score to obtain the candidate ranking result.
[0085] For example, the fusion score can be used as a ranking criterion to reflect the overall relevance and priority of candidate recall objects after the fusion of multiple recall strategies.
[0086] In one embodiment, sorting based on fusion score can be done by arranging the candidate recall objects in descending or ascending order according to the numerical value of the fusion score to obtain the corresponding candidate ranking result.
[0087] In one embodiment, the sorting based on the fusion score can be achieved by introducing a stable sorting rule or a parallel processing rule during the sorting process to ensure the consistency and controllability of candidate recall objects with the same or similar fusion scores in the sorting results.
[0088] In one embodiment, the sorting method based on the fusion score can be: inputting the candidate recall objects and their fusion scores into the sorting module, and the sorting module automatically outputting the candidate sorting results according to a preset sorting strategy.
[0089] S13023. Perform deep semantic reordering on the candidate ranking results to obtain the second recall results.
[0090] For example, deep semantic reordering can further characterize the semantic relevance between candidate recall objects and query requests, thereby improving the accuracy and consistency of recall results.
[0091] In one embodiment, deep semantic re-ranking can be achieved by inputting the query request and candidate recall objects from the candidate ranking results into a deep semantic model, calculating the semantic matching degree between the candidate recall objects and the query request, and re-ranking the candidate recall objects based on the calculation results to generate a second recall result. The deep semantic model can be a neural network-based semantic representation and matching model capable of extracting semantic features from both the query request and the candidate recall objects, calculating the semantic matching degree between them, and generating corresponding semantic matching scores.
[0092] In one embodiment, deep semantic re-ranking can be achieved by: obtaining vector representations of query requests and candidate recall objects based on a pre-trained deep semantic re-ranking model, and re-ranking the candidate ranking results through similarity calculation or semantic matching network to output a second recall result.
[0093] In one embodiment, deep semantic re-ranking can also be achieved by combining query category and contextual information to adaptively adjust the parameters of the deep semantic re-ranking model so that the generated second recall result better meets the semantic understanding requirements of different query categories.
[0094] S1303. Filter the second recall results according to the filtering configuration parameters to obtain the third recall results.
[0095] For example, the filtering process can eliminate candidate objects that do not meet the filtering conditions or do not conform to business constraints, thereby improving the effectiveness and usability of the final recall results. For instance, conditional threshold filtering or business attribute constraint filtering can be set. Conditional threshold filtering can perform filtering based on preset scoring thresholds or similarity thresholds. When the relevance score of a candidate object is lower than the preset threshold, the candidate object is eliminated. Business attribute constraint filtering can filter based on whether the business attributes of the candidate object meet the business constraint conditions. In product or content retrieval scenarios, candidate objects with a status of being unavailable, invalid, or expired can be eliminated, and only data objects that are in a valid state and can be displayed externally can be retained.
[0096] In one embodiment, the filtering method can be based on threshold conditions, rule constraints, or attribute restrictions defined in the filtering configuration parameters. Threshold conditions limit the minimum requirements for candidate objects in terms of quantitative indicators such as score, similarity, or confidence. Rule constraints limit the business logic or compliance conditions that candidate objects must meet. Attribute restrictions limit the value range of candidate objects in terms of status, type, or range attributes. During the filtering process, the above verification operations can be performed sequentially on each candidate object according to a unified or preset verification order. When a candidate object simultaneously meets the corresponding threshold conditions, rule constraints, and attribute restrictions, it is determined that the candidate object passes the filtering and is retained in the result set. If any verification condition is not met, the candidate object is removed from the result set, thus obtaining the third recall result. In one embodiment, the filtering method can be based on dynamically adapting the filtering configuration parameters by combining the context information of the query request with the attribute characteristics of the candidate objects, and filtering the second recall result accordingly to obtain the third recall result.
[0097] In one embodiment, the filtering method can also be: inputting the second recall result and filtering configuration parameters into the filtering processing module, and the module automatically outputting the third recall result according to the preset filtering logic.
[0098] Optionally, the second recall results are filtered according to the filtering configuration parameters to obtain the third recall results, including: Candidates whose fusion score is greater than the filtering configuration parameter in the second recall result are selected as the third recall result.
[0099] For example, the candidate recall object can be a document, data entry, or multimedia resource; the second recall result can be a recall set after fusion ranking or deep semantic re-ranking; the fusion score corresponding to the candidate recall object is used to characterize its relevance to the query request; and the third recall result can be a set of candidate recall objects that meet the filtering conditions.
[0100] In one embodiment, the filtering method for the third recall result can be: determining whether the fusion score of the candidate recall object is greater than the threshold set in the filtering configuration parameters; if it is greater, it is filtered as the third recall result.
[0101] In one embodiment, the screening method for the third recall result may be: combining the attribute characteristics of the candidate recall object and the query category, dynamically adjusting the screening threshold, and then judging whether the conditions are met, thereby determining whether to screen it as the third recall result.
[0102] In one embodiment, the third recall result can be filtered by inputting the candidate recall object and its fusion score and filtering configuration parameters into the filtering module, and the module automatically generates the third recall result according to the preset filtering rules.
[0103] S1304. Process the third recall result according to the processing configuration parameters to obtain the query result corresponding to the query request.
[0104] For example, processing operations can format, sort, deduplicatize, or supplement the filtered candidate recall objects, thereby improving the completeness and usability of the query results.
[0105] In one embodiment, the query results can be generated by performing secondary sorting, attribute supplementation, or information merging on the candidate recall objects according to the rules defined in the processing configuration parameters, and generating the final query results.
[0106] In one embodiment, the query results can be generated by dynamically processing the third recall results by combining the context information of the query request with business constraints to obtain query results consistent with the query request.
[0107] In one embodiment, the query results can be generated by inputting the third recall result and processing configuration parameters into the processing module, which then automatically performs processing according to preset logic to obtain the query results.
[0108] Optionally, Figure 4 A flowchart of a query result generation method based on query category, provided in an embodiment of this application, is given. (Reference) Figure 4 The method for generating query results based on query categories specifically includes: S13041. When the configuration parameter is the parameter corresponding to the retrieval query, perform context expansion on the paragraph where the third recall result is located to obtain the query result corresponding to the query request.
[0109] For example, when the processing configuration parameter is the parameter corresponding to the retrieval query, the context expansion processing is performed on the paragraph where the candidate recall object in the third recall result is located to generate the query result corresponding to the final query request. The context expansion is used to supplement the relevant content of the paragraph and improve the completeness and information coverage of the query result.
[0110] In one embodiment, the method for performing context expansion on a paragraph can be: based on the structural information and contextual content of the document in which the paragraph is located, extract the preceding and following paragraphs or adjacent sentences related to the candidate recall object, merge them into the query result paragraph, and obtain the query result.
[0111] In one embodiment, the context expansion of a paragraph can be performed by combining semantic representation with semantic expansion of the paragraph containing the candidate recall object to generate a context paragraph containing more relevant information, thereby obtaining the query results.
[0112] In one embodiment, the context expansion of a paragraph can be performed by: performing rule-based extraction or automatic summarization on the paragraph containing the candidate recall object and its context according to the specific requirements of the retrieval query, and outputting the final query results.
[0113] S13042. When the configuration parameter is the parameter corresponding to the keyword query, the third recall result of the keyword with the query request is selected as the query result.
[0114] For example, when the configuration parameter is the parameter corresponding to the keyword query, keyword matching and filtering processing is performed on the third recall result to generate the query result corresponding to the final query request. Here, keyword matching is used to retain candidate recall objects containing keywords in the query request, thereby ensuring that the query result is highly relevant to the search terms entered by the user.
[0115] In one embodiment, the method for filtering objects with query request keywords can be: traversing each candidate recall object in the third recall result, determining whether its content or attributes contain the keywords in the query request, and retaining the objects that meet the conditions as query results.
[0116] In one embodiment, the method for filtering keywords with query requests can be: combining the textual semantic representation of candidate recall objects, analyzing the location and context of keyword occurrence, and dynamically determining whether to include the object in the query results.
[0117] In one embodiment, the method for filtering keywords with query requests can be: inputting the third recall result and the query request keywords into the keyword matching module, and having the module automatically filter and generate query results according to preset matching rules.
[0118] S13043. When the configuration parameter is the parameter corresponding to the comparison query, calculate the allocatable length of each document to be compared based on the number of documents to be compared in the query request, and prune the third recall result according to the allocatable length to obtain the query result.
[0119] For example, when the processing configuration parameter is the parameter corresponding to the comparison query, the allocatable length of each document to be compared is calculated based on the number of documents to be compared in the query request, and the third recall result is pruned according to the allocatable length to generate the query result corresponding to the final query request. The pruning operation is used to control the content proportion of each document to be compared in the query result to ensure the balance and readability of the comparison analysis.
[0120] In one embodiment, the cropping method may be: based on the calculated allocatable length of each document to be compared, extract paragraphs or content of the corresponding length from the third recall results to form cropped query results.
[0121] In one embodiment, the pruning method may be: inputting the third recall result, the allocatable length, and the pruning rules into the processing module, and having the module automatically perform pruning according to preset logic, and outputting the query result corresponding to the final query request.
[0122] In one embodiment, after trimming, the process further includes: adjusting the trimmed query results at the paragraph or sentence level, taking into account document structure and semantic integrity, to ensure that the trimmed query results retain core information while maintaining length control.
[0123] Optionally, Figure 5 A flowchart of a query result generation method based on recall level provided in an embodiment of this application is given. (Reference) Figure 5 The method for generating query results based on recall level specifically includes: S13044. When processing configuration parameters that correspond to summary type queries, obtain the recall level corresponding to the query request.
[0124] For example, when processing configuration parameters corresponding to summary queries, the recall level corresponding to the query request is first obtained. The recall level can indicate the scope or granularity of information to be extracted from the third recall results so as to generate summary query results corresponding to the query request in the future.
[0125] In one embodiment, the recall level can be obtained by parsing the query request based on the summary strategy or query category defined in the processing configuration parameters, and determining its corresponding recall level.
[0126] In one embodiment, the recall level can be obtained by dynamically determining the recall level by combining the context information of the query request and the historical query pattern.
[0127] In one embodiment, the recall level can be obtained by inputting the query request and processing configuration parameters into the recall level determination module, which then automatically outputs the recall level corresponding to the query request based on preset rules or models.
[0128] S13045. When the recall level is document level, obtain the full text of the document corresponding to the third recall result, summarize the length allocation and document summary of the full text of the document according to the third recall result, and obtain the query result corresponding to the query request.
[0129] For example, when the recall level is document level, the full text of the document corresponding to the third recall result is obtained. The full text of the document provides a complete content foundation for performing summary processing. After obtaining the full text of the document, the summary length is allocated according to the third recall result, and the document summary operation is performed to generate the query result corresponding to the final query request. The summary processing is used to extract the core information of the document and organize the content according to the allocated length.
[0130] In one embodiment, the method for allocating summary lengths and summarizing the full document can be as follows: based on the importance or relevance of each candidate recall object in the third recall result, assign corresponding summary lengths to different parts of the full document, and extract core sentences or paragraphs to generate query results.
[0131] In one embodiment, the method for summarizing the full text of a document and allocating the document length can be: combining semantic representation to perform semantic analysis on the full text of the document, extracting key information according to the allocated length, and generating structured or coherent query results.
[0132] In one embodiment, the method for summarizing the full text of a document and allocating the length, and summarizing the document can also be: inputting the full text of the document, the third recall result, and the length allocation strategy into the document summarization module, and having the module automatically generate query results based on preset rules or models.
[0133] S13046. When the recall level is the outline level, obtain the outline node corresponding to the third recall result, and use the complete paragraph information under the outline node as the query result corresponding to the query request.
[0134] For example, when the recall level is outline level, the outline node corresponding to the third recall result is obtained, where the outline node is used to identify the document's structural hierarchy and topic division. After obtaining the outline node, the complete paragraph information under the outline node is extracted as the query result corresponding to the query request, where the complete paragraph information is used to maintain the semantic integrity and contextual continuity of the content.
[0135] In one embodiment, the query results can be generated by directly extracting all sub-paragraphs corresponding to the outline node and organizing them in the original text order.
[0136] In one embodiment, the query results can be generated by combining the hierarchical information of the outline nodes and the importance of the paragraphs, filtering or prioritizing the paragraphs, and then outputting them as query results.
[0137] In one embodiment, the query results can be generated by inputting the outline node and its subordinate paragraph information into the content processing module, which then automatically generates the query results corresponding to the final query request based on preset rules.
[0138] Optionally, Figure 6 A flowchart illustrating the steps of a document retrieval method provided in an embodiment of this application is given. (Reference) Figure 6 The document search methods specifically include: S201, User query request input.
[0139] For example, the user's query request is first obtained, which may include text keywords, natural language questions, query instructions, or multimodal information. Text keywords are used to describe the core information points of interest to the user in a concise, discrete term form, typically consisting of one or more keywords, suitable for precise retrieval or keyword-based query scenarios. Natural language questions are used to express the user's information needs in the form of complete sentences or interrogative sentences, capable of containing richer semantic relationships and contextual information. Query instructions are used to explicitly specify the type and execution method of the query operation in a structured or semi-structured manner. Multimodal information is used to supplement or replace text query content in non-textual forms, including but not limited to images, audio, video, or their corresponding feature representations. The query request is used to characterize the user's search intent or information needs.
[0140] In one embodiment, the query request can be obtained by receiving text or voice information input by the user through a client interface and converting it into a processable query request format.
[0141] In one embodiment, the query request can be obtained by preprocessing or semantically tagging the input query in conjunction with the user's historical behavior, preference settings, or contextual information.
[0142] S202, Intent recognition.
[0143] For example, after obtaining a query request, intent recognition is performed on the query request to determine the user's specific query goal or operation requirements. Intent recognition is used to parse the semantic information and potential needs of the user's input, providing a basis for subsequent query strategy selection and parameter configuration.
[0144] In one embodiment, intent recognition can be performed by inputting a query request into a trained large language model, which then performs semantic decoding and intent analysis on the query request and outputs the corresponding query category.
[0145] In one embodiment, intent recognition can be performed by combining keyword features of the query request, contextual information, and historical interaction records, and using rule matching or machine learning methods to determine the category of the user's input query.
[0146] In one embodiment, intent recognition can be performed by inputting the query request and existing intent sample features into the intent recognition module, which then automatically infers the query category corresponding to the query request to guide subsequent query configuration and processing.
[0147] In one embodiment, intent recognition refers to performing semantic analysis on the user's input query request through a model, thereby clarifying the target and processing strategy of the query request.
[0148] In one embodiment, the user-submitted query request is first input into the Qwen-14B large language model, which leverages its powerful pre-trained language understanding capabilities to perform in-depth semantic analysis of the query. The large language model automatically identifies the core needs of the query and maps them to specific query categories, such as retrieval, summary, keyword, comparison, and summarization. Retrieval queries are defined as queries where the user wants to retrieve documents, paragraphs, or data resources related to the query content; summary queries are defined as queries where the user wants to summarize or extract information from existing text; keyword queries are defined as queries where the user wants to extract core keywords or thematic terms from the text; and comparison queries are defined as queries where the user wants to compare and analyze different objects, documents, or data items. In summary queries, a specially trained intent classifier is further invoked to subdivide the summary request into article summaries and paragraph summaries. Article summaries provide a high-level overview of the entire document, while paragraph summaries provide a partial summary of a specific paragraph or text fragment. This hierarchical identification mechanism enables accurate classification of different types of query requests, providing a foundation for subsequent retrieval, summary generation, or comparative analysis, thereby improving the accuracy and response efficiency of query processing.
[0149] S203, Intelligent Routing Decision.
[0150] For example, after identifying the user's query intent, intelligent routing decisions are performed on the query request to determine the optimal query processing path and strategy. The intelligent routing decisions are used to dynamically select the appropriate query module or processing flow based on the query category, thereby improving query efficiency and result quality.
[0151] In one embodiment, intelligent routing decision-making can be achieved by inputting the query category into the routing decision module, which then selects a suitable query processing path based on a preset routing matrix and policy rules.
[0152] In one embodiment, the intelligent routing decision-making method can also be: inputting the query category into the intelligent scheduling module, which automatically determines the processing strategy and routing path of the query request for subsequent query execution and result generation.
[0153] In one embodiment, intelligent routing decision refers to automatically selecting the optimal processing strategy based on the identified query category, thereby achieving efficient and intent-aware distribution of query requests among different processing modules.
[0154] In one embodiment, the intelligent routing decision receives query categories from the Qwen-14B intent recognition module and, based on the identified query category, searches for the corresponding optimal configuration strategy in a predefined routing decision matrix. The routing decision matrix contains carefully designed parameter combinations for each intent type, used to dynamically configure the specific strategies of subsequent processing modules.
[0155] In one embodiment, a differentiated recall weight allocation strategy is employed for different query categories. For example, for article summary queries, the recall strategy weights can be configured as follows: document-level recall strategy weight is 1.0 to ensure content completeness and structure; outline-level recall strategy weight is 0.8 to support document structure extraction; and semantic vector recall strategy weight is 0.6 to supplement semantic information. When the recall level is document-level, the primary goal is to ensure the completeness and structure of the recalled content.
[0156] In one embodiment, for different query categories, intent-aware parameter configurations are set for the subsequent RRF (Reciprocal Rank Fusion) fusion algorithm, including k-value adjustment and weight adjustment of each intent, to ensure that the fusion result can reflect the specific needs of different query categories.
[0157] In one embodiment, differentiated quality thresholds are preset for the BCE (Binary Cross Entropy) re-ranking module for different query categories. Different filtering criteria are used for different query categories. For example, the threshold is appropriately lowered in summary queries to ensure content integrity, while the threshold is increased in keyword queries to reduce noise. For instance, ranking levels can be set to include lenient, standard, and strict levels. Different thresholds are selected for filtering based on the query category. The lenient level corresponds to a lower ranking or relevance threshold, used to retain more candidate results in the recall phase or exploratory query scenarios; the standard level corresponds to a medium ranking threshold, used to achieve a balance between the number of results and relevance; and the strict level corresponds to a higher ranking or relevance threshold, used to emphasize the accuracy and consistency of results.
[0158] In one embodiment, for different query categories, corresponding processing strategies are specified for the PostProcess module to ensure that the final output meets the requirements of different query categories. The PostProcess module refers to the functional module that performs final processing and formatting of the query results output by the model or system. For example, the postprocessing strategy for article summary queries is specified as full text output, while the postprocessing strategy for paragraph summary queries is specified as full outline output, thereby ensuring that the content structure and granularity of the output match the user's expectations. Figure 1 Through the above mechanisms, the intelligent routing decision module can achieve end-to-end parameter optimization and strategy adaptation from intent recognition to recall, fusion, reordering and post-processing, thereby improving the accuracy, completeness and user experience of query results.
[0159] S204, Multi-strategy Recall.
[0160] For example, after completing the intelligent routing decision, a multi-strategy recall operation is performed on the query request to obtain the first recall result. The multi-strategy recall is used to combine different recall methods and data sources to extract candidate objects that may match the query request from multiple dimensions, thereby improving the comprehensiveness and coverage of the recall.
[0161] In one embodiment, the multi-strategy recall method can be: based on the recall configuration parameters, simultaneously execute strategies such as keyword matching recall, vector retrieval recall, rule matching recall, and historical behavior recall to obtain the first recall result corresponding to each strategy.
[0162] In one embodiment, the multi-strategy recall method can also be: inputting the query request and recall strategy configuration into the multi-strategy recall module, which automatically executes each strategy in parallel and generates the corresponding first recall result.
[0163] In one embodiment, the multi-strategy recall process further includes: combining the semantic features and contextual information of the query request to adjust the weights of each recall strategy or to combine the strategies to optimize the relevance of the first recall result.
[0164] In one embodiment, the multi-strategy recall module executes the optimal recall strategy for different query categories based on the routing decision results. It parses the strategy combinations and weight configurations output during the routing decision stage and dynamically determines the execution parameters of each recall strategy according to different query categories. Multiple independent recall strategies are executed simultaneously, including vector recall, keyword recall, and hybrid recall. Vector recall calculates similarity based on semantic vector representation, capturing deep semantic information of the text, suitable for handling summary or conceptual queries. Keyword recall performs document matching based on keyword matching and classic retrieval algorithms such as BM25 (Best Matching 25), ensuring coverage of key content, suitable for precise retrieval or short text queries. Hybrid recall combines the results of vector recall and keyword recall to balance semantic integrity and key content coverage, improving recall diversity and coverage. Each recall strategy operates independently without interference, ensuring the diversity and sufficiency of the recall results. Subsequently, the recall results from each strategy are organized into a standardized data format. Each recall result includes information such as document fragment, relevance score, and source path, providing standardized input for the subsequent RRF (Reciprocal Rank Fusion) fusion stage. This multi-strategy recall mechanism enables information retrieval for different query categories while ensuring the richness, structure, and semantic integrity of the recalled content, providing a reliable foundation for subsequent ranking and post-processing stages.
[0165] S205, Intent-based fusion ranking.
[0166] For example, after completing the multi-strategy recall, the first recall results generated by each recall strategy are subjected to intent-based fusion ranking to generate an optimized second recall result. The fusion ranking is used to integrate the candidate results of different strategies and adjust the ranking weight according to the user's query intent, thereby improving the matching degree between the candidate results and the query intent.
[0167] In one embodiment, the intent-based fusion ranking method can be as follows: based on the weight of the recall strategy and the ranking position of the candidate object under each strategy, combined with the characteristics of the query intent, the candidate objects are weighted and fused to generate a fusion score, and the second recall result is obtained by sorting according to the fusion score.
[0168] In one embodiment, the intent-based fusion ranking method can be: using a deep semantic model or a learned ranking model, the scores of candidate objects under each strategy are jointly input with the query intent vector to calculate the comprehensive ranking score and generate a second recall result after fusion ranking.
[0169] In one embodiment, the intent-based fusion ranking method can be as follows: the first recall result, the recall strategy weight, and the intent features are input into the fusion ranking module, which automatically scores and ranks the candidate objects and outputs a second recall result set that matches the intent.
[0170] In one embodiment, intent-based fusion ranking refers to using an improved RRF (Reciprocal Rank Fusion) sorter to fuse multi-way recall results, so that the final ranking considers both the comprehensive contribution between recall strategies and the differentiated weights of query intent.
[0171] In one embodiment, the recall results of each path are first obtained from the multi-strategy recall module, and the RRF algorithm parameters and weight configuration are dynamically adjusted according to the query category output in the routing decision stage. For each candidate recall object, the final fusion score is the sum of the second scores of each recall path.
[0172] in, The fusion score of the candidate recall objects. For the candidate recall targets in the first The second score corresponding to the first recall result of the route. The number of recall strategies.
[0173] Each road The calculation formula is:
[0174] in, This is a global adjustment factor based on the query category, for example, 1.0 for the retrieval category, 1.2 for the article summary category, and 0.9 for the paragraph summary category; For the first The strategy weights corresponding to the recall strategies are used to reflect the importance of different recall strategies; This is a strategy adjustment factor corresponding to the query category, used to balance the impact of high-ranking documents, such as those in the retrieval category. The value is 25, and it is a summary. It is 15; This indicates the ranking position of the candidate object in the first recall result. and The dual adjustment, incorporating differentiated considerations for query categories, addresses the issue that traditional RRF cannot reflect intent characteristics; through dynamic adjustment... This allows for a flexible balance of recall paths across different query categories. It outputs high-quality, intent-aware candidate recall results, providing reliable input for subsequent fine-tuning. Through these mechanisms, the intent-based RRF fusion ranking module can fully reflect the importance of different query intents to candidate results while ensuring recall diversity and coverage, providing customized, highly accurate ranking output for the overall retrieval system.
[0175] S206, Reorder.
[0176] For example, after completing the intent-based fusion ranking, a re-ranking operation is performed on the second recall results to generate a final optimized candidate result set, wherein the re-ranking is used to further improve the semantic matching degree or business relevance between the candidate objects and the query request.
[0177] In one embodiment, the reordering method may be to input the candidate objects in the second recall result and the query request into a deep semantic model or a ranking model, and reorder the candidate objects based on semantic similarity or learned ranking score.
[0178] In one embodiment, the reordering method may be to dynamically adjust the order of candidate objects in the second recall result by combining the context information of the query request and user preferences, so as to generate a final candidate result set that meets the user's needs.
[0179] In one embodiment, the re-ranking method may be: inputting the second recall result and the re-ranking strategy into the re-ranking module, which automatically calculates the final ranking according to preset rules or models, and outputs an optimized set of candidate results for subsequent screening and processing.
[0180] In one embodiment, candidate results from an intent-based RRF fusion ranking module are received and processed using a deep semantic ranking algorithm, such as BCE-Reranker (Binary Cross-Entropy Reranker, a reranking model based on binary cross-entropy loss) or Qwen-Reranker (Tongyi Qianwen Large Language Model-Reranker, a reranking model based on the Tongyi Qianwen Large Language Model). BCE-Reranker is a deep semantic ranking algorithm based on BCE (Binary Cross-Entropy), while Qwen-Reranker is a deep semantic ranking algorithm based on Qwen (Tongyi Qianwen Large Language Model). Semantic matching is calculated for each candidate recall object, considering the deep semantic relevance between the query request and the candidate content. BCE-Reranker is trained using a binary cross-entropy loss function to determine the degree of matching between candidate content and the query; Qwen-Reranker leverages the semantic understanding capabilities of the large language model to further capture complex contexts and conceptual relationships. During the re-ranking process, differentiated quality thresholds provided by the intelligent routing decision module are used to filter the re-ranking results. Different thresholds are used for different query intents; for example, the threshold for summary queries may be lowered to ensure information integrity, while the threshold for keyword queries may be raised to reduce noise. Through threshold filtering, high-quality candidate results that are highly relevant to the query intent are retained. The re-ranked candidate documents or fragments are finally sorted according to the re-ranking score and intent weight. The output results take into account both semantic relevance and the specific needs of the query intent type, providing reliable and accurate search results for end users. Through this re-ranking mechanism, the accuracy and usability of the results can be further improved on the basis of multi-strategy recall and RRF fusion, realizing a complete search optimization process from coarse ranking to fine ranking.
[0181] S207, Post-processing.
[0182] For example, after the reordering is completed, post-processing operations are performed on the candidate results to generate the final query results. The post-processing is used to format, deduplicate, supplement information or perform other business rule processing on the candidate objects, thereby improving the completeness, readability and applicability of the query results.
[0183] In one embodiment, the post-processing method may be to perform content filtering, paragraph merging, or information supplementation on the candidate objects according to the processing configuration parameters, and generate query results.
[0184] In one embodiment, post-processing can be performed by tailoring, summarizing, or formatting candidate objects according to specific rules based on the type of query request or query intent, in order to meet the needs of different query scenarios.
[0185] In one embodiment, the post-processing method may be: inputting the reordering results and post-processing configuration parameters into the post-processing module, which then automatically performs processing operations according to preset logic and outputs the final query results available to the user.
[0186] In one embodiment, the post-processing stage is the final step in the intelligent query routing system. Its core function is to perform differentiated optimization processing on the retrieved or generated results based on the query category. This stage first obtains the query category, such as retrieval, article summary, paragraph summary, keyword extraction, and comparative analysis, and then selects the corresponding post-processing strategy according to the query category. For retrieval queries, paragraph integrity is completed for candidate documents to ensure that the retrieval results are coherent and cover the query information, extracting direct answers or key content to improve the efficiency of users obtaining information. For summary queries, multiple candidate documents or paragraphs are fully integrated to form a structured output, preserving the document's logical structure and semantic integrity to support article-level or paragraph-level summary requirements. For keyword queries, candidate text is highlighted with keywords, and keyword frequency or weight information is provided to ensure that users can quickly identify core information. For comparison queries, multiple documents or fragments are integrated and compared to generate a comparison view or comparison summary, supporting the display of multiple document attributes, content differences, or rating differences. The post-processing stage can also employ general optimization mechanisms, including content deduplication, length control, and format standardization, to ensure the final output's standardization, readability, and completeness. Through this intent-aware post-processing mechanism, accurate, complete, and personalized results that match the query intent can be generated, significantly improving the user experience. This mechanism is a key innovation that distinguishes this invention from traditional retrieval systems, and it is particularly suitable for diverse document processing and information retrieval needs in office scenarios.
[0187] Based on the above embodiments, Figure 7 This is a structural block diagram of a document retrieval device provided in an embodiment of this application. (Reference) Figure 7 The document query device provided in this embodiment specifically includes: a query identification module 11, a query configuration module 12, and a document query module 13.
[0188] The query identification module 11 is configured to receive query requests and determine the corresponding query category based on the query request; the query configuration module 12 is configured to determine query configuration parameters based on the query category; and the document query module 13 is configured to perform document queries using the query configuration parameters and obtain the query results corresponding to the query request.
[0189] Based on the above embodiments, the query recognition module 11 includes a query category unit, which is configured to input the query request into the trained large language model, perform semantic decoding and intent recognition on the query request, and obtain the query category corresponding to the query request.
[0190] Based on the above embodiments, the query configuration module 12 includes: a configuration parameter unit, configured to match corresponding query configuration parameters in a pre-set routing matrix according to the query category, wherein the query configuration parameters include recall configuration parameters, fusion configuration parameters, filtering configuration parameters, and processing configuration parameters; the document query module 13 includes: a first recall unit, configured to execute multiple corresponding recall strategies according to the recall configuration parameters to obtain multiple first recall results corresponding to the multiple recall strategies; a second recall unit, configured to merge and sort the multiple first recall results according to the recall configuration parameters and fusion configuration parameters to obtain second recall results; a third recall unit, configured to filter the second recall results according to the filtering configuration parameters to obtain third recall results; and a query result unit, configured to process the third recall results according to the processing configuration parameters to obtain the query result corresponding to the query request.
[0191] Based on the above embodiments, the second recall unit includes: a fusion score subunit, configured to perform fusion calculation on each candidate recalled object in multiple first recall results according to recall configuration parameters and fusion configuration parameters to obtain a fusion score for each candidate recalled object; a candidate ranking subunit, configured to rank each candidate recalled object according to the fusion score to obtain a candidate ranking result; and a re-ranking subunit, configured to perform deep semantic re-ranking on the candidate ranking result to obtain a second recall result.
[0192] Based on the above embodiments, the recall configuration parameters include multiple recall strategies and their corresponding strategy weights, and the fusion configuration parameters include a strategy adjustment factor, which is used to control the influence of the ranking position of the candidate recalled object on the fusion score according to the query category; the fusion score subunit includes: a ranking position component, configured to obtain the ranking position of each candidate recalled object in each of the multiple first recall results; a first score component, configured to generate a first score corresponding to each candidate recalled object in each first recall result according to each ranking position and the strategy adjustment factor; and a fusion score component, configured to calculate the fusion score of the candidate recalled object according to each first score and the strategy weight of its corresponding recall strategy.
[0193] Based on the above embodiments, the fusion configuration parameters also include a global adjustment factor, which is used to proportionally adjust the fusion score according to the query category; the fusion score component also includes: a second score sub-component, configured to multiply each first score by the corresponding recall strategy weight and the global adjustment factor to generate a second score for the candidate recall object under each recall strategy; and a merging score sub-component, configured to merge and calculate the second scores to obtain the fusion score of the candidate recall object.
[0194] Based on the above embodiments, the third recall unit includes a score filtering subunit, which is configured to filter candidate recall objects in the second recall result whose fusion score is greater than the filtering configuration parameter as the third recall result.
[0195] Based on the above embodiments, the query result unit includes: a retrieval recall subunit, configured to perform context expansion on the paragraph containing the third recall result when the configuration parameter is the parameter corresponding to the retrieval query, to obtain the query result corresponding to the query request; a keyword recall subunit, configured to filter the third recall result containing the keyword of the query request as the query result when the configuration parameter is the parameter corresponding to the keyword query; and a comparison recall subunit, configured to calculate the allocatable length of each document to be compared based on the number of documents to be compared in the query request, and prune the third recall result according to the allocatable length to obtain the query result when the configuration parameter is the parameter corresponding to the comparison query.
[0196] Based on the above embodiments, the query result unit includes: a recall level subunit, configured to obtain the recall level corresponding to the query request when the processing configuration parameter is the parameter corresponding to the summary query; a document recall subunit, configured to obtain the full text of the document corresponding to the third recall result when the recall level is document level, and to perform summary length allocation and document summary on the full text of the document according to the third recall result to obtain the query result corresponding to the query request; and an outline recall subunit, configured to obtain the outline node corresponding to the third recall result when the recall level is outline level, and to use the complete paragraph information under the outline node as the query result corresponding to the query request.
[0197] The document query device provided in this application embodiment, as described above, constructs a collaborative processing architecture consisting of a query identification module, a query configuration module, and a document query module, realizing an end-to-end document query chain from receiving query requests and parsing query categories to generating query results. This device can efficiently integrate semantic understanding and configuration decision information in scenarios where users submit query requests. Through the process of query category identification, configuration parameter generation, and document retrieval execution, it improves the accuracy and response efficiency of query results. Specifically, the query identification module receives query requests submitted by users and determines the corresponding query category based on the query content and context information, providing semantic guidance for subsequent processing; the query configuration module generates corresponding query configuration parameters based on the identified query category, including recall strategies, ranking strategies, and post-processing strategies, to achieve differentiated configuration for different query intentions; the document query module uses the query configuration parameters to perform document retrieval or processing operations, obtains high-quality query results corresponding to the query request, and outputs them in a preset format for subsequent system use or direct feedback to the user. Through the orderly collaboration of the above modules, the device constructs a complete chain from query request parsing and intent-aware configuration to the generation of accurate document query results, significantly improving the intelligence level and response efficiency of the document query system while ensuring query accuracy.
[0198] The document query device provided in this application embodiment can be used to execute the document query method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0199] Figure 8 This is a schematic diagram of the structure of a document retrieval device provided in an embodiment of this application, for reference. Figure 8 The document retrieval device includes a processor 21, a memory 22, a communication device 23, an input device 24, and an output device 25. The document retrieval device may have one or more processors 21 and one or more memory units 22. The processor 21, memory 22, communication device 23, input device 24, and output device 25 of the document retrieval device can be connected via a bus or other means.
[0200] The memory 22, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the document query method in any embodiment of this application (e.g., query identification module 11, query configuration module 12, and document query module 13 in the document query device). The memory 22 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory 22 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0201] The communication device 23 is used for data transmission.
[0202] The processor 21 executes various functional applications of the device and document queries by running software programs, instructions and modules stored in the memory 22, thereby implementing the document query method described above.
[0203] Input device 24 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 25 may include display devices such as a display screen.
[0204] The document query device provided above can be used to execute the document query method provided in the above embodiments, and has corresponding functions and beneficial effects.
[0205] This application also provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform a document query method. The document query method includes: receiving a query request; determining a corresponding query category based on the query request; determining query configuration parameters based on the query category; and performing a document query using the query configuration parameters to obtain the query result corresponding to the query request.
[0206] Storage medium—any type of memory device or storage device. The term "storage medium" is intended to include: mounting media, such as CD-ROM, floppy disk, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. Storage medium may also include other types of memory or combinations thereof. Furthermore, storage medium may reside in a first computer system in which a program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). Storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.
[0207] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the document query method described above, but can also perform related operations in the document query method provided in any embodiment of this application.
[0208] The document query device, storage medium, and document query equipment provided in the above embodiments can execute the document query method provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the document query method provided in any embodiment of this application.
[0209] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application. The scope of this application is determined by the scope of the claims.
Claims
1. A document retrieval method, characterized in that, include: Receive a query request and determine the corresponding query category based on the query request; Determine the query configuration parameters based on the query category; The document is queried using the query configuration parameters to obtain the query results corresponding to the query request.
2. The document query method according to claim 1, characterized in that, Determining the corresponding query category based on the query request includes: The query request is input into the trained large language model, and semantic decoding and intent recognition are performed on the query request to obtain the query category corresponding to the query request.
3. The document query method according to claim 1, characterized in that, The step of determining the query configuration parameters based on the query category includes: Based on the query category, the corresponding query configuration parameters are matched in a pre-set routing matrix. The query configuration parameters include recall configuration parameters, fusion configuration parameters, filtering configuration parameters, and processing configuration parameters. The process of using the query configuration parameters to perform a document query and obtain the query results corresponding to the query request includes: Execute multiple corresponding recall strategies according to the recall configuration parameters to obtain multiple first recall results corresponding to the multiple recall strategies; Based on the recall configuration parameters and the fusion configuration parameters, multiple first recall results are fused and sorted to obtain a second recall result; The second recall result is filtered according to the filtering configuration parameters to obtain the third recall result; The third recall result is processed according to the processing configuration parameters to obtain the query result corresponding to the query request.
4. The document query method according to claim 3, characterized in that, The step of fusing and sorting multiple first recall results according to the recall configuration parameters and the fusion configuration parameters to obtain a second recall result includes: Based on the recall configuration parameters and the fusion configuration parameters, a fusion calculation is performed on each candidate recall object in the multiple first recall results to obtain a fusion score for each candidate recall object; Each candidate recall object is sorted according to the fusion score to obtain the candidate sorting result; The candidate ranking results are subjected to deep semantic re-ranking to obtain the second recall result.
5. The document query method according to claim 4, characterized in that, The recall configuration parameters include multiple recall strategies and their corresponding strategy weights. The fusion configuration parameters include a strategy adjustment factor, which is used to control the impact of the sorting position of the candidate recall objects on the fusion score according to the query category. The step of performing a fusion calculation on each candidate recalled object in the plurality of first recalled results according to the recall configuration parameters and the fusion configuration parameters to obtain a fusion score for each candidate recalled object includes: For each candidate object in the multiple first recall results, perform the following processing: Obtain the sorting position of the candidate recall object in each of the first recall results; Based on each of the sorting positions and the strategy adjustment factors, generate the first score corresponding to each candidate recall object in each of the first recall results; The fusion score of the candidate recall object is calculated based on each of the first scores and the strategy weights of the corresponding recall strategies.
6. The document query method according to claim 5, characterized in that, The fusion configuration parameters also include a global adjustment factor, which is used to proportionally adjust the fusion score according to the query category; The step of calculating the fusion score of the candidate recall object based on each of the first scores and the corresponding strategy weights of the recall strategy includes: Each first score is multiplied by the corresponding recall strategy weight and the global adjustment factor to generate the second score of the candidate recall object under each recall strategy. The second score is combined to obtain the fusion score of the candidate recall object.
7. The document query method according to claim 3, characterized in that, The step of filtering the second recall result according to the filtering configuration parameters to obtain the third recall result includes: Candidates whose fusion score is greater than the filtering configuration parameter in the second recall result are selected as the third recall result.
8. The document query method according to claim 3, characterized in that, The step of processing the third recall result according to the processing configuration parameters to obtain the query result corresponding to the query request includes: When the processing configuration parameters are the parameters corresponding to the retrieval query, context expansion is performed on the paragraph where the third recall result is located to obtain the query result corresponding to the query request; When the processing configuration parameters are the parameters corresponding to keyword-type queries, the third recall results containing the keywords of the query request are filtered as the query results; When the processing configuration parameters are the parameters corresponding to the comparison query, the allocatable length of each document to be compared is calculated based on the number of documents to be compared in the query request, and the third recall result is pruned according to the allocatable length to obtain the query result.
9. The document query method according to claim 3, characterized in that, The step of processing the third recall result according to the processing configuration parameters to obtain the query result corresponding to the query request includes: When the processing configuration parameters are the parameters corresponding to the summary type query, obtain the recall level corresponding to the query request; When the recall level is document level, the full text of the document corresponding to the third recall result is obtained, and the full text of the document is summarized and the document is summarized according to the third recall result to obtain the query result corresponding to the query request. When the recall level is the outline level, the outline node corresponding to the third recall result is obtained, and the complete paragraph information under the outline node is used as the query result corresponding to the query request.
10. A document retrieval device, characterized in that, include: The query identification module is used to receive query requests and determine the corresponding query category based on the query requests. The query configuration module is used to determine query configuration parameters based on the query category. The document query module is used to perform document queries using the query configuration parameters and obtain the query results corresponding to the query request.