User request processing method and device, equipment and storage medium
By constructing a multi-dimensional semantic prototype library and a lightweight classification model, the shortcomings of generative large language models in recognizing the validity of user requests are addressed, achieving accurate recognition and avoiding misjudgments, thereby improving system reliability and user experience.
Patent Information
- Application Number
- CN202511774657.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-03
AI Technical Summary
Existing generative large language models cannot effectively identify the validity of user requests when faced with noise, semantic ambiguity, or unanswerable requests, leading to inappropriate or misleading responses that affect user experience and system reliability.
A multi-dimensional semantic prototype library is constructed. Target feature vectors are generated through semantic encoding and similarity calculations are performed with the multi-dimensional semantic prototype library. Combined with a lightweight classification model, the validity type label of the request is output to avoid misjudgment.
It enables accurate identification of the validity of user requests before generating responses, improving system reliability and user experience, reducing computational overhead, and possessing good generalization capabilities.
Smart Images

Figure CN121599112A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to a method, apparatus, device, and storage medium for processing user requests. Background Technology
[0002] With the current widespread adoption of intelligent cockpits, users expect in-vehicle systems to not only process structured commands, but also respond appropriately to open-domain knowledge-based questions (such as "How tall is basketball star XX?") and casual conversations (such as "Tell me a joke").
[0003] However, since generative large language models do not have the ability to reject, they are prone to producing inappropriate or even misleading responses when faced with noisy, semantically ambiguous, or unanswerable requests, which affects user experience and system reliability. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for processing user requests, which can effectively identify the processable type of the user's current request and provide targeted response information, thereby improving system reliability.
[0005] In a first aspect, embodiments of this application provide a method for processing user requests, the method comprising: The fused text is determined based on the user's current request and the corresponding context information, wherein the context information includes the user's historical requests and corresponding responses; The fused text is semantically encoded to obtain the target feature vector; The similarity between the target feature vector and the vectors of N sub-libraries in the multi-dimensional semantic prototype library is calculated respectively to obtain the matching score of the current request on N validity dimensions, where N is a positive integer; Use the matching scores on the N validity dimensions as model input features to input the request validity classification model; The validity type label of the current request is output through the request validity classification model, wherein the validity type label includes rejection type.
[0006] Secondly, embodiments of this application provide a user request processing apparatus, the apparatus comprising: The determination module is used to determine the fused text based on the user's current request and the corresponding context information, wherein the context information includes the user's historical requests and corresponding responses; The encoding module is used to perform semantic encoding on the fused text to obtain the target feature vector; The matching module is used to calculate the similarity between the target feature vector and the vectors of N sub-libraries in the multi-dimensional semantic prototype library, respectively, to obtain the matching score of the current request on N validity dimensions, where N is a positive integer; The input module is used to input the matching scores on the N validity dimensions as model input features into the request validity classification model; The prediction module is used to output the validity type label of the current request through the request validity classification model, wherein the validity type label includes rejection type.
[0007] Thirdly, embodiments of this application provide an electronic device, which includes: A processor and a memory, the memory being used to store a computer program, and the processor being used to invoke and run the computer program stored in the memory to perform the user request processing method provided in the first aspect of this application.
[0008] Fourthly, embodiments of this application provide a computer-readable storage medium for storing a computer program that causes a computer to perform a user request processing method as provided in the first aspect of this application.
[0009] Fifthly, embodiments of this application provide a computer program product, including a computer program / instructions, which, when executed by a processor, implements a user request processing method as provided in the first aspect of this application.
[0010] The technical solution provided in this application, by constructing a multi-dimensional semantic prototype library and combining it with a lightweight classification model, can determine the validity of user requests. Compared to related technologies that rely on large language models to directly generate responses, the solution provided in this application can accurately identify the validity of the current request before generating a reply, thereby effectively avoiding misleading responses and improving system reliability and user experience. Furthermore, the solution provided in this application does not rely on large-scale rejection labeling data, possesses good generalization ability, and has low computational overhead. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A flowchart illustrating a user request processing method provided in an embodiment of this application; Figure 2A flowchart illustrating a user request processing method provided in an embodiment of this application; Figure 3 A flowchart illustrating another user request processing method provided in an embodiment of this application; Figure 4 A flowchart illustrating another user request processing method provided in an embodiment of this application; Figure 5 A schematic block diagram of a user request processing apparatus provided in an embodiment of this application; Figure 6 A schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application 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 this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0015] Rejection refers to the behavior in speech recognition, natural language understanding and dialogue systems where the system actively determines that the current input does not belong to a valid intent, cannot be processed, or should be ignored, thereby refusing to respond or triggering a clarification mechanism.
[0016] Semantic rejection refers to determining whether a user request should be rejected at the semantic level (rather than the acoustic or syntactic level). For example, if a user says "screen solution," the semantics are ambiguous and lack a clear intent; if a user asks "What is my height?", the system lacks contextual knowledge; it is semantically unanswerable and should be rejected or clarified. Therefore, "semantic rejection" can be understood as: a technical process based on semantic understanding to identify and reject meaningless, ambiguous, irrelevant, or unanswerable user input.
[0017] An end-to-end semantic rejection model provided by a related technology specifically includes an encoder and a fully connected layer. An exemplary implementation process is as follows: The user's contextual request text (including historical dialogue) and multi-source features (such as voice confidence, dialogue turn number, etc.) are input into the model. The input is encoded by a semantic encoder (such as BERT, Transformer, etc.) to generate a high-dimensional semantic vector. A fully connected layer and activation function are then applied to this vector to directly output binary or multi-class labels (such as "rejection" / "non-rejection" or "valid" / "invalid").
[0018] The aforementioned end-to-end semantic rejection model relies on a large amount of labeled data, requiring manual labeling of massive numbers of "rejection / non-rejection" samples, which is costly. Furthermore, because the performance of this model is highly dependent on the distribution of the training data, it is prone to misjudgment when faced with unfamiliar, ambiguous requests (such as "screen solutions"), thus exhibiting weak generalization ability.
[0019] Another related technique is based on Large Language Model (LLM) for rejection. Specifically, the user's contextual request text and preset prompts are input into a finely tuned pre-trained LLM. The model performs a multi-dimensional semantic evaluation of the request based on the prompts, outputting structured labels (such as "fluency: high / low", "relevance: yes / no", "meaningfulness", etc.). Then, based on these labels, it determines whether to reject the request through rules or simple logic (e.g., rejection occurs if any dimension is "low").
[0020] However, the aforementioned rejection schemes struggle to distinguish between requests with similar structures but different semantic validity. For example, consider two requests: "phishing tutorial" and "screen solution." "Phishing tutorial" can be understood as a user asking the interactive system for information related to phishing, and should be responded to. "Screen solution," on the other hand, is obscure and difficult to understand, and the interactive system should not respond. Another example is the two requests: "What is the height of basketball star XX?" and "What is my height?". "What is the height of basketball star XX?" is a clear knowledge question posed by the user to the interactive system. "What is my height?" requires clarification or rejection from the interactive system when it lacks prior knowledge of the information.
[0021] Furthermore, while LLM can output multidimensional labels, its inherent standard for "what constitutes a valid request" is unclear, especially in open-domain scenarios where it lacks external knowledge anchors. Therefore, this related technology requires the construction of multidimensional training data to improve LLM's performance on rejection recognition tasks. It still requires the construction of a large amount of fine-tuning data for different dimensions (completeness, meaning, etc.), and the boundaries are difficult to exhaustively enumerate, resulting in high maintenance costs.
[0022] The solution provided in this application addresses the problems existing in the aforementioned related technologies. Specifically, in this application, a multi-dimensional semantic prototype library is constructed, and the semantic vector of a user request is matched with its various sub-libraries to obtain a structured and interpretable validity dimension score. This score is then input into a lightweight classification model to output a predicted label for the validity of the current request. This solution does not rely on massive amounts of rejection labeling data; it only requires the construction of a prototype library to achieve generalized discrimination, effectively overcoming the problems of weak generalization and difficulty in interpretation in end-to-end models. Furthermore, compared to pure large language model rejection schemes, the solution provided in this application uses external semantic prototypes as anchors, which can clearly distinguish requests with similar structures but different validity, avoiding misjudgments caused by the inherent ambiguity of LLM standards, thereby improving boundary case handling capabilities and system reliability.
[0023] Figure 1 This is a flowchart illustrating a user request processing method provided in an embodiment of this application. This method can be executed by the user request processing device provided in this application. The user request processing device can be implemented in any software and / or hardware manner. Exemplarily, this user request processing device can be applied to any electronic device, which may include, but is not limited to, tablet computers, mobile phones (such as foldable phones, large-screen phones, etc.), wearable devices, in-vehicle devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart TVs, smart screens, high-definition TVs, 4K TVs, smart speakers, smart projectors, and other various computing devices. This disclosure does not impose any limitations on the specific type of electronic device.
[0024] Specifically, such as Figure 1 As shown, the method may include steps S110-S150.
[0025] In S110, the fused text is determined based on the user's current request and the corresponding context information, wherein the context information includes the user's historical requests and corresponding responses.
[0026] In an exemplary embodiment, determining the specific implementation of the fused text includes the following steps.
[0027] S11. Obtain the user's current request text R curr .
[0028] S12. Obtain context information C related to the current request; wherein, the context information includes the user's historical request sequence R. hist ={R1,R2,...,Rn} and its corresponding systematic response sequence A hist={A1,A2,...,An}.
[0029] S13. According to the preset text concatenation strategy, the current request text is combined with the context information to obtain the fused text Tfused.
[0030] In some implementations, the above text concatenation strategy can be concatenation in reverse chronological order. Specifically, T fused =R curr +"[SEP]"+An +"[SEP]"+Rn+...+A1 +"[SEP]"+R1.
[0031] The "[SEP]" is a separator used to distinguish different dialogue rounds.
[0032] For example, the current request text R curr For example, the question is: "User: What good food is there over there?"
[0033] The context information C related to the current request includes: User: What are some fun things to do in H Mountain? System: H Mountain has many attractions worth visiting. The H Mountain Scenic Area is famous for its uniquely shaped pines, strange rocks, sea of clouds, hot springs, and winter snow, making it a must-see destination.
[0034] The merged text, spliced in reverse chronological order, is as follows: What are some good places to eat over there? [SEP] H Mountain has many attractions worth visiting. The H Mountain Scenic Area is famous for its uniquely shaped pines, strange rocks, sea of clouds, hot springs, and winter snow, making it a must-see. [SEP] What's fun to do in H Mountain?
[0035] The above method of splicing data in reverse chronological order can effectively maintain the logical order of the dialogue and is easy to implement.
[0036] In other implementations, the above text concatenation strategy can be based on semantic importance-weighted concatenation. Specifically, historical requests and responses are scored according to time decay or semantic relevance, and only the most recent k rounds (e.g., k=3) are retained for concatenation. This text concatenation method can reduce noise in long dialogues and highlight the impact of recent interactions.
[0037] In some implementations, to control input length and improve encoding efficiency, a dialogue summarization mechanism can be used to concatenate text. Specifically, a lightweight encoder (such as BERT-base or TinyBERT) can be used to generate summaries of historical dialogues, which are then concatenated with the current request to reduce input length and improve semantic focus.
[0038] In this embodiment of the application, by constructing fused text, the semantic deviation problem caused by isolated processing of the current request can be solved, the understanding of ambiguous requests in multi-turn dialogues (such as what "over there" refers to) can be enhanced, and the accuracy of the validity judgment of the current request can be improved.
[0039] In S120, the fused text is semantically encoded to obtain the target feature vector.
[0040] In an exemplary embodiment, reference is made to Figure 2 The fused text is semantically encoded using a pre-trained first encoding model (e.g., a semantic encoder based on the BERT architecture).
[0041] For example, the training objectives of the first encoding model described above may include dialogue coherence modeling, intent classification auxiliary tasks, or contrastive learning to optimize semantic similarity metrics. This multi-task training strategy helps improve the encoding model's sensitivity to user requests in terms of semantic completeness, intent clarity, and domain relevance, thereby providing a more discriminative vector representation for subsequent validity dimension matching.
[0042] For example, the fused text is input into the first encoding model after training, and context-aware semantic representation is extracted through its Transformer encoding layer. The hidden state corresponding to the [CLS] label is taken as the target feature vector e∈R. d , where d is the output dimension of the model.
[0043] In the embodiments provided in this application, to ensure that the encoded vector of the fused text and the prototype library vector are in the same semantic space, the first encoding model described above can also be used to construct a multi-dimensional semantic prototype library offline. Therefore, when matching the target feature vector with vectors in the sub-library, semantic shifts or cross-model alignment errors caused by different encoders can be avoided, thereby improving the reliability and consistency of similarity measurement.
[0044] In an exemplary embodiment, the aforementioned multi-dimensional semantic prototype library serves as a semantic benchmark set for validity determination. To improve the accuracy of identifying different types of invalid requests, multiple sub-libraries corresponding to different semantic dimensions are set up. Here, a semantic prototype refers to a representative sample or semantic category center of a semantic category. (See reference...) Figure 2 An exemplary multidimensional semantic prototype library includes at least one of the following: The first sub-database (answerable knowledge prototype database): contains semantic prototype vectors used to represent answerable knowledge. This database takes a large number of open-domain knowledge question-answer pairs (such as "What are the scenic spots in H Mountain?", "How tall is basketball star xx?") and inputs them into the first encoding model to extract their semantic vectors, forming a set of semantic prototypes used to represent answerable factual questions; The second sub-library (clear expression prototype library): contains semantic prototype vectors for expressing clear expressions. This sub-library takes fluent and intentional user request samples (such as "navigate to the nearest gas station" or "tell a joke") and some ambiguous / invalid samples (for negative example enhancement) as input to the first encoding model, extracts semantic vectors, and constructs a set of semantic prototypes for evaluating the completeness and fluency of expression; The third sub-library (domain-specific functional prototype library): contains semantic prototype vectors used to describe functions within the target domain. This sub-library takes standard commands or function requests supported by the vehicle system (such as "turn on the air conditioner", "turn up the volume", "play song xxx"), inputs them into the first encoding model, extracts semantic vectors, and forms a set of semantic prototypes used to match valid operational intentions within the target domain.
[0045] The three sub-libraries mentioned above together constitute the multi-dimensional semantic prototype library, which corresponds to the core discrimination dimensions of "can it answer?" (knowledge answerability), "can it be explained clearly?" (clarity of expression), and "can it be done?" (domain functionality), thereby comprehensively covering the main criteria for judging the validity of user requests.
[0046] Meanwhile, all semantic prototype vectors and target feature vectors e are generated by the same first encoding model, which ensures strict alignment of the semantic space. This makes the subsequent similarity calculations (such as cosine similarity) performed in each sub-database comparable, stable, and have high discriminative validity, thus providing high-quality, structured model input features for the request validity classification model.
[0047] It should be noted that at least one sub-library in the multi-dimensional semantic prototype library is dynamically updated based on a preset update strategy; wherein, the preset update strategy includes any of the following: incrementally updating the sub-library based on periodic scheduled tasks; in response to the emergence of new hot events or new terms, obtaining new semantic prototypes from external knowledge sources and injecting them into the corresponding sub-library; and modifying or expanding the semantic prototypes in the sub-library.
[0048] Because the multi-dimensional semantic prototypes described in this embodiment support a dynamic update mechanism, they can quickly collect and vectorize real-time hot topics, newly emerging terms, or events that are being exposed for the first time. Therefore, when combining with a large language model for rejection prediction, it is not necessary to rely on the iteration of the large language model itself. Given the high training and deployment costs and long cycles of large language models, which make it difficult to cover emerging content in a timely manner, regular or incremental updates of an external vector library can effectively recall and identify such new requests without retraining the model, thereby expanding the knowledge boundary of rejection judgment.
[0049] In S130, the similarity between the target feature vector and the vectors of N sub-libraries in the multi-dimensional semantic prototype library is calculated respectively to obtain the matching score of the current request on N validity dimensions, where N is a positive integer.
[0050] In an exemplary embodiment, for each sub-library P i (where i = 1, 2, ..., N), perform the following operations.
[0051] S21. Retrieve semantic prototype vectors from the sub-database.
[0052] Sub-library P i Contains a set of semantic prototype vectors {p} pre-generated by a first encoding model i1 ,p i2 ,…,p im}, where m is the number of prototypes in the sub-library.
[0053] S22. Calculate the similarity between the target feature vector e and each prototype in the sub-library.
[0054] For example, a preset similarity metric function (such as cosine similarity, dot product, or Euclidean distance) is used to calculate the similarity between the target feature vector e and the sub-database P. i Each prototype vector p ij Similarity value s between ij As shown in formula (1).
[0055] (1) S23, Aggregate Library P i Intra-similarity is used to obtain the matching score for that dimension.
[0056] Pair of sub-libraries P i All similarity values are aggregated to obtain the final matching score M for this validity dimension. i Exemplary aggregation methods can be any of the following: (1). Take the maximum value.
[0057] (2) In this implementation method, This indicates the degree of match between the current request and the most similar prototype in this sub-library.
[0058] (2). Take the average of the first K maximum values.
[0059] (3) This implementation method can mitigate the impact of noise from a single sample.
[0060] After the processing steps S21-S23 described above, matching scores on N validity dimensions can be obtained. For example, these matching scores on the N validity dimensions can be represented as an N-dimensional matching score vector M=[M1,M2,…,M…]. N As can be seen, each component of the score vector corresponds to a quantitative evaluation result of an effectiveness dimension.
[0061] if, This indicates the score for the knowledge dimension that can be answered. Score for clarity of expression This is the score for the functional dimension within the domain. The current request is for the "screen solution," and the maximum similarity between its target feature vector e and the three sub-libraries is as follows: =0.21、 =0.18、 =0.15. As can be seen, all values are significantly lower than the threshold (e.g., 0.5), indicating that the request does not meet the conditions in all validity dimensions and can be judged as "rejected".
[0062] In the matching score calculation scheme provided in this application embodiment, each matching score independently reflects a semantic validity dimension, thereby improving the interpretability of the judgment through dimensional decoupling. Furthermore, the output score vector M is a structured numerical feature that can be directly used as input to lightweight classification models (such as SVM and MLP).
[0063] In S140, the matching scores on the N validity dimensions are used as model input features and input into the request validity classification model. In S150, the validity type label of the current request is output through the request validity classification model, wherein the validity type label includes rejection.
[0064] In an exemplary embodiment, the above-mentioned request validity classification model is a specially trained small support vector machine (SVM) model, with an activation function following the output layer to support multi-classification tasks.
[0065] refer to Figure 2 Match the scores M = [N validity dimensions] [x] serves as the input feature for the classification model. For example, when N=3, the model input information is: x= , , , representing the scores for the answerability dimension, the clarity of expression dimension, and the functionality dimension within the target domain, respectively.
[0066] In an exemplary embodiment, the validity type label is used to characterize the processable type of the current request, and in addition to rejection type, it may also include at least one of the following: question-answering type and clarification type. The above request validity classification model can use an SVM with a linear kernel or an RBF kernel, and perform multi-class expansion for the three types of labels (such as using a one-vs-rest strategy). The SVM has been trained using a labeled dataset before deployment.
[0067] For example, in the training samples of SVM, positive samples are labeled as "question-answering" requests and their corresponding matching scores, while negative samples are labeled as "clarification" or "refusal to identify" requests and their matching scores.
[0068] The SVM described above has a small number of parameters and a fast inference speed, making it suitable for real-time discrimination requirements in automotive embedded environments.
[0069] To facilitate subsequent fusion or thresholding, the original decision values of the SVM are further converted into a normalized class probability distribution using the Softmax activation function: p = Softmax(z) = [p 问答型 , p 澄清型 , p 拒识型 ] Where, z∈R 3 The three decision scores are the output of the SVM.
[0070] Furthermore, the category with the highest probability is selected as the validity type label for the final output. For example, if the matching score of the model input is [0.82, 0.76, 0.15], and the output probability after SVM and Softmax is [0.91, 0.08, 0.01], then the current request right can be determined to be "question-answering type".
[0071] It should be noted that in other embodiments, the above-mentioned request validity classification model can also be replaced by a lightweight multilayer perceptron (MLP), logistic regression, or decision tree model, and this application embodiment does not limit this.
[0072] In another embodiment of the user request processing method provided in this application, in order to further improve the robustness and security of request validity judgment, especially in scenarios with stringent reliability requirements such as vehicle-mounted systems, this embodiment of the application introduces a large language model as an independent semantic evaluation channel, forming a dual-model verification mechanism with the aforementioned lightweight discrimination path based on a multi-dimensional semantic prototype library.
[0073] in, Figure 3 This is a flowchart illustrating another user request processing method provided in an embodiment of this application. Figure 3As shown, this mechanism dynamically determines the final validity judgment result by fusing the validity type label output by the lightweight classification model with the semantic quality assessment information output by the large language model, effectively suppressing the risk of erroneous responses caused by illusions or fuzzy understandings from a single model (especially a large language model). The specific implementation of this embodiment includes the following steps.
[0074] In S31, the input information for the large language model is determined.
[0075] refer to Figure 3 The system concatenates the user's current request and its context information (including historical requests and system responses) into a structured prompt text, which is then input into a pre-defined large language model.
[0076] The large language model can be a general base model or a specialized model fine-tuned for dialogue understanding tasks.
[0077] It should be noted that, compared to related technologies that rely solely on large language models for request validity judgment, this embodiment avoids dependence on frequent iterations of large language models by combining a lightweight classification model with a dynamically updated multi-dimensional semantic prototype library. This embodiment, through periodic or incremental updates of an external vector library, can promptly recall and identify user requests containing new terms or trending events without retraining the model, effectively expanding the knowledge boundary and timeliness of rejection judgment.
[0078] In S32, semantic quality assessment information for the current request is generated using a large language model.
[0079] Using the aforementioned large language model, and based on preset evaluation prompts, the current request is evaluated in a fine-grained manner across multiple semantic dimensions, and structured semantic quality evaluation information is output. For example, the semantic quality evaluation information includes at least one of the following: context relevance score, integrity score, fluency level, and a judgment result indicating whether it is meaningful.
[0080] An example prompt is as follows: "Please evaluate the following user requests from the following four dimensions and output the results in JSON format:" Contextual relevance (continuous values from 0 to 1); Integrity (continuous values from 0 to 1); Smoothness ('High' / 'Medium' / 'Low'); Does it make sense ('yes' / 'no')? Based on this, the large language model outputs the following semantic quality assessment information: { "context_relevance": 0.85, "completeness": 0.42, "fluency": "medium", "is_meaningful": "no" } In S33, based on a preset fusion strategy, according to the validity type tag and the semantic quality evaluation information, determine the validity determination result of the current request.
[0081] Reference Figure 3 , based on the validity type tag (from a lightweight request validity classification model) and the semantic quality evaluation information (from a large language model), adopt a preset fusion strategy to determine the final validity determination result.
[0082] In some embodiments, the above fusion strategy includes a rule priority fusion mode.
[0083] Specifically, if "is meaningful" is "no", then regardless of the output of the lightweight classification model, force the validity determination result to be the rejection type.
[0084] If "is meaningful" is "yes", and the "completeness" is lower than a preset threshold (such as 0.6), then determine the validity determination result to be the clarification type.
[0085] In other cases (such as the output of the large language model contains information such as meaningful and sufficient completeness), the validity type tag output by the lightweight classification model shall prevail.
[0086] For example, for a certain request and its context information, the output of the lightweight classification model is: rejection type (no personal information support); if the LLM evaluation result is: is_meaningful = "yes", but involves privacy; high completeness, but the system policy still considers it non-answerable. Then, based on the above rule priority fusion: since "is meaningful" is "yes", but it can still be classified as rejection in combination with business rules; if the LLM clearly marks is_meaningful = "no", then directly reject.
[0087] In this implementation method, the prediction result of the lightweight classification model (request validity prediction model) is preferentially adopted. The reason is that in key application scenarios, the lightweight classification model can provide a fast and reliable preliminary judgment. Its structured features and clear classification boundaries make the decision more stable and reliable. It is only used to correct or enhance the judgment when the large language model provides clear semantic signals. This helps to improve the system's understanding ability for open-domain questions while maintaining the security of high-confidence responses.
[0088] In other embodiments, the fusion strategy adopts a confidence weighted fusion mode.
[0089] Specifically, obtain the complete confidence vector corresponding to the validity type label output by the lightweight classification model (e.g., [0.10, 0.85, 0.05] corresponding to question answering / clarification / rejection); based on semantic quality assessment information, construct the category confidence vector on the large language model side, for example: If is_meaningful = "no", then the category confidence vector is constructed as [0.0, 0.0, 1.0], that is, the rejection confidence is 1.0; If is_meaningful="Yes" and completeness<0.6, then the constructed category confidence vector tends to be clarifying, such as [0.2, 0.7, 0.1]. If is_meaningful="Yes" and completeness≥0.6, then construct a category confidence vector that favors question-and-answer type, such as [0.8, 0.15, 0.05]. The two confidence levels are weighted and summed according to preset weights (e.g., w1=0.7, w2=0.3) to obtain a comprehensive score; and the type corresponding to the highest score is taken as the final validity judgment result.
[0090] If, for the same request and its context information, the confidence score output by the lightweight classification model is [0.10, 0.85, 0.05], and the confidence score constructed based on the LLM output (completeness=0.42, is_meaningful="Yes") is [0.15, 0.70, 0.15], then the comprehensive scores corresponding to each candidate type are as follows: Question-and-answer type: 0.10 × 0.7 + 0.15 × 0.3 = 0.115; Clarified form: 0.85 × 0.7 + 0.70 × 0.3 = 0.805; Rejection type: 0.05 × 0.7 + 0.15 × 0.3 = 0.08; The final validity determination result is: clarification type. Furthermore, the system can proactively ask follow-up questions to confirm the intent.
[0091] like Figure 3 The scheme shown, which determines the validity of the current request based on the fusion of dual-model results, has the following synergistic enhancement effects.
[0092] On the one hand, the lightweight classification model relies on a multi-dimensional semantic prototype library to provide interpretable, low-latency, and interference-resistant benchmark discrimination capabilities. This prototype library supports a dynamic update mechanism that can quickly collect and vectorize real-time hot information, newly emerging terms, or first-time exposed events without relying on the iteration of the large language model itself. Given that the training and deployment of large language models are costly and time-consuming, and it is difficult to cover emerging content in a timely manner, this application embodiment, through the periodic or incremental updates of the external vector library, enables the system to effectively recall and identify such new requests without retraining the model, significantly expanding the knowledge boundary and timeliness of rejection judgment.
[0093] On the other hand, large language models possess powerful open-domain semantic understanding capabilities, enabling them to output fine-grained semantic quality assessment information (such as contextual relevance, completeness, and meaningfulness), providing semantic-level verification and supplementation for the initial judgments of lightweight classification models. The two complement each other: lightweight classification models ensure safety baselines and response efficiency, while large language models enhance robustness in understanding complex, ambiguous, or emerging expressions.
[0094] Furthermore, in terms of engineering feasibility, the large language model can be flexibly deployed in the cloud or a lightweight local version can be used to efficiently collaborate with the lightweight discrimination module on the vehicle side. Combined with a dynamically updated semantic prototype library, the entire system can quickly adapt to changes in external knowledge while meeting the comprehensive requirements of intelligent cockpits for real-time performance, safety, intelligence, and long-term maintainability.
[0095] In another embodiment of the user request processing method provided in this application, in order to further improve the discrimination accuracy and generalization ability of the request validity classification model, especially when processing complex, open-domain user requests, a large language model can be introduced as a semantic enhancement source. The semantic quality assessment information output by the model can be transformed into a multi-dimensional numerical feature vector and fused with the original input features generated by the lightweight request validity classification model to construct the enhanced model input features.
[0096] in, Figure 4 This is a flowchart illustrating another user request processing method provided in an embodiment of this application. Figure 4 As shown, this embodiment injects the fine-grained semantic understanding capabilities of a large language model into the input of a lightweight classification model, thereby achieving knowledge transfer and feature enhancement. This effectively compensates for the knowledge blind spots of the lightweight classification model in open-domain scenarios and improves the overall semantic perception capability of the system.
[0097] The generation of input information and semantic quality evaluation information for large language models can be referenced from [the relevant documentation / reference]. Figure 3The corresponding implementation examples will not be described in detail here. For example, the semantic quality assessment information output by the large language model includes at least one of the following: context relevance score, integrity score, fluency level, and a judgment result on whether it is meaningful.
[0098] In this embodiment, the semantic quality assessment information output by the large language model is converted into a quantifiable and computable multidimensional numerical feature vector. Exemplary conversion methods include: (1). For continuous ratings (such as contextual relevance and completeness), they can be directly retained as floating-point numbers; (2). For discrete levels (such as fluency: "high / medium / low"), convert them to numerical values according to preset mappings. For example, "high", "medium" and "low" are mapped to 1.0, 0.5 and 0.2 respectively. (3). Boolean judgments (such as "Does it make sense?") can be converted to binary values, such as "Yes" being mapped to 1.0 and "No" being mapped to 0.0.
[0099] Based on the above transformation method, a numerical evaluation score can be obtained for the large language model. An exemplary representation can be described as the following score vector: S LLM =[s relevance , s completeness , s fluency , s meaningful ].
[0100] refer to Figure 4 Next, we construct the enhanced model input features.
[0101] The score vector SLLM, constructed based on the output information of the large language model, is matched with the N-dimensional matching score vector M=[M1, M2, …,M] generated by the lightweight classification model. N By fusing these features, the enhanced model input features can be obtained. An exemplary fusion method is feature concatenation, such as the enhanced model input features M. enhanced It can be represented as: M enhanced =[M,S LLM ].
[0102] refer to Figure 4 The enhanced model input features are fed into a request validity classification model (such as SVM or MLP), which outputs the final validity type label. Because the input features incorporate fine-grained semantic signals from a large language model, the model is more robust and generalizable in judging ambiguous, emerging, or open-domain requests.
[0103] For example, the user input might be: "What are some good movies to watch lately?" Based on the user's input request and its context information, the lightweight classification model's matching score is: M = [ , , =[0.5, 0.4, 0.6]; LLM evaluation results: Context relevance: 0.9, Completeness: 0.85, Fluency: "High" (mapped to 1.0), Meaningfulness: "Yes" (mapped to 1.0), that is, the score vector constructed based on the LLM output is: S LLM =[s relevance , s completeness , s fluency , s meaningful [0.9, 0.85, 1.0, 1.0]. Further concatenation yields the enhanced model input features: M enhanced = [M, S LLM The input value is [0.5, 0.4, 0.6, 0.9, 0.85, 1.0, 1.0]. This input to the validity prediction model yields a validity type label: "Question-Answer Type". The system can then proactively recommend recently popular movies based on this validity type label.
[0104] like Figure 4 The provided user request processing method, on the one hand, provides richer contextual cues based on multi-dimensional semantic signals (rather than single labels), which can improve the lightweight classification model's ability and accuracy in recognizing complex requests. On the other hand, the semantic parsing capability of the large language model is injected into the lightweight classification model in the form of structured features, realizing zero-shot knowledge transfer and knowledge enhancement. Thus, even when faced with expressions not covered by the training data, the system can still make reasonable inferences through semantic evaluation via LLM. In addition, this embodiment does not require retraining the large language model or the lightweight classification model; performance leaps can be achieved solely through input feature enhancement, making it suitable for resource-constrained environments such as in-vehicle systems.
[0105] The solution provided in this application significantly improves the accuracy and response stability of question-answering systems in open-domain scenarios by combining the rejection capability of a large language model with a text embedding vector database and retrieval mechanism. Specifically, on the one hand, the multi-dimensional semantic prototype library supports a dynamic update mechanism, which can quickly collect and vectorize real-time hot information, newly emerging terms, or first-time exposed events, thus eliminating the need to rely on the iteration of the large model itself. Instead, through periodic or incremental updates of the external vector library, it is possible to effectively recall and identify such new requests without retraining the model, thereby expanding the knowledge boundary of rejection judgment.
[0106] On the other hand, when user requests involve scenarios such as encyclopedic Q&A, personal information queries, or traditional skill invocations, cross-validation can be performed by retrieving external knowledge sources. This helps the large language model more accurately distinguish between "answerable" and "rejectable" request types, avoiding misjudgments or silences due to a lack of prior knowledge. This significantly improves the effectiveness, robustness, and business controllability of rejection decisions.
[0107] Figure 5 This is a schematic block diagram of a user request processing apparatus provided in an embodiment of this application. Figure 5 As shown, the device 500 may include: The determining module 510 is used to determine the fused text based on the user's current request and the corresponding context information, wherein the context information includes the user's historical requests and corresponding responses; Encoding module 520 is used to perform semantic encoding on the fused text to obtain a target feature vector; The matching module 530 is used to calculate the similarity between the target feature vector and the vectors of N sub-libraries in the multi-dimensional semantic prototype library, respectively, to obtain the matching score of the current request on N validity dimensions, where N is a positive integer; Input module 540 is used to input the matching scores on the N validity dimensions as model input features into the request validity classification model; The prediction module 550 is used to output the validity type label of the current request through the request validity classification model, wherein the validity type label includes rejection type.
[0108] In an exemplary embodiment, based on the above scheme, the device further includes: a first auxiliary prediction module and a fusion module; The first auxiliary prediction module is used to input the current request and its context information into the large language model; and to generate semantic quality assessment information corresponding to the current request based on the current request and its context information through the large language model. The fusion module is used to determine the validity judgment result of the current request based on a preset fusion strategy, the validity type label, and the semantic quality assessment information.
[0109] In an exemplary embodiment, based on the above scheme, the semantic quality assessment information includes at least one of the following: context relevance score, integrity score, fluency score, and a judgment result on whether it is meaningful; The fusion module is specifically used to: if the semantic quality assessment information indicates that the current request is meaningless, then determine the validity determination result as rejection type; if the semantic quality assessment information indicates that the current request is semantically meaningful but lacks completeness, then determine the validity determination result as clarification type; otherwise, use the validity type label as the validity determination result. Alternatively, the fusion module is specifically used to: obtain the confidence level corresponding to the validity type label, and generate a category confidence vector corresponding to the large language model based on the semantic quality assessment information; perform weighted fusion of the confidence level of the validity type label and the category confidence vector to obtain a comprehensive score corresponding to each candidate type; and determine the candidate type with the highest comprehensive score as the validity judgment result; wherein, the candidate types include: rejection type, question-answering type, and clarification type.
[0110] In an exemplary embodiment, based on the above scheme, the device further includes: a second auxiliary prediction module; The second auxiliary prediction module is used to input the current request and its context information into a large language model, so as to generate semantic quality assessment information corresponding to the current request based on the current request and its context information through the large language model; convert the semantic quality assessment information of each assessment dimension into corresponding numerical assessment scores; and concatenate or weightedly fuse the numerical assessment scores with the model input feature scores to obtain enhanced model input features. The enhanced model input features are used to input the request validity classification model, so as to output the validity type label of the current request through the request validity classification model.
[0111] In an exemplary embodiment, based on the above scheme, at least one sub-library in the multi-dimensional semantic prototype library is dynamically updated based on a preset update strategy; wherein, the preset update strategy includes any one of the following: Incremental updates to the sub-database are performed based on periodic scheduled tasks; In response to the emergence of new trending events or new terms, new semantic prototypes are obtained from external knowledge sources and injected into the corresponding sub-libraries; Modify or expand the semantic prototypes in the sub-library.
[0112] In an exemplary embodiment, based on the above scheme, the encoding module is specifically used to: perform semantic encoding on the fused text through a first encoding model to obtain a target feature vector; The apparatus further includes: a vector library construction module; wherein the vector library construction module is used to determine the semantic prototype vectors contained in the N sub-libraries through the first encoding model; wherein the N sub-libraries include at least one of the following: The first sub-library contains semantic prototype vectors for representing answerable knowledge. A second sub-library containing semantic prototype vectors for clearly expressed ideas. It contains a third sub-library that uses semantic prototype vectors to describe functionalities within the target domain.
[0113] In an exemplary embodiment, based on the above solution, the device further includes: a response module; The response module is configured to execute a corresponding response strategy based on the validity determination result of the current request; wherein, when the validity determination result of the current request is determined to be a rejection type, the generation of a natural language response is suppressed.
[0114] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 5 The apparatus 500 shown can execute any of the method embodiments provided in this application, and the foregoing and other operations and / or functions of each module in the apparatus 500 are respectively for implementing the corresponding processes in the various methods of the embodiments of this application. For the sake of brevity, they will not be described in detail here.
[0115] The apparatus 500 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0116] Figure 6 A schematic block diagram of an electronic device provided in an embodiment of this application.
[0117] like Figure 6 As shown, the electronic device 600 may include: The system includes a memory 610 and a processor 620. The memory 610 stores computer programs and transfers the program code to the processor 620. In other words, the processor 620 can retrieve and run the computer program from the memory 610 to implement the methods described in the embodiments of this application.
[0118] For example, the processor 620 can be used to execute the above-described method embodiments according to instructions in the computer program.
[0119] In some embodiments of this application, the processor 620 may include, but is not limited to: General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0120] In some embodiments of this application, the memory 610 includes, but is not limited to: Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0121] In some embodiments of this application, the computer program may be divided into one or more modules, which are stored in the memory 610 and executed by the processor 620 to perform the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.
[0122] like Figure 6 As shown, the electronic device may also include: Transceiver 630, which can be connected to processor 620 or memory 610.
[0123] The processor 620 can control the transceiver 630 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 630 may include a transmitter and a receiver. The transceiver 630 may further include antennas, and the number of antennas may be one or more.
[0124] It should be understood that the various components in the electronic device are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0125] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, this application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.
[0126] When implemented using software, it can be implemented entirely or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0127] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0128] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0129] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0130] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for processing user requests, characterized in that, include: The fused text is determined based on the user's current request and the corresponding context information, wherein the context information includes the user's historical requests and corresponding responses; The fused text is semantically encoded to obtain the target feature vector; The similarity between the target feature vector and the vectors of N sub-libraries in the multi-dimensional semantic prototype library is calculated respectively to obtain the matching score of the current request on N validity dimensions, where N is a positive integer; Use the matching scores on the N validity dimensions as model input features to input the request validity classification model; The validity type label of the current request is output through the request validity classification model, wherein the validity type label includes rejection type.
2. The method according to claim 1, characterized in that, The method further includes: Input the current request and its context information into the large language model; Based on the current request and its context information, the large language model generates semantic quality assessment information corresponding to the current request. Based on a preset fusion strategy, the validity determination result of the current request is determined according to the validity type label and the semantic quality assessment information.
3. The method according to claim 2, characterized in that, The semantic quality assessment information includes at least one of the following: context relevance score, integrity score, fluency score, and a judgment result on whether it is meaningful; The determination of the validity of the current request based on the preset fusion strategy, according to the validity type label and the semantic quality assessment information, includes any one of the following: If the semantic quality assessment information indicates that the current request is meaningless, the validity determination result is determined to be rejection type; if the semantic quality assessment information indicates that the current request is semantically meaningful but lacks completeness, the validity determination result is determined to be clarification type; otherwise, the validity type label is used as the validity determination result. Obtain the confidence level corresponding to the validity type label, and generate the category confidence vector corresponding to the large language model based on the semantic quality assessment information; The confidence scores of the validity type labels and the category confidence vectors are weighted and fused to obtain the comprehensive score corresponding to each candidate type. The candidate type with the highest overall score is determined as the validity judgment result; The candidate types include: rejection type, question-and-answer type, and clarification type.
4. The method according to claim 1, characterized in that, The method further includes: The current request and its context information are input into a large language model, so that the large language model can generate semantic quality assessment information corresponding to the current request based on the current request and its context information. The semantic quality assessment information for each assessment dimension is converted into corresponding numerical assessment scores. The numerical evaluation scores are concatenated or weighted and fused with the model input feature scores to obtain the enhanced model input features; The enhanced model input features are used to input the request validity classification model, so as to output the validity type label of the current request through the request validity classification model.
5. The method according to any one of claims 1-4, characterized in that, At least one sub-library in the multi-dimensional semantic prototype library is dynamically updated based on a preset update strategy; The preset update strategy includes any one of the following: Incremental updates to the sub-database are performed based on periodic scheduled tasks; In response to the emergence of new trending events or new terms, new semantic prototypes are obtained from external knowledge sources and injected into the corresponding sub-libraries; Modify or expand the semantic prototypes in the sub-library.
6. The method according to any one of claims 1-4, characterized in that, The step of semantically encoding the fused text to obtain the target feature vector includes: The fused text is semantically encoded using a first encoding model to obtain a target feature vector; The method further includes: Using the first encoding model, determine the semantic prototype vectors contained in the N sub-libraries; The N sub-libraries include at least one of the following: The first sub-library contains semantic prototype vectors for representing answerable knowledge. A second sub-library containing semantic prototype vectors for clearly expressed ideas. It contains a third sub-library that uses semantic prototype vectors to describe functionalities within the target domain.
7. The method according to any one of claims 1-4, characterized in that, The method further includes: Based on the validity determination result of the current request, execute the corresponding response strategy; Specifically, when the validity judgment result of the current question is determined to be a rejection type, the generation of natural language response is suppressed.
8. A user request processing apparatus, characterized in that, include: The determination module is used to determine the fused text based on the user's current request and the corresponding context information, wherein the context information includes the user's historical requests and corresponding responses; The encoding module is used to perform semantic encoding on the fused text to obtain the target feature vector; The matching module is used to calculate the similarity between the target feature vector and the vectors of N sub-libraries in the multi-dimensional semantic prototype library, respectively, to obtain the matching score of the current request on N validity dimensions, where N is a positive integer; The input module is used to input the matching scores on the N validity dimensions as model input features into the request validity classification model; The prediction module is used to output the validity type label of the current request through the request validity classification model, wherein the validity type label includes rejection type.
9. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store a computer program, the processor being used to invoke and run the computer program stored in the memory to perform the user request processing method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, Used to store computer programs that cause electronic devices to perform a user request processing method as described in any one of claims 1-7.