LLM-based intelligent customer service multi-round task intention recognition method

By constructing an intent vector index library and a multi-view integrated discrimination algorithm, and combining uncertainty index control model calls, the problem of fragmented intent recognition in multi-turn dialogues of intelligent customer service systems has been solved, achieving efficient and reliable multi-turn task intent recognition and improving the user experience in e-commerce return and exchange scenarios.

CN121660697APending Publication Date: 2026-03-13GUIZHOU XISHAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing intelligent customer service systems struggle to fully utilize conversation history in multi-turn dialogues, resulting in fragmented and inconsistent intent recognition results. Furthermore, they are unable to identify intents that exceed the scope of the target audience, impacting user experience and efficiency.

Method used

By constructing an intent vector index library and a multi-view ensemble discrimination algorithm, and using a semantic coding model for multi-round task intent recognition, combined with dynamic control of model calls based on uncertainty indicators, the accuracy and consistency of intent recognition are improved, while reducing computing costs.

Benefits of technology

It improves the accuracy and consistency of intent recognition in complex e-commerce return and exchange scenarios, reduces response latency and computing costs, enhances the stability of detecting intents beyond the scope, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121660697A_ABST
    Figure CN121660697A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and particularly discloses an LLM-based intelligent customer service multi-round task intention recognition method, which is oriented to an e-commerce customer service multi-round dialogue scene, and comprises the following steps of: performing joint coding on a current user utterance and a session history by utilizing a semantic coding model and an intention classification head to obtain intention probability distribution; calculating label consistency and probability dispersion through multi-view integrated reasoning to obtain an uncertainty index, and adaptively switching between local model prediction and large language model reasoning; and for high-uncertainty samples, similar annotation dialogue construction prompts are retrieved from the intention vector index database, a large language model is guided to output candidate intentions, and out-of-range detection is completed based on internal vector and intention sample similarity. According to the method, efficient and reliable multi-round task intention recognition is realized, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and more specifically, to an intelligent customer service multi-turn task intent recognition method based on LLM. Background Technology

[0002] The rapid development of e-commerce platforms has led to a continuous increase in order volume and user visits, resulting in a significant growth trend in customer service tasks such as pre-sales consultation, order guidance, logistics tracking, and return / exchange processing. To reduce the cost of manual customer service and improve response efficiency, various e-commerce platforms have deployed a large number of task-oriented dialogue systems and intelligent customer service robots to handle standard question answering and some business processing.

[0003] In existing intelligent customer service systems, the intent recognition module typically employs a deep neural network classification model to convert the user's natural language input into internal intent labels, which drive subsequent business processes. Common approaches encode the user's single-turn utterance using convolutional neural networks, recurrent neural networks, or pre-trained language models, and then output the intent category through a fully connected layer. These methods can achieve high recognition accuracy in scenarios with a limited number of intents, clear semantic boundaries, and sufficient training data.

[0004] As e-commerce has developed further, the scenarios involved in after-sales service have become increasingly complex, especially regarding returns and exchanges. Users may raise multiple requests in a single conversation, such as partial returns of sets, size exchanges, combined pickup of orders from different stores, explanations of return reasons, and inquiries about compensation standards. These requests often gradually emerge over multiple rounds of interaction. Traditional single-round intent recognition struggles to fully utilize conversation history and lacks a proper grasp of the user's actual task boundaries, resulting in fragmented and inconsistent intent recognition results. This leads to improper breakdown of the after-sales process or duplicate creation of work orders, negatively impacting the user experience.

[0005] Regarding out-of-range detection, existing solutions mostly rely on setting thresholds based on the output probability of intent classifiers or introducing open-set recognition models to distinguish between intents within and outside the specified range through energy functions or feature space density estimation. In e-commerce scenarios, users may suddenly mention topics outside of platform policies or make requests that are not currently supported by the system. If these requests are not identified and properly guided in a timely manner, it will lead to the risk of complaints. However, when the number of intents increases and their granularity is inconsistent, these methods lack stability and adjustability.

[0006] The emergence of semantic coding models has provided a new approach to intent recognition. By providing task descriptions and a small number of labeled samples in the prompts, semantic coding models can understand the intent of multi-turn dialogues and have a certain ability to detect out-of-range scenarios. However, directly applying semantic coding models to intent recognition in all conversation turns suffers from high inference latency and high computational costs, making it unsuitable for large-scale deployment in high-concurrency e-commerce scenarios. Furthermore, the out-of-range detection performance of semantic coding models is highly sensitive to the number of intent labels and the semantic range, and without auxiliary mechanisms, it is difficult to maintain stable performance in complex return and exchange scenarios.

[0007] Therefore, existing technologies lack a method for intelligent customer service multi-turn task intent recognition that can fully utilize multi-turn context to improve intent recognition accuracy in complex e-commerce returns and exchanges and other typical scenarios, while also effectively identifying intents beyond the scope and controlling the cost of calling semantic encoding models. Summary of the Invention

[0008] To overcome the aforementioned deficiencies in existing technologies, this invention provides an LLM-based intelligent customer service multi-turn task intent recognition method. This method involves constructing an intent vector index library, obtaining initial intent probabilities based on semantic vectors and intent classification heads, and then calculating an uncertainty index using a multi-view ensemble discrimination algorithm. When the uncertainty index is below a first threshold, the initial intent prediction result is output; otherwise, the average similarity is calculated. If the average similarity is below a second threshold, it is judged as out of range; if the average similarity is not below the second threshold, the candidate intent is output as the final intent, thus solving the problems mentioned in the background technology.

