Self-adaptive routing and decision-making method and device based on large-model intelligent question and answer
By dynamically selecting retrieval strategies through a dual-classifier architecture, the problem of adapting to simple and complex questions in open-domain question answering is solved, thereby improving the system's response efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-10
AI Technical Summary
Existing adaptive retrieval methods cannot effectively distinguish between simple and complex questions in open-domain question answering, resulting in an imbalance between efficiency and accuracy and failing to achieve differentiated adaptation.
A dual-classifier architecture is adopted, including a problem decoupling classifier and a policy routing classifier. By performing binary classification of the problem and semantic feature analysis, an appropriate retrieval generation strategy is dynamically selected.
It enables refined judgment of question-and-answer complexity, improves the response efficiency of simple queries and the accuracy of complex queries, and ensures the system's efficient and accurate answers.
Smart Images

Figure CN121833882A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of natural language processing and machine learning technology, specifically relating to an adaptive routing and decision-making method and apparatus based on large-model intelligent question answering. Background Technology
[0002] In open-domain question answering (QA) and complex reasoning tasks, accurately assessing the complexity of user questions is crucial for determining the efficiency and quality of subsequent processing. Question complexity is typically reflected in whether external knowledge is required, the depth and breadth of the retrieval, and whether multi-step reasoning is involved. For example, simple factual questions (such as "What is the height of Mount Everest?") may require only a single retrieval or even no retrieval at all; while complex questions (such as "Compare the narrative structures of *One Hundred Years of Solitude* and *Love in the Time of Cholera*") often require multiple rounds of retrieval, information integration, and deep reasoning. Therefore, the system's ability to adaptively select the most appropriate processing strategy based on the actual needs of the question directly impacts the accuracy and completeness of the answer, as well as the system's response efficiency.
[0003] However, existing adaptive retrieval methods generally suffer from the drawback of mismatch between decision-making mechanisms and query complexity: methods based on entity frequency can only achieve binary decisions of "whether to retrieve" and cannot cope with multi-step reasoning requirements; fixed operation process methods adopt a uniform processing mode for all queries and lack the ability to differentiate between simple and complex queries; while single complex model solutions suffer from an imbalance between efficiency and depth due to the "one-size-fits-all" strategy and are difficult to take into account diverse query scenarios. Summary of the Invention
[0004] To address the aforementioned problems in the existing technology, this invention provides an adaptive routing and decision-making method and apparatus based on large-model intelligent question answering.
[0005] The technical problem to be solved by this invention is achieved through the following technical solution: In a first aspect, the present invention provides an adaptive routing and decision-making method based on large-model intelligent question answering, including: Obtain the original question text input by the user; Input the original question text into a pre-trained question decoupling classifier and output the decoupling judgment result; The original problem text is processed based on the decoupling judgment results to obtain the target problem text; The target question text is input into a pre-trained policy routing classifier, which outputs the target answer generation policy corresponding to the target question text. The policy routing classifier is used to determine the target answer generation policy corresponding to the target question text from multiple different retrieval generation policies. The target answer is generated based on the target answer generation strategy, and the target answer data is output.
[0006] Secondly, the present invention provides an adaptive routing and decision-making device based on large-model intelligent question answering, comprising: The acquisition module is used to acquire the original question text input by the user; The decoupling judgment module is used to input the original question text into a pre-trained question decoupling classifier and output the decoupling judgment result; The problem decoupling module is used to process the original problem text based on the decoupling judgment result to obtain the target problem text; The answer generation strategy determination module is used to input the target question text into a pre-trained strategy routing classifier and output the target answer generation strategy corresponding to the target question text; wherein, the strategy routing classifier is used to determine the target answer generation strategy corresponding to the target question text from multiple different retrieval generation strategies; The answer generation module is used to generate answers to the target question text according to the target answer generation strategy and output the target answer data.
[0007] This invention provides an adaptive routing and decision-making method and apparatus for intelligent question answering based on a large model. By constructing a dual-classifier architecture, it achieves refined judgment of question-answering complexity and dynamic adaptation of retrieval strategies. The question decoupling classifier first performs binary classification on the input question, effectively distinguishing between complex questions requiring multi-step reasoning and simple questions that can be directly processed. For questions requiring further processing, the strategy routing classifier accurately routes them to non-retrieval, single-step retrieval, or multi-step retrieval processes. This invention, through a hierarchical decision-making mechanism, significantly improves the response efficiency of simple queries while ensuring the accuracy of answers to complex queries.
[0008] The present invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description
[0009] Figure 1 This is a flowchart illustrating an adaptive routing and decision-making method based on large-model intelligent question answering provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the adaptive routing and decision-making method based on large-model intelligent question answering in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the performance evaluation results of the problem decoupling classifier provided in this embodiment of the invention; Figure 4 This is a schematic diagram comparing the performance of the method of the present invention with existing methods on a single-hop dataset, as provided in an embodiment of the present invention. Figure 5This is a schematic diagram comparing the performance of the method of the present invention with existing methods on a multi-hop dataset, as provided in an embodiment of the present invention. Figure 6 This is a schematic diagram of the adaptive routing and decision-making device based on large-model intelligent question answering according to an embodiment of the present invention. Detailed Implementation
[0010] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.
[0011] This invention provides an adaptive routing and decision-making method based on large-model intelligent question answering. See also... Figure 1 and Figure 2 The method includes the following steps: S102. Obtain the original question text input by the user.
[0012] Optionally, the method in this embodiment further includes: S103. Perform data preprocessing on the original question text to obtain the target search terms.
[0013] Optionally, step S103 may specifically include: S1031. Perform data cleaning and standardization on the original question text input by the user to obtain the denoised question text.
[0014] For example, the original question text Cleaning and standardization are performed to eliminate noise and unify the format, laying a high-quality data foundation for subsequent deep language model processing. Specifically, automatic error correction tools or dictionaries can be used to correct the original question text. There may be spelling errors in the text; common non-standard abbreviations or shorthands are expanded into their full forms (e.g., standardizing "LLM" to "large language model") to reduce ambiguity in the understanding of the language model; special characters, redundant spaces, or repeated punctuation that do not contribute to semantic understanding are cleaned up.
[0015] S1031. Use a large language model to extract named entities and keywords from the text to be denoised, and obtain named entity data and keyword data.
[0016] For example, the denoising problem text is input into a large language model, and with instruction prompts, all named entity data belonging to predefined categories (such as person names, place names, organization names, time, proper nouns, etc.) in the denoising problem text are identified and extracted. Simultaneously, core words or phrases that summarize the main idea of the problem and are crucial for retrieval are extracted from the denoised question text to obtain keyword data. Unlike named entity data, keyword data focuses more on expressing the core concepts, actions, or attributes of the problem.
[0017] S1031. Merge and deduplicate the named entity data and keyword data to obtain the target search terms.
[0018] For example, named entity data and keyword data The entries in the database are merged and deduplicated to obtain the target search terms. for:
[0019] in, Indicates to and Perform merging and deduplication.
[0020] In this embodiment, named entity data entity This ensured the completeness of factual content, while keyword data... This captures the intent and context of the problem.
[0021] S104. Input the original question text into the pre-trained question decoupling classifier and output the decoupling judgment result.
[0022] Optionally, the problem decoupling classifier includes a BERT pre-trained language model and a binary linear classifier head. The pre-training process for the problem decoupling classifier may specifically include: The word segmenter is called to segment and vectorize the original question text samples in the training dataset to obtain the question sample matrix; the question sample matrix and the answer labels in the training dataset are used to conduct supervised training of the question decoupling classifier.
[0023] For example, before model training, in order to accurately determine the complexity of the problem, it is necessary to first construct a high-quality training dataset and a test dataset. In this embodiment, several public question-answering datasets (such as 2WikiMultiHopQA, HotpotQA, NQ, and PopQA) were selected, and the original question text samples were filtered and labeled. Among them, multi-hop reasoning questions (requiring cross-document, multi-entity, and multi-fact reasoning) were marked as positive samples (1), representing questions that "need decoupling"; single-hop or factual questions (which can be answered directly through a single retrieval) were marked as negative samples (0).
[0024] To ensure the model's generalization ability, the dataset also includes: publicly available corpus samples (stable source, semantically standard); and LLM-generated samples (combinations of complex sentences and multi-question sentences generated by a large model, used to expand boundary scenarios). A total of 100,000 data entries were collected, of which 80,000 were publicly available corpus samples and 20,000 were LLM-generated samples, with a positive-to-negative sample ratio of approximately 1:1. After cleaning, deduplication, and normalization, the original question text samples yielded a dataset suitable for binary classification tasks. ,in, This is a sample of the original question text. These are the corresponding answer tags.
[0025] For dataset According to the sample After sorting in ascending order, proportionally The dataset is divided into training and testing datasets to ensure the reproducibility of training and evaluation samples.
[0026] in Represents the training dataset. This represents the test dataset.
[0027] In this embodiment, a BERT pre-trained language model (e.g., the bert-base-uncased model, or other pre-trained models) is used as the base network, and a binary linear classification head for binary classification tasks is connected at its top layer to construct a problem decoupling classifier. The model parameters of the problem decoupling classifier are initialized as follows:
[0028] in, The output dimension can be set. , For the hidden layer dimension.
[0029] Subsequently, during model training, the word segmenter is invoked to process the original question text samples in the training dataset. Word segmentation and vectorization were performed, and a maximum length padding strategy was used to obtain the problem sample matrix. :
[0030] in, The total number of samples, This represents the maximum sequence length.
[0031] make If the forward mapping of the BERT pre-trained language model is represented, then the output of the BERT pre-trained language model is... It can be represented as:
[0032] The output of the BERT pre-trained language model The initial prediction results are output by processing the data using a binary linear classification head. :
[0033] in, This is the weight matrix. For bias vectors, For input dimensions, For output dimensions.
[0034] use Activation function on initial prediction results Processing to obtain prediction results :
[0035] The prediction results can include binary classification probabilities and decoupling judgment results.
[0036] Optionally, the loss function used to train the problem decoupling classifier is expressed as:
[0037] in, Represents the loss function. For the first The answer labels corresponding to the original question text samples For the problem decoupling classifier targeting the first The prediction results output from the original question text sample. This represents the total number of samples in the original question text sample.
[0038] For example, during model training, the number of training rounds is set. The training batch size is 10, the evaluation batch size is 128 per device, the log recording step size is 64 per device, and the log recording step size is 500.
[0039] The training process uses the AdamW optimizer, whose core update rule is:
[0040] in, For learning rate, This is the weight decay coefficient. The parameter vector for the current position. For the updated parameter vector, Used to indicate the direction of gradient descent. For second-order moment estimation, It is a numerically stable term.
[0041] Finally, using accuracy Accuracy Recall rate and The values, used as model evaluation metrics, are expressed as follows:
[0042]
[0043]
[0044]
[0045] in, This is a true instance, i.e., the modulus (actually the negative class). False negatives are the number of samples that the model incorrectly predicts as negative (but are actually positive). False positives are the number of samples that the model incorrectly predicts as positive (but are actually positive). True negative examples are the number of samples that the model correctly predicts as negative. After each round of training, the validation process is automatically triggered, calculating accuracy, precision, recall, and weight on the test dataset. Values, and based on the test dataset The optimal model weights are selected as the final model.
[0046] S106. Process the original problem text according to the decoupling judgment result to obtain the target problem text.
[0047] Optionally, step S106 may specifically include: S1061. If the decoupling judgment result indicates that decoupling is required, the original problem text is decomposed using the LLM large language model to obtain multiple decomposed sub-problems as the target problem text.
[0048] S1062. If the decoupling judgment result is that decoupling is not required, then the original problem text shall be used as the target problem text.
[0049] For example, if the decoupling determination result indicates that decoupling is required, then the original question text is decoupled using the LLM large language model through the prompt word template:
[0050] in, To decompose it into subproblems, it can be represented as , This is a prompt template, and its content can be "Please analyze and break down the following problem into 3-5 sub-problems that can be handled independently, and output them in logical order".
[0051] S108. Input the target question text into the pre-trained policy routing classifier and output the target answer generation policy corresponding to the target question text.
[0052] Among them, the policy routing classifier is used to determine the target answer generation strategy corresponding to the target question text from multiple different retrieval generation strategies.
[0053] For example, for different target question texts, the policy routing classifier can select the corresponding target answer generation strategy from three retrieval generation strategies. The three retrieval generation strategies are: Non-Retrieval (labeled 'A'): Suitable for questions with clear common sense and well-defined facts. These questions typically do not rely on external knowledge and can be directly accessed. The answer is provided using the existing internal knowledge base.
[0054] Single-step Retrieval (labeled 'B'): Suitable for questions with simple structures and clear information requirements. It retrieves relevant context from an external knowledge base in a single search, inputs it along with the question into the LLM (Local Management Library), and then integrates the content to generate the answer.
[0055] Multi-step Retrieval (labeled 'C'): For complex problems with implicit multi-hop reasoning requirements, an iterative process of alternating retrieval and generation is executed. In each round, a new round of retrieval is dynamically initiated based on the retrieved content and the current reasoning state, gradually approaching the core of the problem. Finally, LLM integrates information from multiple rounds to generate a complete answer, while setting a loop limit.
[0056] The training process for the policy routing classifier includes: First, two specific strategies are used to automatically construct the training dataset and select the corpus needed for retrieval, namely, an external knowledge base. .
[0057] A priority rule based on model capability is used to automatically assign labels to text samples of questions that can be answered correctly: answers using the Non-Retrieval strategy are given priority and are marked as 'A' (common sense question) if correct; if they fail, the Single-step Retrieval strategy is used and is marked as 'B' (simple question) if successful; if both fail but the Multi-step Retrieval strategy succeeds, it is marked as 'C' (complex question).
[0058] For question text samples that cannot be answered correctly by any of the three strategies, we perform heuristic completion based on the inherent characteristics of their source datasets: question text samples from single-hop datasets are classified as 'B' by default, and question text samples from multi-hop datasets are classified as 'C' by default.
[0059] In constructing the knowledge corpus, this embodiment uses the 2018 version of Wikipedia data (specifically, the file wiki18_100w.jsonl) as the basic knowledge source, but other corpora can also be used. This corpus is characterized by its broad coverage and standardized structure, providing ample knowledge support for open-domain question answering tasks. In the specific implementation process, the raw data is first parsed and preprocessed, and then an inverted index or vector index structure is built for the corpus using a retrieval tool (e5-base-v2). This indexing process enables the corpus content to be quickly retrieved and accessed, providing an efficient knowledge query foundation for subsequent retrieval-based question answering processes. Secondly, the policy routing classifier uses the pre-trained model T5-Large (other pre-trained models can also be selected), which can obtain the deep semantic representation of the problem text samples. In the encoder output... Based on the labeled vectors or pooled sentence representations, the high-dimensional vectors are mapped to a three-dimensional output space for the problem text samples. Policy routing classifier prediction results as follows:
[0060] in, These represent the probabilities of choosing the three strategies.
[0061] During model training, the cross-entropy loss function is used as the optimization objective to measure the probability distribution predicted by the model. With real labels The difference between them is calculated using the following formula:
[0062] in, For batch size, It is a sample In category The real labels on The model predicts the sample. Category The probability of this is determined. The Adam optimizer is used, and a small learning rate is set for fine-tuning to ensure stable convergence during training.
[0063] In this embodiment, the target question text is used as input, and a lightweight policy routing classifier is used to map questions with different characteristics (such as syntax and intent) to the optimal retrieval generation policy, thereby achieving end-to-end adaptive policy allocation.
[0064] S110. Generate answers to the target question text according to the target answer generation strategy, and output the target answer data.
[0065] Optionally, step S110 may specifically include: S1101. If the target answer generation strategy is a no-retrieval answer generation strategy, then the LLM large language model is used to generate the answer to the target question text and output the target answer data.
[0066] For example, if the target answer generation strategy is a non-retrieval strategy, that is, the LLM large language model directly generates the answer based on its own knowledge, assuming the input target question text is... Then output the target answer data. It can be represented as: .
[0067] S1102. If the target answer generation strategy is a single-step retrieval answer generation strategy or a multi-step retrieval answer generation strategy, then the target question text is generated according to the target search terms and the target answer generation strategy, and the target answer data is output.
[0068] Optionally, step S1102 may specifically include: S1) If the target answer generation strategy is a single-step retrieval answer generation strategy, a single retrieval is performed on the preset external knowledge base based on the target search terms and the target question text to obtain the single retrieval result; the LLM large language model is used to generate the answer based on the single retrieval result and the target question text, and the target answer data is output.
[0069] For example, if the target answer generation strategy is a single-step retrieval strategy, that is, first retrieve a preset external knowledge base, and then the LLM combines the results of the single retrieval to generate the answer.
[0070] Assumption This refers to an external knowledge base, representing the results of a single search. It can be represented as:
[0071] in, Indicates the search engine. , This represents the target question text. This indicates the target search term entered.
[0072] Target answer data It can be represented as: .
[0073] S2) If the target answer generation strategy is a multi-step retrieval answer generation strategy, the preset external knowledge base is searched according to the target search terms and the target question text to obtain the current search result; the LLM large language model is used to generate the answer based on the current search result, the historical search results obtained before the current one, the historical answer data, and the target question text, and the current answer data is output; until the preset number of iterations is reached, the target answer data is output.
[0074] For example, if the target answer generation strategy is a multi-step retrieval strategy, it loops multiple times between retrieval and generation, gradually reasoning and answering.
[0075] For the target question text and target search terms, in the first In this search, Indicates the first The search results obtained from the external knowledge base, the first Search results for this search and the output answer data It can be represented as:
[0076]
[0077] in, Indicates the first The context information for this retrieval includes .
[0078] This embodiment provides an adaptive routing and decision-making method based on large-model intelligent question answering, which has the following advantages compared with existing technologies: 1. This invention achieves refined judgment of question-answering complexity and dynamic selection of retrieval strategies by constructing a dual-classifier architecture. The question decoupling classifier first performs binary classification on the input question, effectively distinguishing between complex questions requiring multi-step reasoning and simple questions that can be directly processed, avoiding the resource waste of the traditional single-model "one-size-fits-all" strategy. For questions requiring further processing, the strategy routing classifier accurately routes them to non-retrieval, single-step retrieval, or multi-step retrieval strategies based on semantic features, overcoming the shortcomings of existing methods in strategy adaptability. This hierarchical decision-making mechanism ensures a balance between low-latency response to simple queries and deep processing of complex queries, improving the accuracy of the answer.
[0079] 2. The dual-classifier framework proposed in this invention possesses excellent generalization ability and scalability. This architecture decouples complexity judgment from strategy selection, allowing each classifier to be independently optimized and updated, thus improving the maintainability and scalability of the overall system. Furthermore, the lightweight classifier design ensures that it can be flexibly integrated as a preprocessing module into various existing question-answering systems without modifying the underlying LLM or retrieval unit, significantly reducing technology migration costs and providing a reliable technical path for building an efficient and adaptive intelligent question-answering platform.
[0080] The adaptive routing and decision-making method based on large-model intelligent question answering provided in this invention will be further illustrated through simulation experiments below.
[0081] 1. Simulation experimental conditions: Operating system: Ubuntu 20.04 Experimental platform: PyTorch-2.3.0 Processor: Intel Core i9-13900KF Graphics card: NVIDIA A100-SXM4-40GB 2. Simulation Experiment Content Simulation Experiment 1: Performance Evaluation and Analysis of Problem Decoupling Classifier This experiment aims to systematically evaluate the discriminative ability of a problem decoupling classifier in distinguishing between problems that "need decoupling" and those that "do not need decoupling." The experiment employs a binary classification model based on the BERT architecture. The training data consists of two parts: publicly available corpus samples (80,000 entries) and LLM-generated samples (20,000 entries), for a total of 100,000 entries. The publicly available corpus samples are sourced from classic datasets such as 2WikiMultiHopQA, HotpotQA, PopQA, and NQ, ensuring the reliability and semantic standardization of the data sources. The LLM-generated samples utilize a large language model to generate complex sentence structures and multi-question combinations, effectively expanding the diversity of boundary scenarios and linguistic expressions.
[0082] The experimental results are shown in Table 3. The problem decoupling classifier performs excellently on the public dataset. The model achieves a recognition accuracy of 97.77% and an F1 score of 97.76% for publicly available corpus samples, while the recognition accuracy for LLM-generated samples is 84.88% and the F1 score is 71.68%. Although the recognition performance of LLM-generated samples is slightly lower than that of publicly available corpus samples, the model still maintains good discrimination performance on out-of-distribution data, demonstrating the algorithm's adaptability to the diversity of language expressions.
[0083] Simulation Experiment 2: Performance Comparison Experiment of Multi-task Question Answering under Adaptive Retrieval Strategy It should be noted that this experiment systematically evaluates four typical question-answering task datasets (NQ, TriviaQA, HotpotQA, and 2WikiMultiHopQA) under a unified environment. The methods compared include three benchmark methods: NoRetrieval, R1-Searcher, and Adaptive-RAG, as well as the method of this invention (Ours). The experiment uses three metrics—exact match rate (EM), F1 score, and accuracy (Acc)—to quantify the performance of each method in terms of factual accuracy, semantic matching degree, and overall performance from different dimensions.
[0084] The experimental results of the method of this invention on the four datasets mentioned above are shown in Tables 4 and 5. They were also compared with current representative retrieval enhancement methods R1-Searcher, Adaptive-RAG, and the No Retrieval setting without a retrieval module. Experimental results show that the method of this invention performs excellently on multiple metrics, especially in accuracy (Acc), achieving the highest values of 54.24%, 72.27%, 59.31%, and 50.52%, respectively, indicating that the model has stronger practical question-answering ability and retrieval performance. On the NQ and HotpotQA datasets, the method of this invention significantly outperforms other methods in EM and Acc, and its F1 score is also close to the optimum, demonstrating good complex reasoning ability. On the TriviaQA dataset, although R1-Searcher's EM and F1 are slightly higher, the method of this invention far surpasses it in Acc, demonstrating stronger result consistency. In the multi-hop question-answering task 2WikiMultiHopQA, the method of this invention also achieves the best Acc and is close to the optimum in other metrics, indicating its stability and accuracy in cross-document reasoning.
[0085] Corresponding to the above-described adaptive routing and decision-making method based on large-model intelligent question answering, this embodiment of the invention also provides an adaptive routing and decision-making device based on large-model intelligent question answering; such as Figure 6 As shown, the device may include: The acquisition module 601 is used to acquire the original question text input by the user; The decoupling judgment module 602 is used to input the original problem text into a pre-trained problem decoupling classifier and output the decoupling judgment result. The problem decoupling module 603 is used to process the original problem text based on the decoupling judgment result to obtain the target problem text; The answer generation strategy determination module 604 is used to input the target question text into a pre-trained strategy routing classifier and output the target answer generation strategy corresponding to the target question text; wherein, the strategy routing classifier is used to determine the target answer generation strategy corresponding to the target question text from multiple different retrieval generation strategies; The answer generation module 605 is used to generate answers to the target question text according to the target answer generation strategy and output the target answer data.
[0086] For details regarding the device, please refer to the steps of the adaptive routing and decision-making method based on large-model intelligent question answering provided in the first aspect; it will not be repeated here.
[0087] This embodiment presents an adaptive routing and decision-making device based on large-model intelligent question answering. It achieves refined judgment of question-answering complexity and dynamic adaptation of retrieval strategies through a dual-classifier architecture. The question decoupling classifier first performs binary classification on the input question, effectively distinguishing between complex questions requiring multi-step reasoning and simple questions that can be directly processed. For questions requiring further processing, the strategy routing classifier accurately routes them to non-retrieval, single-step retrieval, or multi-step retrieval processes based on semantic features. This method overcomes the limitations of existing methods such as binary decision-making based on entity frequency and fixed operation sequences. Through a hierarchical decision-making mechanism, it significantly improves the response efficiency of simple queries while ensuring the accuracy of answers to complex queries.
[0088] It should be noted that the device is basically similar to the method embodiment, so the description is relatively simple. For relevant parts, please refer to the description of the method embodiment.
[0089] It should be noted that the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention.
[0090] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.
[0091] Although the invention has been described herein in conjunction with various embodiments, those skilled in the art will understand and implement other variations of the disclosed embodiments by reviewing the accompanying drawings and the disclosure in carrying out the claimed invention. In the description of the invention, the word "comprising" does not exclude other components or steps, "a" or "an" does not exclude a plurality, and "a plurality" means two or more, unless otherwise explicitly specified. Furthermore, while different embodiments may describe certain measures, this does not mean that these measures cannot be combined to produce good results.
[0092] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. An adaptive routing and decision-making method based on large-model intelligent question answering, characterized in that, include: Obtain the original question text input by the user; The original question text is input into a pre-trained question decoupling classifier, which outputs the decoupling judgment result. The original question text is processed based on the decoupling judgment result to obtain the target question text; The target question text is input into a pre-trained policy routing classifier, which outputs the target answer generation strategy corresponding to the target question text; wherein, the policy routing classifier is used to determine the target answer generation strategy corresponding to the target question text from multiple different retrieval generation strategies; The target answer is generated based on the target answer generation strategy, and the target answer data is output.
2. The adaptive routing and decision-making method based on large-model intelligent question answering as described in claim 1, characterized in that, The method further includes: The original question text is preprocessed to obtain the target search terms; The step of generating an answer to the target question text according to the target answer generation strategy and outputting the target answer data includes: If the target answer generation strategy is a non-retrieval answer generation strategy, then the LLM large language model is used to generate the answer to the target question text and output the target answer data; If the target answer generation strategy is a single-step retrieval answer generation strategy or a multi-step retrieval answer generation strategy, then the target question text is generated according to the target search terms and the target answer generation strategy, and the target answer data is output.
3. The adaptive routing and decision-making method based on large-model intelligent question answering as described in claim 2, characterized in that, The process of preprocessing the original question text to obtain target search terms includes: The original question text input by the user is cleaned and standardized to obtain denoised question text; A large language model is used to extract named entities and keywords from the denoised text to obtain named entity data and keyword data. The named entity data and keyword data are merged and deduplicated to obtain the target search terms.
4. The adaptive routing and decision-making method based on large-model intelligent question answering as described in claim 2, characterized in that, If the target answer generation strategy is a single-step retrieval answer generation strategy or a multi-step retrieval answer generation strategy, then based on the target search terms and the target answer generation strategy, an answer is generated for the target question text, and target answer data is output, including: If the target answer generation strategy is a single-step retrieval answer generation strategy, a single retrieval is performed on a preset external knowledge base based on the target search terms and the target question text to obtain the single retrieval result; an LLM large language model is used to generate an answer based on the single retrieval result and the target question text, and the target answer data is output. If the target answer generation strategy is a multi-step retrieval answer generation strategy, the preset external knowledge base is searched based on the target question text and the target search terms to obtain the current retrieval result; using the LLM large language model, the answer is generated based on the current retrieval result, the historical retrieval results obtained before the current one, the historical answer data, and the target question text, and the current answer data is output; until the preset number of iterations is reached, the target answer data is output; wherein, the historical retrieval results and historical answer data corresponding to the initial number of iterations are null values.
5. The adaptive routing and decision-making method based on large-model intelligent question answering according to claim 1, characterized in that, The step of processing the original question text based on the decoupling judgment result to obtain the target question text includes: If the decoupling judgment result indicates that decoupling is required, then the original problem text is decomposed using the LLM large language model to obtain multiple decomposed sub-problems as the target problem text. If the decoupling determination result is that decoupling is not required, then the original problem text is taken as the target problem text.
6. The adaptive routing and decision-making method based on large-model intelligent question answering according to claim 1, characterized in that, The problem decoupling classifier includes a BERT pre-trained language model and a binary linear classification head; The pre-training process for the decoupled classifier for the problem includes: The word segmenter is invoked to segment and vectorize the original question text samples in the training dataset, resulting in a question sample matrix. The question decoupling classifier is trained in a supervised manner using the question sample matrix and the answer labels in the training dataset.
7. The adaptive routing and decision-making method based on large-model intelligent question answering as described in claim 6, characterized in that, The loss function used to train the decoupling classifier for the aforementioned problem is expressed as follows: in, Represents the loss function. For the first The answer labels corresponding to the original question text samples For the problem decoupling classifier, targeting the first The prediction results output from the original question text sample. This represents the total number of samples in the original question text sample.
8. An adaptive routing and decision-making device based on large-model intelligent question answering, characterized in that, include: The acquisition module is used to acquire the original question text input by the user; The decoupling judgment module is used to input the original question text into a pre-trained question decoupling classifier and output the decoupling judgment result. The problem decoupling module is used to process the original problem text based on the decoupling judgment result to obtain the target problem text; The answer generation strategy determination module is used to input the target question text into a pre-trained strategy routing classifier and output the target answer generation strategy corresponding to the target question text; wherein, the strategy routing classifier is used to determine the target answer generation strategy corresponding to the target question text from multiple different retrieval generation strategies; The answer generation module is used to generate answers to the target question text according to the target answer generation strategy and output the target answer data.