An adaptive classification retrieval enhanced generation model system and method
The generative model system is enhanced through adaptive classification retrieval. By splitting and classifying user queries, determining processing methods, obtaining relevant information and optimizing system performance, it solves the problem of insufficient efficiency and accuracy of traditional models in processing diverse user requests, and achieves A more efficient and accurate question and answer system.
Patent Information
- Application Number
- CN202410953917.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-17
Smart Images

Figure CN118503393B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence technology, and in particular relates to an adaptive classification retrieval enhanced generation model system and method. Background Art
[0002] In the field of intelligent technology and language processing, enhanced language models that integrate non-parametric knowledge have become key tools for information retrieval and knowledge management. These advanced tools focus on parsing users' complex queries and providing accurate and relevant answers. Thanks to advanced retrieval enhancement algorithms such as single-step retrieval and multi-step retrieval, these systems have shown excellent performance in handling open domain problems. They are able to generate coherent and rich replies by combining the model's inherent parameter memory with external dynamic knowledge.
[0003] Although large language models perform well in handling highly complex question-answering tasks, they still face many challenges in dealing with diverse user requests in the real world. Real documents usually contain tasks of varying complexity, covering both complex and simple information in user requests. In the past, when faced with such problems, enhanced language models had difficulty choosing appropriate enhancement algorithms due to the lack of clear guidance strategies. This may result in the model being unable to fully understand the structure and context of the document, which affects its generation efficiency and consumes too many computing resources. Therefore, traditional models still have shortcomings in terms of accuracy and efficiency of answers. Summary of the invention
[0004] The present invention aims at solving the problems in the prior art, and the technical solution adopted in this application is as follows:
[0005] In a first aspect, the present invention provides an adaptive classification retrieval enhanced generation model system, characterized by comprising: a query splitting module, a classifier module, a processing module, a user interaction module and an evaluation and optimization module;
[0006] The user interaction module is used to receive the user's original query and display the generated answer;
[0007] The query splitting module is used to split the original query received by the user interaction module into multiple equivalent queries;
[0008] The classifier module is used to classify the split equivalent queries, determine the different processing methods to which they belong, and based on the judgment result of the classifier, select the path containing the most equivalent queries as the processing method for the user's original query;
[0009] The processing module is used to gradually obtain relevant information according to the selected processing method and finally generate a complete answer;
[0010] The evaluation and optimization module is responsible for collecting and analyzing user feedback and system performance data, evaluating system accuracy and user experience, and performing targeted system optimization.
[0011] Furthermore, the user interaction module includes a user interface design unit, a query interpretation and feedback unit, a personalized customization unit and a multi-terminal adaptation unit;
[0012] User interface design units are used to access and operate systems;
[0013] The query explanation and feedback unit is used to display query results, improvement suggestions and error prompt information;
[0014] The personalization unit is used to customize interface settings and search preferences;
[0015] The multi-terminal adaptation unit is used to enable the system to be used on different terminal devices, and optimize the interface layout and interaction method according to different screen sizes and operating habits.
[0016] Further, the query splitting module includes a query analysis unit, a synonym and syntax transformation processing unit, a query generation unit and a query effect evaluation unit;
[0017] The query analysis unit is used to conduct in-depth analysis of the user's original query, using the hidden Markov model and conditional random field lexical analysis model to identify the keywords, intent and context in the query;
[0018] The synonym and syntactic transformation processing unit uses a rich synonym library and syntactic transformation rules to rewrite the original query;
[0019] The query generation unit is responsible for generating multiple new query expressions based on the replaced and transformed data;
[0020] The query effect evaluation unit performs effect evaluation on the generated query variants.
[0021] Further, the classifier module includes a query complexity analysis unit, a classification processing method unit and a processing method selection unit;
[0022] The query complexity analysis unit is used to evaluate the content and intent of each query variant and determine its complexity level;
[0023] The classification processing method unit is used to classify queries into four different processing methods including non-retrieval method, single-step retrieval method, multi-step retrieval method and knowledge graph method according to the results of complexity analysis;
[0024] The processing method selection unit counts the number of query variants matching the user query under each processing method based on the judgment result of the classification processing method, and selects the method containing the most equivalent queries as the optimal strategy for processing the user's original query.
[0025] Further, the processing module includes an information acquisition and data retrieval unit and an answer generation unit;
[0026] The information acquisition and data unit is used to extract documents or knowledge graphs related to the original query from external databases or knowledge base systems to ensure accurate and relevant information is obtained;
[0027] The answer generation unit uses advanced natural language processing technology to generate specific answers to user queries based on the collected data.
[0028] Furthermore, the evaluation and optimization module includes a performance evaluation unit, an algorithm and process optimization unit, a resource management and scheduling unit, and an automated optimization strategy unit;
[0029] The performance evaluation unit is responsible for monitoring the performance indicators of the system during operation, such as response time, user experience, and resource utilization;
[0030] The algorithm and process optimization unit accelerates the knowledge integration and reasoning process by improving the data processing process and algorithm parallelization;
[0031] The resource management and scheduling unit is used to manage the computing resources and storage space required by the system to avoid resource waste;
[0032] The automated optimization unit enables the system to develop automated optimization strategies and mechanisms to automatically adjust parameters and configurations according to different scenarios and requirements.
[0033] In a second aspect, the present invention provides a working method of the adaptive classification retrieval enhanced generation model system as described in the first aspect, comprising:
[0034] Receive the user's original query through the user interaction module and display the generated answer;
[0035] Splitting the original query received by the user interaction module into multiple equivalent queries through the query splitting module;
[0036] The split equivalent queries are classified through the classifier module to determine the different processing methods to which they belong. Based on the judgment result of the classifier, the path containing the most equivalent queries is selected as the processing method for the user's original query;
[0037] Through the processing module, the relevant information is gradually obtained according to the selected processing method, and finally a complete answer is generated;
[0038] The evaluation and optimization module collects and analyzes user feedback and system performance data, evaluates system accuracy and user experience, and performs targeted system optimization.
[0039] Compared with the prior art, the advantages and positive effects of the present invention are:
[0040] The present invention proposes a system of adaptive classification retrieval enhanced generation model (AC-RAG), which effectively identifies the complexity of different tasks and determines their corresponding processing methods by integrating a classifier module. This method optimizes the understanding and application efficiency of enhanced generation technology. The AC-RAG system combines advanced RAG technology with specially adjusted classification algorithms, which not only improves the accuracy of questions and answers, but also increases the processing speed and significantly reduces the consumption of operating resources. Therefore, the AC-RAG system provides a more efficient and accurate solution for complex queries and answers in various practical application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0042] Figure 1 It is a structural schematic diagram of the adaptive classification retrieval enhanced generation model system of the present invention;
[0043] Figure 2 is a structural schematic diagram of a user interaction module of the present invention;
[0044] Figure 3 It is a structural schematic diagram of the query splitting module of the present invention;
[0045] Figure 4 It is a structural schematic diagram of the classifier module of the present invention;
[0046] Figure 5 It is a structural schematic diagram of the processing module of the present invention;
[0047] Figure 6 It is a structural schematic diagram of the evaluation and optimization module of the present invention. DETAILED DESCRIPTION
[0048] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described below in conjunction with the accompanying drawings and embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways than those described herein. Therefore, the present invention is not limited to the specific embodiments of the following disclosure.
[0050] Embodiment 1, as Figure 1 to Figure 6 As shown, this application proposes an Adaptive Classification-RAG (AC-RAG) system, which aims to optimize the efficiency and accuracy of the question-answering system. The core of the AC-RAG system is to combine the retrieval enhancement generation (RAG) technology with the fine-tuned large language model (LLM), while using a query splitting module to generate multiple similar queries, and introducing a classifier module to determine different query processing methods.
[0051] The AC-RAG system consists of the following key modules:
[0052] Query splitting module: responsible for generating several similar or equivalent statements based on the user's original query. This module uses a variety of techniques, including synonym replacement, syntactic transformation, etc., to split the original query into multiple similar queries.
[0053] Classifier module: used to classify the split equivalent queries and determine the different processing methods they belong to, including non-retrieval method, single-step retrieval method, multi-step retrieval method and knowledge graph method. Based on the judgment results of the classifier, the path containing the most equivalent queries is selected as the processing method for the user's original query.
[0054] Processing module: According to the selected processing method, relevant information is gradually obtained and finally a complete answer is generated.
[0055] User interaction module: used to receive the user's original query and display the generated answer.
[0056] Evaluation and Optimization Module: Responsible for collecting user feedback and system performance data. By analyzing this data, the accuracy of the system and user experience are evaluated, and targeted system optimization is performed.
[0057] The main steps are as follows:
[0058] The user inputs the original query into the system. After receiving the user's query, the query splitting module generates several queries that are equivalent or similar to the original query by using synonym transformation or syntactic transformation. These query variants are then sent to the classifier module for classification to determine the different processing methods to which each query belongs. Based on the judgment results of the classifier, the system selects the method that contains the most equivalent queries as the processing method for the user's original query. Subsequently, the processing module gradually obtains relevant information according to the selected method to generate the final answer. The user interaction module is the starting point and end point of the process. It is responsible for receiving the user's original query and presenting the final answer generated by the system. Users can also interact with the system through this module, such as providing feedback or making further queries. The evaluation and optimization module is responsible for collecting user feedback and system performance data, and making optimization suggestions for the system based on the evaluation results. These suggestions will be fed back to all other modules.
[0059] The present invention mainly includes the following different module functions:
[0060] The user interaction module consists of four main parts: user interface design unit, query interpretation and feedback unit, personalized customization unit and multi-terminal adaptation unit. The user interface design unit enables users to easily access and operate the system by designing an intuitive interface. The query interpretation and feedback unit is responsible for displaying information such as query results, improvement suggestions and error prompts to help users understand how the system handles queries and allow users to provide satisfactory feedback on the results. The personalized customization unit supports users to customize interface settings and search preferences according to their preferences and needs. The multi-terminal adaptation unit ensures that users can use the system conveniently on different terminal devices, and optimizes the interface layout and interaction methods according to different screen sizes and operating habits to improve the user experience. Figure 2 .
[0061] The query splitting module consists of several parts: query analysis unit, synonym and syntax transformation processing unit, query generation unit and query effect evaluation unit. The core task of this module is to generate a series of similar or equivalent query expressions based on the user's original query. The query analysis unit conducts in-depth analysis of the user's original query, and uses lexical analysis models such as hidden Markov model (HMM) and conditional random field (CRF) to identify keywords, intent and context in the query, providing a basis for subsequent transformation. The synonym and syntax transformation unit uses a rich synonym library and syntax transformation rules to rewrite the original query. For example, the original query is "How to improve English writing skills?", where the keyword "writing skills" can be replaced with "writing ability" using the synonym library, and the syntax "How to improve...?" can be replaced with "What are the methods to improve...?" using syntax transformation. The query generation unit is responsible for generating multiple new query expressions based on the replaced and transformed data. For example, the two new query expressions generated by the above query are "How to improve English writing ability?" and "What are the methods to improve English writing skills". These queries are designed to cover as many possible interpretations of the original query as possible, increasing the accuracy of the system's understanding and response to user queries. The query effect evaluation unit will finally evaluate the effectiveness of the generated query variants. By calculating the semantic similarity between the variant and the original query and judging through the large model, it ensures that each newly generated query has sufficient relevance to the original query. Figure 3 .
[0062] The classifier module consists of several key parts: query complexity analysis, classification of processing methods, and processing method selection. This module is mainly responsible for receiving query variants generated by the query splitting module and using the class operation model, a specially trained small model, to conduct in-depth analysis and classification. Query complexity analysis evaluates the content and intent of each query variant and determines its complexity level. This process involves evaluating the query context, difficulty, and possible processing strategies. The classification of processing methods is the core of the module. According to the results of complexity analysis, queries are classified into four different processing methods including non-retrieval methods, single-step retrieval methods, multi-step retrieval methods, and knowledge graph methods. This model uses advanced machine learning technology to ensure accurate and efficient classification. The processing method selection stage is based on the judgment results of the classification processing method, counting the number of query variants that match the user's query under each processing method, and selecting the method with the most equivalent queries as the optimal strategy for processing the user's original query. For example, if an original query has ten variants, six of which are classified as single-step retrieval methods, two are classified as multi-step retrieval methods, and two are classified as knowledge graph methods, then the single-step retrieval method is selected as the optimal strategy for the original query. See Figure 4 .
[0063] The processing module is part of the core of the system, which mainly includes the information acquisition and data retrieval unit, the answer generation unit and the information integration unit. This module is started after the classifier module determines the non-retrieval method, single-step retrieval method, multi-step retrieval method or knowledge graph method as the processing strategy. In the information acquisition and data retrieval unit, documents or knowledge graphs related to the original query are extracted from the external database or knowledge base system to ensure that accurate and relevant information is obtained. At the same time, access to multiple data sources is monitored and optimized to improve the efficiency and accuracy of information retrieval. The answer generation unit uses advanced natural language processing technology to generate specific answers to user queries through a large language model based on the collected data and combined with prompt engineering. The information integration unit integrates and stores queries, retrieval information, and answers, which can be used as historical conversations. Figure 5 .
[0064] The evaluation and optimization module consists of four main parts: performance evaluation unit, algorithm and process optimization unit, resource management and scheduling unit, and automated optimization strategy unit. The performance evaluation unit is responsible for monitoring the performance indicators of the system during operation, such as response time, user experience, resource utilization, etc. Through real-time analysis, it identifies potential performance bottlenecks and problems, and provides data support for system optimization. The algorithm and process optimization unit accelerates the knowledge integration and reasoning process by improving the data processing process and algorithm parallelism. The resource management and scheduling unit manages the computing resources and storage space required by the system to avoid waste of resources. The automated optimization unit generates multiple modules by integrating multiple data processing and model training methods, so that the system can develop automated optimization strategies and mechanisms through module combination, thereby automatically adjusting parameters and configurations according to different scenarios and needs. Such as Figure 6 .
[0065] In order to better understand the adaptive classification retrieval enhanced generation model (AC-RAG) system of the present invention, we take an automated customer service as an example to illustrate its implementation process.
[0066] Query splitting module: Receives the initial query from the user and applies a lexical analysis model to identify keywords, intent, and context in the query, generating multiple similar or equivalent query versions. For example, the original query "I want to check the order status" is converted into "I want to check the order", "Please help me retrieve the order information", and other variants.
[0067] Classifier module: All query variants generated are fed into the classifier module for classification. The classifier determines the complexity level of the query based on its content and intent and categorizes it into different treatments, including:
[0068] Non-retrieval methods: directly answer user queries without retrieving information from a database or knowledge base.
[0069] Single-step search method: Get the answer through one search.
[0070] Multi-step search method: multiple searches are required to obtain a complete answer.
[0071] Knowledge graph method: processing method based on knowledge graph.
[0072] Based on the judgment result of the classifier, the system counts the number of query variants that match the user's query under each processing method, and selects the method that contains the most equivalent queries as the processing method for the user's original query. For example, if the original query "I want to query the order status" is determined to be suitable for the "single-step retrieval method" by classifying the variants of the user's original query, this method is transmitted to the processing module, and the system proceeds to the next step.
[0073] Processing module: After the processing method is selected, the system's processing module begins to gradually obtain relevant information. For example, when a user asks about the order status, the system will process the original query based on the "single-step retrieval method", such as querying the order database and returning detailed order information.
[0074] User Interaction Module: Users submit queries through the user interface, and the system displays the generated answers. Users can provide feedback on the answers generated by the system, such as confirming the accuracy of the answers or asking further questions. This feedback can be collected through the user interaction module and used to optimize system performance.
[0075] Evaluation and Optimization Module: The evaluation and optimization module is responsible for collecting user feedback and system performance data, and making optimization suggestions for the system based on the evaluation results. These optimization suggestions may include improving the query splitting algorithm, optimizing classifier performance, or updating the knowledge base content.
[0076] Through the collaborative work of the above modules, the AC-RAG system can realize automated customer service, improve response speed and accuracy of problem solving, while reducing the burden on the manual customer service team.
[0077] The above description is only a preferred embodiment of the present invention and does not limit the present invention in other forms. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. An adaptive classification retrieval enhanced generation model system, characterized in that: include: Query splitting module, classifier module, processing module, user interaction module and evaluation and optimization module; The user interaction module is used to receive the user's original query and display the generated answer; The query splitting module is used to split the original query received by the user interaction module into multiple equivalent queries; The classifier module is used to classify the split equivalent queries, determine the different processing methods to which they belong, and based on the judgment result of the classifier, select the path containing the most equivalent queries as the processing method for the user's original query; The classifier module includes a query complexity analysis unit, a classification processing method unit and a processing method selection unit; The query complexity analysis unit is used to evaluate the content and intent of each query variant and determine its complexity level; The classification processing method unit is used to classify queries into four different processing methods including non-retrieval method, single-step retrieval method, multi-step retrieval method and knowledge graph method according to the results of complexity analysis; The processing method selection unit counts the number of query variants matching the user query under each processing method based on the judgment result of the classification processing method, and selects the method containing the most equivalent queries as the optimal strategy for processing the user's original query; The processing module is used to gradually obtain relevant information according to the selected processing method and finally generate a complete answer; The evaluation and optimization module is responsible for collecting and analyzing user feedback and system performance data, evaluating system accuracy and user experience, and performing targeted system optimization.
2. The adaptive classification retrieval enhanced generation model system according to claim 1, characterized in that: The user interaction module includes a user interface design unit, a query interpretation and feedback unit, a personalized customization unit and a multi-terminal adaptation unit; User interface design units are used to access and operate systems; The query explanation and feedback unit is used to display query results, improvement suggestions and error prompt information; The personalization unit is used to customize interface settings and search preferences; The multi-terminal adaptation unit is used to enable the system to be used on different terminal devices, and optimize the interface layout and interaction method according to different screen sizes and operating habits.
3. The adaptive classification retrieval enhanced generation model system according to claim 1, characterized in that: The query splitting module includes a query analysis unit, a synonym and syntax transformation processing unit, a query generation unit and a query effect evaluation unit; The query analysis unit is used to conduct in-depth analysis of the user's original query, using the hidden Markov model and conditional random field lexical analysis model to identify the keywords, intent and context in the query; The synonym and syntactic transformation processing unit uses a rich synonym library and syntactic transformation rules to rewrite the original query; The query generation unit is responsible for generating multiple new query expressions based on the replaced and transformed data; The query effect evaluation unit performs effect evaluation on the generated query variants.
4. The adaptive classification retrieval enhanced generation model system according to claim 1, characterized in that: The processing module includes an information acquisition and data retrieval unit and an answer generation unit; The information acquisition and data unit is used to extract documents or knowledge graphs related to the original query from external databases or knowledge base systems to ensure accurate and relevant information is obtained; The answer generation unit uses advanced natural language processing technology to generate specific answers to user queries based on the collected data.
5. The adaptive classification retrieval enhanced generation model system according to claim 1, characterized in that: The evaluation and optimization module includes a performance evaluation unit, an algorithm and process optimization unit, a resource management and scheduling unit, and an automated optimization strategy unit; The performance evaluation unit is responsible for monitoring the performance indicators of the system during operation, including response time, user experience, and resource utilization; The algorithm and process optimization unit accelerates the knowledge integration and reasoning process by improving the data processing process and algorithm parallelization; The resource management and scheduling unit is used to manage the computing resources and storage space required by the system to avoid resource waste; The automated optimization unit enables the system to develop automated optimization strategies and mechanisms to automatically adjust parameters and configurations according to different scenarios and requirements.
6. A working method of the adaptive classification retrieval enhanced generation model system according to any one of claims 1 to 5, characterized in that: include: Receive the user's original query through the user interaction module and display the generated answer; Splitting the original query received by the user interaction module into multiple equivalent queries through the query splitting module; The split equivalent queries are classified through the classifier module to determine the different processing methods to which they belong. Based on the judgment result of the classifier, the path containing the most equivalent queries is selected as the processing method for the user's original query; Through the processing module, the relevant information is gradually obtained according to the selected processing method, and finally a complete answer is generated; The evaluation and optimization module collects and analyzes user feedback and system performance data, evaluates system accuracy and user experience, and performs targeted system optimization.