[0009] To achieve the above objectives, the present invention provides the following technical solution:

[0010] The LLM-based intelligent customer service multi-turn task intent recognition method includes the following steps:

[0011] Step 1: Obtain the dialogue dataset, train the semantic vectors and intent classification head, and build an intent vector index library.

[0012] Step 2: Calculate the uncertainty index using a multi-view integrated discrimination algorithm.

[0013] Step 3: Compare the uncertainty index with the preset first threshold.

[0014] Step 4: Output the candidate intent and its corresponding reasoning explanation information.

[0015] Step 5: Calculate the mean similarity. If it is higher than the second threshold, the candidate intent is output as the final intent for the current round.

[0016] Step 6: Send the final intent and session history into the task orchestration module to drive the business process corresponding to the final intent.

[0017] As a further aspect of this invention, step 1 involves acquiring a dialogue dataset, training semantic vectors and intent classification heads, and constructing an intent vector index library. This includes the following specific steps: First, acquiring a multi-turn dialogue dataset of e-commerce customer service with intent annotations. The intents include at least one or more of the following: order creation, receiving issues, returns, exchanges, partial returns, cross-store returns, and door-to-door pickup appointments, to ensure that the training data covers the main typical task scenarios in e-commerce business. For each turn of the target user's speech in the dataset, the 2 to 10 most recent forward-looking dialogue turns are selected from its respective conversation as the conversation history. The customer service speech and user speech in the conversation history are concatenated sequentially in chronological order and input together with the current turn's user speech into a multi-turn context encoding network based on a self-attention mechanism. Through self-attention, the statements from different turns are weighted and aggregated, thereby automatically highlighting the turn information more relevant to the current task intent, generating a conversation representation vector containing contextual semantics and task state information, constituting a conversation sample for intent recognition.

[0018] After constructing the conversation samples, they are fed into a semantic encoding model fine-tuned through contrastive learning. This model performs semantic modeling on the entire multi-turn corpus, outputting a fixed-dimensional (768-dimensional) semantic vector. The semantic encoding model concatenates the semantic vector with the input intent classification head, using labeled intent tags to optimize the parameters of both the semantic encoding model and the intent classification head. This enhances the semantic encoding model's ability to distinguish different intents, particularly fine-grained after-sales intents such as returns, partial returns, and cross-store returns, while retaining key information from the multi-turn context. After training the semantic encoding model, each training set sample is processed sequentially to obtain the semantic vector representation and corresponding final intent tag for each conversation sample. These are stored as key-value pairs in an intent vector index library. This index library also records the intent category of the sample, example text, and statistical information, facilitating rapid online retrieval by intent or similarity.

[0019] As a further aspect of this invention, step 2, calculating the uncertainty index using a multi-view ensemble discrimination algorithm, includes the following specific content: The session management module reads the target round user utterances and their corresponding session history from the current e-commerce session. The session management module maintains a multi-round dialogue cache based on session identifiers, concatenates the most recent preset number of historical utterances with the current round user utterances in chronological order, preprocesses them, and inputs them into the aforementioned semantic encoding model. The semantic encoding model encodes the entire multi-round text to obtain a session representation vector characterizing the overall semantics and task state of the current dialogue. The session representation vector is then fed into the intent classification head, outputting a probability value, thereby forming an initial intent probability distribution. The candidate intent with the highest probability is used as the initial intent prediction result.

[0020] The same conversation sample is subjected to multiple forward inferences using a multi-view ensemble discriminant algorithm to obtain multiple prediction results. The decision credibility is calculated based on the consistency among the multiple prediction results and the dispersion of the intent probability distribution. This credibility is used to determine whether to adopt the local result or route the conversation sample to the large language inference process. The process includes the following steps:

[0021] Step 21: After completing the comparative learning fine-tuning, based on the same e-commerce customer service multi-turn dialogue dataset, different random initialization, sample resampling and training rounds are used to train several semantic encoding models with the same structure but different parameters and combine them with intent classification heads to form a model set.

[0022] Step 22: For the target round user utterance and its conversation history in the current e-commerce platform session, the session management module outputs a complete context containing the most recent N rounds of dialogue. Based on this, multiple input forms of the session view are constructed: one type of view retains all N rounds of context; another type of view only retains the sub-window centered on the current round; and another type of view performs lightweight rewriting of a small amount of non-critical information without changing the semantics. Furthermore, historical sample fragments similar to the current session are retrieved from the intent vector index library and spliced ​​together to form an extended context view.

[0023] Step 23: Each conversation view obtained in Step 22 is sequentially input into each semantic encoding model and intent classification head combination constructed in Step 21 to obtain multiple forward inference results under different models and different view conditions. Specifically, for each "view-model" combination, the semantic encoding model first encodes the multi-round text to obtain a conversation representation vector, and then the intent classification head outputs the probability distribution on each intent dimension such as order creation, receipt issues, returns, exchanges, partial returns, cross-store returns, and door-to-door pickup appointments. Finally, K×M sets of intent probability vectors and corresponding prediction label sets are formed, where K is the number of models and M is the number of views. These results together constitute the set of multiple prediction results for the same conversation sample.

[0024] Step 24: After obtaining the K×M group of predicted label results, the dominant intent of each group of predicted labels is counted. The dominant intent refers to the intent with the highest probability in each prediction. The occurrence frequency of the dominant intent in all predictions is counted to obtain the occurrence frequency of each intent label. Then, the intent with the highest occurrence frequency is selected, and the frequency is normalized to a label consistency index between 0 and 1.

[0025] Step 25: In addition to the label consistency, perform dimension-by-dimensional statistics on the K×M group intention probability vectors, calculate the probability mean and probability variance of each intention dimension in all predictions, and further normalize the probability mean and probability variance as an index of probability distribution dispersion.

[0026] Step 26: After obtaining the label consistency index from step 24 and the probability distribution dispersion index from step 25, the uncertainty index is calculated using the adaptive fusion kernel method.

[0027] As a further aspect of the present invention, step 3 compares the uncertainty index with a preset first threshold, including the following: when the uncertainty index is lower than the preset first threshold, the initial intent prediction result is used as the final intent output for the current round, and the final intent is bound to the session identifier and task state vector and cached; when the uncertainty index is higher than the first threshold, proceed to step 4.

[0028] As a further aspect of the present invention, step 4, outputting candidate intents and their corresponding reasoning explanations, includes the following specific content: calling the semantic encoding model to encode the current session sample marked as high uncertainty in step 3; inputting the multi-turn text containing the recent several rounds of session history and the target round user's utterance into the semantic encoding model to obtain a session representation vector characterizing the overall semantics and task state of the session; and using the session representation vector as the query vector; taking each candidate intent registered in the intent vector index as the retrieval entry point; performing a similarity retrieval for each candidate intent in its corresponding training sample vector set; selecting several training samples with similarity higher than a pre-set retrieval threshold; retrieving the original multi-turn dialogue text, known intent tags, and their sentence vector representations of these samples; and associating them with the natural language intent description generated by the semantic encoding model during the training phase of the candidate intent; forming a typical example set covering different business scenarios such as "return, exchange, partial return, cross-store return, and door-to-door pickup appointment". Based on this, a prompt message for the semantic encoding model is constructed. The prompt message is organized using a unified template and includes: a task description for multi-turn task intent recognition in intelligent customer service, explicitly requiring the semantic encoding model to comprehensively judge the user's true business needs based on multi-turn dialogue; summaries of several retrieved training samples grouped by intent category, used to show the typical language patterns of each intent to the semantic encoding model; a natural language description of each candidate intent, used to help the model distinguish intent boundaries; and a thought chain reasoning guide for complex return and exchange, multi-task combination, etc., used to guide the semantic encoding model to reason step by step in the order of "first analyze user needs - then compare candidate intents - finally give judgment conclusions and reasons". Subsequently, the above prompt message and the complete multi-turn text of the current conversation sample are input into the semantic encoding model. After comprehensively understanding the prompt message and conversation content, the semantic encoding model outputs at least one candidate intent and simultaneously provides explanatory information corresponding to each candidate intent. The explanatory information is used to explain the correspondence between the candidate intent and the user's expression and the key semantic basis for making the judgment.

[0029] As a further aspect of the present invention, step 5, calculating the average similarity, and if it is higher than the second threshold, then the candidate intent is output as the final intent of the current round, includes the following specific content: reading the internal vector representation corresponding to the current session sample from the decoding process of the semantic coding model, calculating the average similarity between the internal vector representation and the training sample representation of the candidate intent in the intent vector index library, comparing the average similarity with the preset second threshold, and when the average similarity is less than the second threshold, marking the current session sample as an intent that exceeds the range of supported intents, and when the average similarity is not less than the second threshold, outputting the candidate intent as the final intent of the current round.

[0030] As a further aspect of the present invention, step 6 involves sending the final intent and conversation history into the task orchestration module to drive the business process corresponding to the final intent. This includes the following specific content: inputting the final intent, conversation history, and task state vector into the e-commerce intelligent customer service task orchestration module to drive at least one business process or external tool call in the order management system, after-sales system, and logistics system corresponding to the final intent, in order to complete multiple rounds of task processing, including complex returns and exchanges.

[0031] The technical effects and advantages of the LLM-based intelligent customer service multi-turn task intent recognition method of this invention are as follows: By constructing an intent vector index library and a multi-view ensemble discrimination algorithm, this invention effectively solves the problem in existing technologies where single-turn intent recognition is difficult to utilize multi-turn context, resulting in fragmented and inconsistent intent recognition results. This improves the accuracy and consistency of intent recognition in complex multi-task scenarios such as returns and exchanges in e-commerce. Simultaneously, this method dynamically controls the invocation of the semantic coding model through uncertainty indicators, performing deep inference only when there is significant discrepancy in model predictions. This reduces computational costs and response latency, and enhances the stability of detecting intents beyond the scope by utilizing the semantic understanding capability of the semantic coding model. This avoids the instability of traditional methods when the number of intents increases or the granularity is inconsistent, thus achieving efficient and reliable multi-turn task intent recognition, improving user experience, and reducing the need for human customer service intervention. Attached Figure Description

[0032] Figure 1 This is a flowchart of the LLM-based intelligent customer service multi-turn task intent recognition method of the present invention.

[0033] Figure 2 This is a schematic diagram of the semantic encoding model structure of the present invention.

[0034] Figure 3 This is a schematic diagram of the multi-view integrated discrimination algorithm of the present invention.

[0035] Figure 4This is a schematic diagram illustrating the similarity between the internal vectors of the semantic encoding model of this invention and the intention sample, as well as the out-of-range detection. Detailed Implementation

[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0037] Example 1

[0038] like Figure 1 As shown, the present invention provides an intelligent customer service multi-turn task intent recognition method based on LLM, which includes the following steps:

[0039] Step 1: Obtain the dialogue dataset, train the semantic vectors and intent classification head, and build an intent vector index library.

[0040] Step 2: Calculate the uncertainty index using a multi-view integrated discrimination algorithm.

[0041] Step 3: Compare the uncertainty index with the preset first threshold.

[0042] Step 4: Output the candidate intent and its corresponding reasoning explanation information.

[0043] Step 5: Calculate the mean similarity. If it is higher than the second threshold, the candidate intent is output as the final intent for the current round.

[0044] Step 6: Send the final intent and session history into the task orchestration module to drive the business process corresponding to the final intent.

[0045] Further, step 1, acquiring the dialogue dataset, training semantic vectors and intent classification heads, and constructing an intent vector index library, includes: firstly, acquiring a multi-turn dialogue dataset of e-commerce customer service with intent annotations. The intents include at least one or more of the following: order creation, receipt issues, returns, exchanges, partial returns, cross-store returns, and door-to-door pickup appointments, to ensure that the training data can cover the main typical task scenarios in e-commerce business. In this embodiment, the process of acquiring the dataset is as follows: from the existing online customer service system and after-sales work order system of the e-commerce platform, extract real multi-turn dialogue records within a certain time window according to the conversation ID, and automatically de-identify sensitive information such as names, phone numbers, addresses, and bank card numbers through regular expression rules and entity recognition algorithms to form anonymized original multi-turn dialogue data; then, combining the existing work order types, after-sales reason codes, routing queues, and FAQ numbers hit by the robot, the entire conversation and some turns are automatically pre-annotated, initially mapping them to order creation, receipt issues, returns, exchanges, partial returns, cross-store returns, and door-to-door pickup appointments, to ensure that the training data can cover the main typical task scenarios in e-commerce business. Intent tags such as returns, cross-store returns, and door-to-door pickup appointments are generated. Based on this, the complete dialogue is presented to the annotators using an internal annotation platform or general data annotation tools. The annotators read the user's words one round at a time, and select or modify the corresponding intent tags for each round of user words based on the pre-annotation results. Multi-tag annotation is supported, and rounds without business requests are labeled as "no intent". Finally, the consistency of annotation is improved through a two-person re-annotation, sampling quality inspection, and arbitration mechanism. The dialogues that pass the quality inspection are organized by the conversation dimension to obtain a multi-turn dialogue dataset for e-commerce customer service that includes conversation history, round-level user words, and their corresponding intent tags.

[0046] For each round of target user utterance in the dataset, the 2 to 10 most recent rounds of dialogue in its respective conversation are selected as the conversation history. The customer service utterances and user utterances in the conversation history are concatenated in chronological order and input together with the current round of user utterances into a multi-round context encoding network based on a self-attention mechanism. Through self-attention, the statements of different rounds are weighted and aggregated, thereby automatically highlighting the round information that is more relevant to the current task intent, generating a conversation representation vector containing contextual semantics and task state information, which constitutes a conversation sample for intent recognition.

[0047] After constructing the conversation samples, they are fed into a semantic encoding model fine-tuned through contrastive learning. This model performs semantic modeling on the entire multi-turn corpus, outputting a fixed-dimensional (768-dimensional) semantic vector. This semantic vector is generated by encoding a text sequence containing conversation history and the current user's utterance. It comprehensively represents the position of the current conversation in the semantic space and key information related to intents such as order creation, receiving issues, returns, exchanges, partial returns, cross-store returns, and door-to-door pickup appointments. The semantic encoding model connects the semantic vector to an input intent classification head and optimizes the parameters of both the semantic encoding model and the intent classification head using labeled intent tags. This enhances the semantic encoding model's ability to distinguish different intents, especially fine-grained after-sales intents such as returns, partial returns, and cross-store returns, while preserving key information from the multi-turn context. The intent classification head consists of a linear fully connected layer and an output layer. The linear fully connected layer contains a ReLU activation function and a Dropout layer to further transform and compress the features of the semantic vector. The number of neurons in the output layer is equal to the total number of intent labels (e.g., order creation, receipt issues, returns, exchanges, partial returns, cross-store returns, door-to-door pickup appointments, etc.). A Sigmoid activation function is used on each output dimension to obtain independent probability values ​​for each intent dimension, thereby achieving multi-label classification.

[0048] Further, in step 2, the uncertainty index is calculated using a multi-view ensemble discriminant algorithm. This includes: the session management module reading the target round user utterances and their corresponding session history from the current e-commerce session. The session management module maintains a multi-round dialogue cache based on the session identifier, concatenating the historical utterances from the most recent preset rounds with the current round user utterances in chronological order. After preprocessing, the concatenation is input into the aforementioned semantic encoding model, which encodes the entire multi-round text to obtain a session representation vector characterizing the overall semantics and task state of the current dialogue. The session representation vector is then fed into the intent classification head. The intent classification head, as a multi-label classification network composed of linear transformations and nonlinear activations, outputs a probability value for each preset intent dimension, such as order creation, receiving issues, returns, exchanges, partial returns, cross-store returns, and door-to-door pickup appointments, thereby forming an initial intent probability distribution. The candidate intent with the highest probability is then used as the initial intent prediction result.

[0049] like Figure 3 As shown, the same conversation sample is subjected to multiple forward inferences using a multi-view ensemble discriminant algorithm to obtain multiple prediction results. The decision credibility is calculated based on the consistency among the multiple prediction results and the dispersion of the intent probability distribution. This credibility is used to determine whether to adopt the local result or route the conversation sample to the large language inference process. The process includes the following steps:

[0050] Step 21: After completing the contrastive learning fine-tuning, six sentence vector models with the same structure but different parameters and intent classification heads are constructed as a model set based on the same e-commerce customer service multi-turn dialogue dataset. Specifically, the basic sentence vector model parameters obtained after contrastive learning fine-tuning are selected as the shared starting point, and the corresponding parameters are denoted as θ. 0 The encoder parts of all six models start from θ 0 Loading; then, different random seeds are assigned to each model to control the initialization of the classification head weights and the order of data shuffling during training. The random seeds for models 1 through 6 are 11, 22, 33, 44, 55, and 66 respectively, ensuring that even with the same training data and hyperparameters, each model will converge to different local optima. Regarding sample resampling, models 1 and 2 directly use the complete training set, but within each epoch, the sample order is independently and randomly shuffled according to their respective random seeds. Models 3 and 4 use a bootstrap sampling method, generating a sample of the same size as the original training set by sampling with replacement from the original training set. The training subsets are designed to differentiate the frequency of sample occurrences. Models 5 and 6 introduce an intent category balancing resampling strategy based on autopilot sampling, increasing the sampling probability of long-tail intent samples such as returns, partial returns, cross-store returns, and door-to-door pickup appointments. This increases the proportion of these intents in their training subsets, enhancing the model's sensitivity to complex after-sales scenarios. In terms of training epochs, Models 1 and 2 are trained for 3 epochs on their respective data subsets, Models 3 and 4 for 4 epochs, and Models 5 and 6 for 5 epochs, maintaining the same learning rate and batch size. Different training epochs and sample traversal times further widen the parameter differences between models. After the above different random initializations (different initial weights for the classification head and different data shuffling order), sample resampling (original full dataset, bootstrap, and autopilot sampling + category balancing), and training epoch configurations, six sentence vector models with consistent structures but different parameter distributions are obtained, combined with intent classification heads to form a model set for uncertainty estimation.

[0051] Step 22: For the target round of user utterances and their conversation history in the current e-commerce platform session, the session management module outputs a complete context containing the most recent N (N=6) rounds of dialogue. Based on this, multiple "view equivalent" input forms are constructed: one type of view retains all N rounds of context; another type of view only retains the sub-window centered on the current round; and another type of view lightly rewrites a small amount of non-critical information without changing the semantics, such as normalized emoticons, standardized monetary descriptions, or merging consecutive confirmation statements. Furthermore, historical sample fragments similar to the current session are retrieved from the intent vector index library and spliced ​​together to form an "extended context view".

[0052] Step 23: Each conversation view obtained in Step 22 is sequentially input into each semantic encoding model and intent classification head combination constructed in Step 21 to obtain multiple forward inference results under different models and different view conditions. Specifically, for each "view-model" combination, the semantic encoding model first encodes the multi-round text to obtain a conversation representation vector, and then the intent classification head outputs the probability distribution on each intent dimension such as order creation, receipt issues, returns, exchanges, partial returns, cross-store returns, and door-to-door pickup appointments. Finally, K×M sets of intent probability vectors and corresponding prediction label sets are formed, where K is the number of models and M is the number of views. These results together constitute the set of multiple prediction results for the same conversation sample.

[0053] Step 24: After obtaining the K×M predicted label results, the dominant intent of each predicted group is counted. The dominant intent refers to the intent with the highest probability in each prediction. The occurrence frequency of the dominant intent in all predictions is counted to obtain the occurrence frequency of each intent label. Then, the intent with the highest occurrence frequency is selected, and the frequency is normalized to a label consistency index between 0 and 1. The higher the label consistency, the more concentrated the judgments of different models and different views on the current session sample are, and the more "confident" the model is at the label level. The lower the label consistency, the greater the discrepancy in the prediction results.

[0054] Step 25: In addition to the label consistency, perform dimension-by-dimensional statistics on the K×M group of intent probability vectors, calculate the probability mean and probability variance of each intent dimension in all predictions, and further normalize the probability mean and probability variance as a probability distribution dispersion index. When the probability values ​​given by different models and different views are highly concentrated and the variance is small, the probability distribution is considered stable and the dispersion index is low. When the probability fluctuates greatly in each intent dimension and the probability distribution shape between different predictions is significantly different, the dispersion index increases, reflecting the degree of hesitation of the model in the numerical level regarding the current session sample.

[0055] Step 26: After obtaining the label consistency index from step 24 and the probability distribution dispersion index from step 25, the uncertainty index is calculated using the adaptive fusion kernel method.

[0056] In step 26, the adaptive fusion kernel method specifically includes: statistically analyzing the typical value ranges of the label consistency index and the probability distribution dispersion index on the validation set, and stretching and truncating the label consistency index and the probability distribution dispersion index according to preset upper and lower boundaries, so that the higher the label consistency index, the closer the corresponding value is to the lower bound, and the higher the probability distribution dispersion index, the closer the corresponding value is to the upper bound, thereby ensuring that the two types of indices are comparable on the same numerical scale; then, on an independent e-commerce return and exchange validation dataset, different combinations of basic weights are tried through grid search, for example, appropriately increasing the weight of label consistency in scenarios where the overall prediction results are stable, and appropriately increasing the weight of probability distribution dispersion in scenarios with long-tail intent or sparse training samples, and selecting initial weights that balance the coverage and misuse rate of the sample set routed to the semantic coding model with the goal of "high uncertainty samples should include as many actual difficult examples as possible"; after obtaining the initial weights, according to the uncertainty of the current session... The weights are dynamically fine-tuned within the interval. For example, when label consistency is already at an extremely high level, the influence of probability distribution dispersion is appropriately reduced to prevent individual probability fluctuations from amplifying overall uncertainty. When label consistency is at a moderate level but probability dispersion is significantly high, the sensitivity to probability dispersion is increased, making the model more attentive to numerical discrepancies among multiple models and views. Subsequently, the dynamically adjusted label consistency weight and probability distribution dispersion weight are applied to the label consistency and probability distribution dispersion indices, respectively. A weighted sum is then performed to obtain the original uncertainty value, which is smoothed by incorporating the historical uncertainty distribution of similar sessions over a recent period to prevent drastic jumps in the uncertainty index of a single session sample. Finally, the obtained original uncertainty value is compressed into a fixed interval using a monotonic mapping function pre-calibrated on the validation set to form an uncertainty index for threshold comparison. This uncertainty index integrates both the voting consistency at the label level and reflects the numerical dispersion at the probability level.

[0057] Further, in step 3, the uncertainty index is compared with a preset first threshold. This includes comparing the uncertainty index obtained in step 2 with the pre-defined first threshold. If the uncertainty index corresponding to the current session sample is less than the first threshold, it is determined that the integrated output of the semantic coding model has sufficient credibility. At this time, the initial intent prediction result given by the intent classification head is directly confirmed as the final intent of this round of the session. The session management module writes the final intent, along with the corresponding session identifier, consistency statistics, and timestamp, into the session cache for reference in subsequent rounds when constructing task state vectors and performing multi-round intent tracking, thereby ensuring that the creation and receipt of the same order are consistent. The semantic continuity of the goods issue or return / exchange process in multi-turn dialogue; conversely, when the uncertainty index is greater than or equal to the first threshold, it indicates that there is a large discrepancy between the prediction results of different models and different views, or that the intent probability distribution is highly divergent among the candidate labels. In this case, the initial intent prediction result will not be directly adopted. Instead, the current session sample will be marked as a high uncertainty sample through the state machine, and the sample content, uncertainty index and historical intent information related to the session will be packaged and passed to the subsequent semantic encoding model processing branch, entering step 4, so as to re-evaluate the true task intent of the current round under stronger semantic reasoning and out-of-range review mechanism.

[0058] Further, step 4, outputting candidate intents and their corresponding reasoning explanations, includes: calling the semantic encoding model to encode the current conversation samples marked as high uncertainty in step 3; inputting the multi-turn text containing the recent conversation history and the target round user's utterance into the semantic encoding model to obtain a conversation representation vector characterizing the overall semantics and task state of the conversation; using the candidate intents registered in the intent vector index as retrieval entry points; performing similarity retrieval for each candidate intent in its corresponding training sample vector set; selecting several training samples with similarity higher than a pre-set retrieval threshold; retrieving the original multi-turn dialogue text, known intent tags, and their sentence vector representations of these samples; and associating them with the natural language intent description generated by the semantic encoding model during the training phase of the candidate intent; forming a typical example set covering different business scenarios such as "returns, exchanges, partial returns, cross-store returns, and door-to-door pickup appointments". Based on this, a prompt message for the semantic encoding model is constructed. The prompt message is organized using a unified template and includes: a task description for multi-turn task intent recognition in intelligent customer service, explicitly requiring the semantic encoding model to comprehensively judge the user's true business needs based on multi-turn dialogue; summaries of several retrieved training samples grouped by intent category, used to show the typical language patterns of each intent to the semantic encoding model; a natural language description of each candidate intent, used to help the model distinguish intent boundaries; and a thought chain reasoning guide for complex return and exchange, multi-task combination, etc., used to guide the semantic encoding model to reason step by step in the order of "first analyze user needs - then compare candidate intents - finally give judgment conclusions and reasons". Subsequently, the above prompt message and the complete multi-turn text of the current conversation sample are input into the semantic encoding model. After comprehensively understanding the prompt message and conversation content, the semantic encoding model outputs at least one candidate intent and simultaneously provides explanatory information corresponding to each candidate intent. The explanatory information is used to explain the correspondence between the candidate intent and the user's expression and the key semantic basis for making the judgment.

[0059] Further, in step 5, the mean similarity is calculated. If it is higher than the second threshold, the candidate intent is used as the final intent output for the current round. This includes: while the semantic encoding model completes the output of candidate intents and explanatory information, the internal vector representation corresponding to the current session sample is read from the decoding process or the final hidden state of the semantic encoding model. This internal vector representation can be selected as the aggregated hidden state after encoding the entire multi-round dialogue, used to characterize the semantic encoding model's understanding of the overall semantics of the current session. Subsequently, in the semantic encoding model output results obtained in step S4, the candidate intent with the highest confidence or the highest ranking is selected as the main candidate intent. A set of training sample vectors stored under this candidate intent is located in the intent vector index library. The internal vector representation of the current session is sequentially compared with the set of training sample vectors to calculate the similarity, and the mean of all similarity values ​​is calculated. The similarity is calculated to obtain the average similarity value, which reflects the overall closeness between the current session semantics and the historical samples of the candidate intent. Then, the average similarity value is compared with a second threshold pre-defined on the validation set. When the average similarity is lower than the second threshold, it indicates that although the semantic encoding model provides the candidate intent at the text level, the current session is far from the typical samples of this intent in terms of vector space distribution. Therefore, the current session sample is marked as an intent outside the supported intent range, and an out-of-range flag is output to indicate the need for manual intervention or business expansion. When the average similarity is not lower than the second threshold, it is considered that the current session and the corresponding sample of the candidate intent are sufficiently close in semantic space, and the judgment of the semantic encoding model has high credibility. Therefore, the candidate intent is confirmed as the final intent output of the current round and written to the session cache for subsequent task orchestration and continuous tracking of intents in multiple rounds. Figure 4 As shown, this invention utilizes the mean similarity between the internal vector of the semantic encoding model and the training sample vector of the candidate intent to perform out-of-range detection. When the similarity is lower than the second threshold, an out-of-range flag is output; when the similarity is not lower than the second threshold, the candidate intent is confirmed.

[0060] As a further aspect of the present invention, step 6 involves sending the final intent and conversation history to the task orchestration module to drive the business process corresponding to the final intent. This includes: after the final intent of the current round is confirmed through uncertainty judgment and semantic encoding model verification, the final intent and the multi-round historical context of the corresponding conversation are input into the intelligent customer service task orchestration module. The task orchestration module selects a pre-configured processing template based on the intent type and the task state vector already accumulated in the conversation, mapping semantic tags such as "return, exchange, partial return, cross-store return, door-to-door pickup appointment" to specific knowledge retrieval actions, business process nodes, or external tool call instructions. For pure consultation intents, the module prioritizes... First, knowledge base retrieval and rule engine reasoning are triggered to return structured answers, which are then organized into natural language responses by the dialogue generation component. For operational intents involving order creation, return and exchange processing, discount recalculation, and door-to-door pickup arrangements, standardized interfaces are used to call the order system, logistics system, or marketing system to generate return work orders, split sub-orders, merge door-to-door pickup tasks from different stores, or recalculate the refund amount. After the business system returns the execution results, the task status information and intermediate processing results in the session are updated to form a context that can be referenced in subsequent rounds. Then, the response generation module provides feedback to the user on the processing progress and conclusion based on the latest business status, thereby achieving closed-loop processing for multi-round tasks.

[0061] Example 2

[0062] This invention is applied to handling complex return and exchange scenarios in e-commerce, and the specific process is as follows:

[0063] I. Example of a multi-turn user dialogue:

[0064] In the first round, a user sent a message: "I only want to return the pants of this three-piece set, I'll keep the top."

[0065] In the second round, the user further explained: "The pants are too big in the waist, I can exchange them for a smaller size if I want."

[0066] In the third round, the user added: "The other pair of shoes was bought from another store, and I would like to return them together. Could you please arrange for pickup and processing in one go?"

[0067] In the fourth round, users asked: "If a partial return is made, will the discount be recalculated?"

[0068] II. Multi-round context coding and initial recognition:

[0069] The session management module treats the aforementioned user messages as a single session, cleans the utterances from each turn, and sends them to the multi-turn context encoding module. The encoding module uniformly encodes the four turns of utterances into a session representation vector. The intent classification head initially outputs multi-label intent predictions, including intents for partial returns of bundled items, single-item exchanges, cross-store returns, and combined door-to-door pickup. An uncertainty index is calculated using a multi-view clustering discriminant algorithm. If significant differences are found between different forward inference results, the sample is classified as high uncertainty and routed to the semantic encoding model.

[0070] Third, after receiving the prompt information, the semantic encoding model first analyzes the user's core needs in the multi-turn conversation, clarifying that the user wants to return or exchange the pants in the set, return the shoes from another store, and simultaneously arrange a door-to-door pickup. After comparing the candidate intents, the semantic encoding model outputs a set of candidate intents, including the intent to return part of the set, the intent to exchange the pants, the intent to return across stores, and the intent to combine door-to-door pickup, and generates textual explanations illustrating the correspondence between these intents and the user's statements.

[0071] IV. Internal Representation Similarity Verification and Out-of-Range Judgment:

[0072] The semantic encoding model internally extracts the internal vector representation corresponding to the current session sample. This vector is then compared with the training sample vectors under the combined intents of package returns, exchanges, cross-store returns, and door-to-door pickup in the intent vector index library, and the mean similarity is calculated for each. If the mean similarity of any intent is not lower than a second threshold, the intent is confirmed as valid; if the mean similarity of all intents is lower than the second threshold, the session is judged as an intent outside the scope, and manual intervention is required. In this embodiment, the mean similarity meets the threshold requirement, therefore the system confirms that the above multiple intents are valid.

[0073] V. Task Scheduling and Business Process Execution:

[0074] The return and exchange process is generated based on the final intent set. For partial returns of sets, the sub-order containing the pants is separated in the order system and a return work order is created; for exchanges of pants, an exchange work order is generated and the target size is specified; for cross-store returns, return work orders are created for the orders under both stores; for combined door-to-door pickups, the logistics system determines whether the corresponding warehouses of the two stores support combined door-to-door pickups, and if the conditions are met, a combined pickup instruction is generated. Regarding the issue of recalculating discounts, the amount refundable to the user is recalculated according to the platform's promotional rules, and explanatory text is generated by the semantic encoding model and fed back to the user.

[0075] Through the above process, the present invention can correctly identify multiple related intentions in complex return and exchange scenarios and combine them into continuous return and exchange tasks, reducing the involvement of human customer service and lowering the probability of misjudgment.

[0076] The above description is merely a specific embodiment 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 scope of the technology 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.

[0077] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A multi-turn task intent recognition method for intelligent customer service based on LLM, characterized in that, Includes the following steps: Step 1: Obtain the dialogue dataset, train the semantic vectors and intent classification head, and build an intent vector index library; Step 2: Calculate the uncertainty index using a multi-view ensemble discrimination algorithm; Step 3: Compare the uncertainty index with the preset first threshold; Step 4: Output the candidate intents and their corresponding reasoning explanations; Step 5: Calculate the mean similarity score. If it is higher than the second threshold, the candidate intent will be output as the final intent for the current round. Step 6: Send the final intent and conversation history into the task orchestration module to drive the business process corresponding to the final intent; The multi-view ensemble discrimination algorithm performs forward inference on the same session sample to obtain prediction results. It calculates uncertainty indices based on the label consistency index and the dispersion of the intent probability distribution among the prediction results, including: Step 21: Train a semantic encoding model and an intent classification head combination based on the dialogue dataset; Step 22, construct the input format for the session view; Step 23: Combine the conversation view with the semantic encoding model and the intent classification head to obtain the forward inference result, namely the intent probability vector and the set of predicted labels; Step 24: Statistically analyze the dominant intent of each group of predicted labels, select the intent with the highest frequency, and normalize it into a label consistency index. Step 25: Normalize the probability mean and probability variance of the intention probability vector as an index of probability distribution dispersion. Step 26: The uncertainty index is calculated using the adaptive fusion kernel method.

2. The LLM-based intelligent customer service multi-turn task intent recognition method according to claim 1, characterized in that... The adaptive fusion kernel method calculates the uncertainty index by: statistically analyzing the typical value ranges of the label consistency index and the probability distribution dispersion index on the validation set, and stretching and truncating the label consistency index and the probability distribution dispersion index according to preset upper and lower boundaries, so that the value corresponding to higher label consistency is closer to the lower bound, and the value corresponding to higher probability distribution dispersion is closer to the upper bound; then, by searching different basic weight combinations through grid search, selecting initial weights that balance the coverage and misuse rate of the sample set routed to the semantic coding model, dynamically fine-tuning the weight combination according to the uncertainty interval of the current session, applying the fine-tuned weight combination to the label consistency and probability distribution dispersion indices respectively, performing a weighted summation of the two to obtain the original uncertainty value, and finally compressing the original uncertainty value into a fixed interval through a monotonic mapping function pre-calibrated on the validation set to form the uncertainty index for threshold comparison.

3. The LLM-based intelligent customer service multi-turn task intent recognition method according to claim 1, characterized in that... The process of obtaining the dialogue dataset includes: extracting real multi-turn dialogue records from the online customer service system and after-sales work order system of the e-commerce platform according to the conversation identifier; de-identifying sensitive fields such as name, phone number, address, and bank card number; automatically pre-annotating the entire conversation and some turns by combining the work order type, after-sales reason code, and routing queue; then having annotators read the user's words turn by turn to complete or correct the intent label annotation; marking turns without business requests as no intent; and improving the consistency of annotation through a double-person re-annotation, sampling quality inspection, and arbitration mechanism to obtain a multi-turn dialogue dataset containing conversation history, turn-level user words, and corresponding intent labels.

4. The LLM-based intelligent customer service multi-turn task intent recognition method according to claim 1, characterized in that, For each round of target user utterance in the multi-turn dialogue dataset, the 2 to 10 most recent rounds of dialogue are selected from its respective conversation as the conversation history. The customer service utterances and user utterances in the conversation history are concatenated in chronological order and input together with the current round of user utterances into the semantic encoding model. The semantic encoding model then uses a self-attention mechanism to perform weighted aggregation of statements from different rounds, generating a conversation representation vector that includes contextual semantics and task state information.

5. The LLM-based intelligent customer service multi-turn task intent recognition method according to claim 1, characterized in that, The semantic encoding model adopts an encoder-type deep neural network structure, including an input encoding layer, a self-attention encoding layer, and a pooling output layer. The input encoding layer embeds multi-turn conversation text through word vectors, position encoding, and role type vectors. The self-attention encoding layer is composed of multiple layers of encoding blocks stacked together, including multi-head self-attention sub-layers and feedforward fully connected sub-layers, and residual connections and layer normalization structures are used in each sub-layer. The pooling output layer normalizes the sequence representation after the last layer of encoding to a fixed-dimensional semantic vector. The semantic vector is connected to the input intent classification head, and after multi-label classification training, it is stored together with the corresponding final intent label in the intent vector index library.

6. The LLM-based intelligent customer service multi-turn task intent recognition method according to claim 1, characterized in that, The calculation of the mean similarity includes: reading the internal vector representation corresponding to the current session sample from the decoding process or the final hidden state of the semantic coding model; selecting the candidate intent with the highest confidence as the main candidate intent, locating the training sample vector under the candidate intent in the intent vector index library; calculating the similarity between the internal vector representation and the training sample vector in turn, and obtaining the mean similarity.

7. The LLM-based intelligent customer service multi-turn task intent recognition method according to claim 1, characterized in that, The task orchestration module selects a processing template based on the intent type and the task state vector in the session, mapping the intent to knowledge retrieval actions, business process nodes, or external tool call instructions.

8. The LLM-based intelligent customer service multi-turn task intent recognition method according to claim 1, characterized in that, The semantic vector has a dimension of 768; the first threshold and the second threshold are pre-calibrated on the validation set.

9. The LLM-based intelligent customer service multi-turn task intent recognition method according to claim 1, characterized in that, The input formats of the session view include: a view that retains all N rounds of context, a view that retains the sub-window centered on the current round, a view that performs lightweight rewriting of non-critical information, and an extended context view that is spliced ​​together from similar historical sample fragments retrieved from the intent vector index library; wherein, the lightweight rewriting includes normalized emojis, standardized monetary descriptions, or merging consecutive confirmation statements.

10. The LLM-based intelligent customer service multi-turn task intent recognition method according to claim 1, characterized in that, After updating the task status information, the task orchestration module forms a context for subsequent rounds to reference, and provides feedback on the processing progress and conclusions to the user based on the latest business status. The context includes session history, task status vector, and intermediate processing results, which are used for continuous tracking of intent in multiple rounds.