Session control method and device
By analyzing user intent using a natural language understanding model and selecting appropriate conversational decisions, and combining lightweight and large language models to generate response information, this approach solves the problems of low accuracy and computational redundancy in existing dialogue systems for complex and ambiguous requests, achieving efficient and accurate interactive processing.
Patent Information
- Application Number
- CN202511324319.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2025-12-30
AI Technical Summary
Existing dialogue systems have low accuracy in generating response information when handling complex and ambiguous user requests, struggle to effectively utilize contextual information, and suffer from computational redundancy, failing to meet the needs of low-latency scenarios.
The system uses a natural language understanding model to analyze user request information, selects the user intent with the highest confidence level, and determines the type based on the confidence level of the intent. It then selects an appropriate conversation decision to generate response information, including four strategies: direct execution, selective follow-up questioning, exploratory follow-up questioning, and fallback reporting. The system combines a lightweight and large language model task execution module to generate responses.
It improved the accuracy of reply messages, optimized the use of computing resources, and significantly improved the system's interaction success rate and user satisfaction in complex and ambiguous scenarios.
Smart Images

Figure CN121233720A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a session control method and apparatus. Background Technology
[0002] With the development of artificial intelligence technology, dialogue systems have been widely used in customer service, consulting, and other fields. However, existing dialogue system technologies still face many problems and challenges when handling complex and ambiguous user requests. One approach is to use rule-based or traditional machine learning methods, while early dialogue systems often used keyword matching, rule templates, or traditional machine learning models. These methods require a large amount of manually written rules and labeled data, resulting in high maintenance costs. They also struggle to handle users' colloquial and ambiguous expressions, fail to effectively utilize contextual information, leading to a rigid interactive experience and poor generalization ability. Another approach is to use retrieval enhancement schemes, which retrieve relevant documents from a knowledge base based on the user's question and provide them to a large language model to generate an answer. However, this approach heavily relies on keyword or vector similarity matching. When the user input is ambiguous or contains ambiguous words, it is easy to retrieve irrelevant or inaccurate "background knowledge," thereby misleading the large language model to generate incorrect or irrelevant responses, which is particularly unreliable in scenarios requiring precise execution of business processes. In another approach, language models are directly used for end-to-end intent recognition and dialogue management. While this improves comprehension capabilities, it suffers from several significant drawbacks: Without explicit instructions, it is prone to deviating from pre-defined business processes or "creating" inaccurate responses. Processing each round of dialogue requires handling lengthy contexts, including the complete dialogue history, leading to high memory consumption, computational redundancy, and slow inference speed, failing to meet the needs of many low-latency scenarios. In multi-turn interactions, the performance of a single language model remains unstable without specific mechanisms to guide issues such as disambiguation, information omission completion, and intent clarification. Existing systems, when faced with ambiguous inputs with extremely low confidence, typically resort to uniform, rigid fallback phrases, which interrupts the effectiveness of the dialogue and fails to further uncover the user's potential underlying intent. Summary of the Invention
[0003] This application provides a session control method and apparatus to at least solve the technical problem of low accuracy in generating response information in related technologies.
[0004] According to one aspect of the embodiments of this application, a session control method is provided, comprising: receiving user request information and analyzing the user request information using a natural language understanding model to obtain multiple user intents; selecting the user intent with the highest confidence level from the multiple user intents as a target user intent; determining the type of user intent corresponding to the user request information based on the confidence level of the target user intent; selecting a target session decision from multiple session decisions for generating reply messages based on the type of user intent; and generating reply information for replying to the user request information based on the target session decision.
[0005] Optionally, determining the user intent type based on the confidence level of the target user intent includes: determining the user intent type as a first type when the confidence level of the target user intent is greater than a first threshold; determining the user intent type as a second type when the confidence level of the target user intent is between the first threshold and a second threshold; determining the multiple user intents with the highest confidence levels among the multiple user intents as candidate intents when the confidence level of the target user intent is less than the second threshold; and determining the user intent type based on the candidate intents, wherein the user intent types include: the first type, the second type, the third type, and the fourth type, with the clarity of the user intents of the first type, the second type, the third type, and the fourth type decreasing sequentially, and the first threshold being greater than the second threshold.
[0006] Optionally, determining the type of the user intent based on the candidate intent includes: obtaining the topic cluster to which each candidate intent belongs; selecting the topic cluster with the highest proportion of the candidate intent from multiple topic clusters; determining that the candidate intent has topic clustering if the proportion of the highest proportion is greater than a preset proportion threshold; if the candidate intent has topic clustering, determining that the type of the user intent is the third type, otherwise the type of the user intent is the fourth type.
[0007] Optionally, selecting a target session decision from multiple session decisions based on the type of the user intent includes: if the type of the user intent is the first type, determining the target session decision as a first type decision, the first type decision being used to instruct the generation of the response information using a first type instruction template; if the type of the user intent is the second type, determining the target session decision as a second type decision, the second type decision being used to instruct the generation of the response information using a second type instruction template; if the type of the user intent is the third type, determining the target session decision as a third type decision, the third type decision being used to instruct the generation of the response information using a third type instruction template; and if the type of the user intent is... In the case of the fourth type, the target session decision is determined to be a fourth type decision. The fourth type decision is used to instruct the generation of the response information using a fourth type instruction template. The first type instruction template is used to directly execute the task corresponding to the user request information. The second type instruction template is used to generate first response information based on the candidate intent. The first response information is used to prompt the user to provide supplementary explanations for the corresponding user intent. The third type instruction template is used to generate second response information based on the topic clustering of the candidate intent. The second response information is used to prompt the user to provide supplementary explanations for the corresponding user intent. The fourth type instruction template is used to generate third response information. The third response information is used to prompt the user to restate the user intent.
[0008] Optionally, generating the first response information based on the candidate intent includes: generating a response message corresponding to each candidate intent to obtain multiple response messages, wherein the response messages are used to prompt the user to clarify the candidate intent; receiving a user selection instruction, wherein the user selection instruction is used to select a target response message from the multiple response messages; and determining the target response message as the first response message.
[0009] Optionally, the method further includes: obtaining the target session decision; executing the target session decision using a task execution module with a deployed language model, wherein the natural language understanding model is a lightweight intent classification model used to analyze all received user request information to obtain the multiple user intents, and the language model is a large language model used to execute the target session decision when an execution instruction is detected.
[0010] Optionally, the target session decision is executed using a task execution module with a deployed language model, including: when the response information is generated using a first type of instruction template, extracting the first type of instruction template from a preset instruction library; generating an answer to the user request information based on the first type of instruction template using the task execution module with a deployed language model, and generating the response information based on the answer; when the response information is generated using a second type of instruction template, extracting the second type of instruction template from a preset instruction library; generating the first response information based on the first type of instruction template and the candidate intent using the task execution module with a deployed language model; when the response information is generated using a third type of instruction template, extracting the third type of instruction template from a preset instruction library; generating the second response information based on the third type of instruction template and the topic clustering to which the candidate intent belongs using the task execution module with a deployed language model; and when the response information is generated using a fourth type of instruction template, extracting the fourth type of instruction template from a preset instruction library, wherein the fourth type of instruction template includes: multiple preset response information; and randomly selecting one preset response information from the multiple preset response information to determine as the third response information.
[0011] Optionally, if the target session decision is a first type of decision, the method includes: generating a target instruction before generating the response information, wherein the target instruction is used to execute an authentication process for verifying the user's identity or to call an API to obtain the answer.
[0012] According to another aspect of the embodiments of this application, a session control device is also provided, comprising: a receiving module, configured to receive user request information and analyze the user request information using a natural language understanding model to obtain multiple user intents; a selection module, configured to select the user intent with the highest confidence level from the multiple user intents as a target user intent; and a generation module, configured to determine the type of user intent corresponding to the user request information based on the confidence level of the target user intent, select a target session decision from multiple session decisions for generating reply messages based on the type of user intent, and generate reply information for replying to the user request information based on the target session decision.
[0013] According to another aspect of the embodiments of this application, a computer device is also provided, including: a memory and a processor, wherein the memory is used to store program instructions; and the processor, connected to the memory, is used to execute the above-described session control method.
[0014] According to another aspect of the embodiments of this application, a computer program product is also provided, including computer instructions that, when executed by a processor, implement the above-described session control method.
[0015] In this embodiment, user request information is received and analyzed using a natural language understanding model to obtain multiple user intents. The user intent with the highest confidence level is selected as the target user intent. The type of user intent corresponding to the user request information is determined based on the confidence level of the target user intent. A target session decision is selected from multiple session decisions used to generate response messages based on the type of user intent. Response information for replying to the user request information is generated based on the target session decision. By initially identifying user intents through a natural language understanding model and then selecting different session decisions to generate response information based on the confidence level of the user intent, the purpose of selecting appropriate session strategies based on user intents with different confidence levels is achieved. This improves the accuracy of generating response messages and solves the technical problem of low accuracy in generating response information in related technologies. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1 This is a hardware structure block diagram of a computer terminal for implementing a session control method according to an embodiment of this application;
[0018] Figure 2 This is a flowchart of a session control method according to an embodiment of this application;
[0019] Figure 3 This is a schematic diagram of the structure of a conversation control system according to an embodiment of this application;
[0020] Figure 4 This is a flowchart of another session control method according to an embodiment of this application;
[0021] Figure 5 This is a structural diagram of a session control device according to an embodiment of this application. Detailed Implementation
[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0023] 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 apparatus 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 apparatus.
[0024] The information collected in this application embodiment is information and data authorized by the user or fully authorized by all parties. The collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant regions, and necessary confidentiality measures have been taken. It does not violate public order and good morals, and provides corresponding operation entry points for users to choose to authorize or reject the automated decision results. If the user chooses to reject, the process will proceed to the expert decision-making process.
[0025] To address the problems existing in related technologies, embodiments of this application provide a session control method, which can operate in... Figure 1 The computer terminal shown is explained below.
[0026] The session control method embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware block diagram of a computer terminal for implementing a session control method is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors (shown as 102a, 102b, ..., 102n in the figure) (the processor may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions connected via wired and / or wireless networks. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1The different configurations shown.
[0027] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be implemented wholly or partially as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be wholly or partially integrated into any other element in the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as processor control (e.g., selection of a variable resistor termination path connected to an interface).
[0028] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the session control method in this embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned session control method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0029] The transmission module 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission module 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission module 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0030] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.
[0031] It should be noted here that, in some optional embodiments, the above... Figure 1 The computer terminal shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 1This is only one instance of a specific particular instance, and is intended to illustrate the types of components that may exist in the aforementioned computer terminal.
[0032] In the above operating environment, this application provides an embodiment of a session control method. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than that shown here.
[0033] Figure 2 This is a flowchart of a session control method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:
[0034] Step S202: Receive user request information and analyze the user request information using a natural language understanding model to obtain multiple user intentions;
[0035] Step S204: Select the user intent with the highest confidence level from the plurality of user intents as the target user intent;
[0036] Step S206: Determine the type of user intent corresponding to the user request information based on the confidence level of the target user intent, select a target session decision from multiple session decisions for generating reply messages based on the type of user intent, and generate reply information for replying to the user request information based on the target session decision.
[0037] Through steps S202 to S206 above, user request information is received and analyzed using a natural language understanding model to obtain multiple user intents. The user intent with the highest confidence level is selected as the target user intent. The type of user intent corresponding to the user request information is determined based on the confidence level of the target user intent. A target session decision is selected from multiple session decisions used to generate response messages based on the type of user intent. Response information for replying to the user request information is generated based on the target session decision. By initially identifying user intents through a natural language understanding model and then selecting different session decisions to generate response information based on the confidence level of the user intent, the aim of selecting appropriate session strategies based on user intents with different confidence levels is achieved. This improves the accuracy of generated response messages and solves the technical problem of low accuracy in generating response information in related technologies. The following is a detailed explanation.
[0038] To accurately implement the session control method proposed in the embodiments of this application, a session control system is also proposed in the embodiments of this application, such as... Figure 3As shown, it includes: a semantic routing module: deploying an NLU (Natural Language Understanding) model with a BERT (Bidirectional Encoder Representations from Transformers) or similar architecture. This module classifies the input user request information by intent and outputs a confidence score. A task execution module: deploying an LLM (Large Language Model) to receive task instructions and generate natural language responses. It should be noted that the task instructions are determined based on the target session decision.
[0039] Dynamic Decision and Prompt Construction Module: The core of the system's control. It determines the target session decision based on the output of the semantic routing module and selects or constructs the corresponding prompt from the SOP (Standard Operating Procedure) instruction library.
[0040] SOP instruction library: used to store "Type 1 Prompt", "Type 2 Prompt", "Type 3 Prompt" and "Type 4 Prompt" templates for each intent.
[0041] Intent Clustering Knowledge Base: A predefined knowledge base. It groups atomic intents that share a common "topic" or "attribute". For example:
[0042] Theme clustering [Efficiency / Speed] includes intents such as [Broadband Speed Test], [Fault Handling and Order Reminder], and [Phone Bill Recharge Inquiry]. Theme clustering [Fee / Bill] includes intents such as [Phone Bill Inquiry], [Bill Inquiry], and [Package Price Inquiry].
[0043] In some embodiments of this application, the specific steps for determining the user intent type based on the confidence level of the target user intent are as follows: if the confidence level of the target user intent is greater than a first threshold, the user intent type is determined to be a first type; if the confidence level of the target user intent is between the first threshold and a second threshold, the user intent type is determined to be a second type; if the confidence level of the target user intent is less than the second threshold, the user intents with the highest confidence levels among the plurality of user intents are determined as candidate intents; the user intent type is determined based on the candidate intents, wherein the user intent types include: the first type, the second type, the third type, and the fourth type, the clarity of the user intents of the first type, the second type, the third type, and the fourth type decreases sequentially, and the first threshold is greater than the second threshold.
[0044] It should be noted that both the first and second thresholds can be set according to the actual application scenario. For example, the first threshold can be 0.95 and the second threshold can be 0.60.
[0045] The specific steps for determining the type of user intent based on the candidate intent are as follows: obtaining the topic cluster to which each candidate intent belongs; selecting the topic cluster with the highest proportion of the candidate intent from multiple topic clusters; determining that the candidate intent has topic clustering if the proportion of the highest proportion is greater than a preset proportion threshold; if the candidate intent has topic clustering, determining that the type of the user intent is the third type, otherwise the type of the user intent is the fourth type.
[0046] For example: Based on a second threshold (e.g., 0.60), select the N highest-scoring candidate intents with confidence levels below this threshold. Compare these N selected intents with topic clusters in the intent clustering knowledge base. Each topic cluster represents a group of atomic intents with a common "topic" or "attribute." For example, the topic "efficiency / speed" might include specific intents such as "broadband speed test," "fault handling reminder," and "phone bill recharge arrival inquiry." For each topic cluster, if the proportion of N candidate intents belonging to a certain topic cluster exceeds a set threshold (e.g., the proportion of all members in the cluster to the N candidate intents is greater than a preset proportion threshold), then the user intents can be considered to have significant clustering, and that topic cluster is most relevant to the user intents.
[0047] For example, when a user requests "How do I get that thing working? Hurry up.", the semantic routing module outputs candidate intents with low confidence levels.
[0048] Broadband speed test confidence level: 0.52;
[0049] Fault handling and order expediting: Confidence level 0.50;
[0050] Phone bill recharge arrival status inquiry: Confidence level: 0.48.
[0051] The confidence scores of these three intentions are all below 0.60, but they all fall under the topic cluster [efficiency / speed]. Therefore, the system considers the user intentions to have significant clustering and be highly correlated with the topic of "efficiency / speed".
[0052] Understandably, for medium confidence levels (confidence levels between the first and second thresholds): the system determines that the candidate range given by the natural language model is credible. At this time, a "selective probing" strategy is adopted, allowing the user to choose from several high-probability intents, thereby achieving efficient confirmation.
[0053] For low confidence levels (confidence level less than the second threshold): the system determines that no specific candidate intent can be trusted, and switches to an "exploratory probing" strategy. This strategy uses intent clustering to find common "themes" (such as "efficiency / speed") behind multiple candidate intents, and generates more open-ended exploratory questions based on this macro-theme. This refined mechanism, which dynamically adjusts the clarification strategy according to the degree of uncertainty, is not available in existing technologies. It makes the system in this embodiment more "understanding" in interactions, can handle various complex and ambiguous scenarios more elegantly, and significantly improves the success rate of dialogue and user satisfaction.
[0054] In some embodiments of this application, selecting a target session decision from multiple session decisions based on the type of the user intent includes: when the type of the user intent is a first type, determining the target session decision as a first type decision, wherein the first type decision is used to instruct the generation of the response information using a first type instruction template; when the type of the user intent is a second type, determining the target session decision as a second type decision, wherein the second type decision is used to instruct the generation of the response information using a second type instruction template; when the type of the user intent is a third type, determining the target session decision as a third type decision, wherein the third type decision is used to instruct the generation of the response information using a third type instruction template; when the type of the user intent is a fourth type, determining the target session decision as a fourth type decision, wherein the fourth type decision is used to instruct the generation of the response information using a fourth type instruction template, wherein the first type instruction template is used to directly execute the task corresponding to the user request information, and the second type instruction template is used to generate based on the candidate intent. The first response information is used to prompt the user to supplement the corresponding user intent. The third type of instruction template is used to generate a second response information based on the topic clustering of the candidate intent. The second response information is used to prompt the user to supplement the corresponding user intent. The fourth type of instruction template is used to generate a third response information, which is used to prompt the user to restate the user intent. The specific steps for generating the first response information based on the candidate intent are as follows: generating response messages corresponding to each candidate intent to obtain multiple response messages, wherein the response messages are used to prompt the user to clarify the candidate intent; receiving a user selection instruction, which is used to select a target response message from the multiple response messages; determining the target response message as the first response message, wherein the natural language understanding model is a lightweight intent classification model, used to analyze all received user request information to obtain the multiple user intents, and the language model is a large language model, used to execute the target session decision when an execution instruction is detected.
[0055] like Figure 4 As shown, the process includes: Step 1, Receiving User Request Information: Receiving natural language text input by the user in the dialogue interface; Step 2, Semantic Routing and Confidence Analysis: The user input is sent to the semantic routing module. This module utilizes its ability to fine-tune the input using domain data (such as telecom customer service Q&A pairs) to process the input and output a result list containing intent labels and their corresponding confidence scores, sorted from high to low confidence. For example: Confidence for subscribing to a mobile phone package: 0.85; Confidence for subscribing to a broadband package: 0.72. Step 3, Dynamic Path Decision (Determining the Target Session Decision): The dynamic decision and prompt word construction module obtains the output of Step 2 and, based on preset confidence thresholds (e.g., first threshold C_high = 0.95, second threshold C_low = 0.60), selects one of the following four paths (session decision):
[0056] Path A: High Confidence Path (First Type of Decision: Direct Execution): If the highest confidence score is greater than C_high (e.g., 0.98 > 0.95), then the user's intent is considered clear.
[0057] Path B: Medium Confidence Path (Second Type of Decision: Proactive Probing): If the highest confidence score is between C_low and C_high (e.g., 0.85), it is determined that the user's intent may be unclear and requires further clarification.
[0058] Path C: Low confidence path (Third type of decision: exploratory inquiry): If the highest confidence score is lower than C_low (e.g., 0.55 < 0.60), but the Top N candidate intents output by the semantic routing module show obvious topic clustering in the intent clustering knowledge base, then proceed to step S204c.
[0059] Path D: Unknown Intent Path (Fourth Type of Decision: Last-Choice Reporting): If none of the above conditions are met (i.e., extremely low confidence and no obvious clustering characteristics), it is determined to be an unknown intent.
[0060] After determining the target session decision, the steps for generating response information based on the target session decision are as follows: obtain the target session decision; execute the target session decision using a task execution module with a deployed language model.
[0061] In some embodiments of this application, the specific steps of using a task execution module with a deployed language model to perform the target session decision are as follows: When the response information is generated using a first type of instruction template, the first type of instruction template is extracted from a preset instruction library; the task execution module with a deployed language model generates an answer to the user request information based on the first type of instruction template, and generates the response information based on the answer; when the response information is generated using a second type of instruction template, the second type of instruction template is extracted from a preset instruction library; the task execution module with a deployed language model generates the first response information based on the first type of instruction template and the candidate intent; when the response information is generated using a third type of instruction template, the third type of instruction template is extracted from a preset instruction library; the task execution module with a deployed language model generates the second response information based on the third type of instruction template and the topic clustering to which the candidate intent belongs; when the response information is generated using a fourth type of instruction template, the fourth type of instruction template is extracted from a preset instruction library, wherein the fourth type of instruction template includes: multiple preset response information; one preset response information is randomly selected from the multiple preset response information to be determined as the third response information.
[0062] It should be noted that the first, second, and third replies are all replies, but they are of different types.
[0063] Specifically, in the case of path A, a "Type 1 Prompt" template that perfectly corresponds to the determined intent (such as [check call charges]) is extracted from the SOP instruction library. This template contains the standard operating procedure for performing this service.
[0064] In the case of path B, construct a "second type of Prompt". This Prompt will include the Top N (e.g., N=2) high-probability intents from step 2 as parameters, and explicitly state that the instruction language model needs to generate a clarifying question around these options to guide the user in making a choice.
[0065] In the case of path C, a "third type of Prompt" is constructed. This Prompt will include the identified "topic clusters" (such as the [efficiency / speed] question) as the core context, and instruct the language model to generate a more open and exploratory clarification question around this topic cluster, combined with the user's original utterance (such as "hurry up").
[0066] In the case of path D, construct a "fourth type of Prompt" for situations that ultimately cannot be handled.
[0067] The constructed prompt is sent to the task execution module, which executes the task according to the received instructions, generating a natural language response text highly matched to the current scenario (direct processing, clarification and follow-up questioning, or polite reassurance), and outputting the response information. Before generating the response information, a target instruction is generated, wherein the target instruction is used to execute an authentication process for verifying the user's identity or to call an API to obtain the answer.
[0068] As can be seen from the above processing flow, the session control method proposed in this application adopts a "dynamic routing gateway" architecture. Upon understanding the user's intent, the system makes a decisive, divergent strategic judgment based on the confidence level output by the semantic routing module, intelligently guiding the dialogue to three completely different processing paths: "direct execution," "selective follow-up questioning," or "exploratory follow-up questioning." This architecture, which directly uses the results of "intent understanding" for "process scheduling" rather than merely "content optimization," fundamentally improves the system's robustness in handling complex and ambiguous scenarios.
[0069] The session control method in this application constructs a cost-effective "fast-slow combination" computational paradigm. The fast system (semantic routing module) deploys a lightweight BERT model, which processes 100% of user input with extremely low computational cost and extremely fast response speed, and completes the vast majority of high-frequency, explicit intent routing tasks. The slow system (task execution module) deploys a resource-intensive language model, but it is only activated when necessary, after receiving precise instructions preprocessed and scheduled by the "fast system." This architecture avoids having an expensive language model handle every simple request, using valuable computational resources where they are most needed, significantly reducing the system's average operating cost and interaction latency, laying a solid foundation for the large-scale commercial application of this technical solution.
[0070] To better understand the session control method proposed in the embodiments of this application, specific examples will be provided below.
[0071] Scenario: A user initiates a conversation with an AI customer service representative.
[0072] For high-confidence scenarios:
[0073] Step 1: The user enters: "Please check my phone bill for this month."
[0074] Step 2, Semantic Routing: After analysis, the semantic routing module outputs {'intent': 'query call charges', 'confidence': 0, 99}.
[0075] Step 3, Dynamic Decision-Making: The dynamic decision-making module determines that the confidence level is 0.99 > 0.95 (C_high) and selects path A.
[0076] Step 4, Prompt Construction: The module extracts the "Execution Class (Type 1) Prompt" for "Query Call Charges" from the SOP instruction library.
[0077] Step 5, Task Execution: The task execution module receives the instruction and generates a reply: "Okay, checking your local phone bill, please wait [Authentication or API call process can be added here]".
[0078] For scenarios with medium confidence (requiring follow-up questions):
[0079] Step 1: The user enters: "I want to subscribe to a package."
[0080] Step 2, Semantic Routing: The semantic routing module analyzes and outputs [{'intent': 'Subscribe to a mobile phone package', 'confidence': 0.85}, {'intent': 'Subscribe to a broadband package', 'confidence': 0.72}].
[0081] Step 3, Dynamic Decision-Making: The dynamic decision-making module determines that the highest confidence level of 0.85 is between 0.60 and 0.95, and selects path B.
[0082] Step 4, Prompt Construction: The module constructs a "follow-up question (second type) Prompt" containing two options: "Apply for a mobile phone package" and "Apply for a broadband package".
[0083] Step 5, Task Execution: The task execution module receives the follow-up question and generates a reply: "Hello, do you want to subscribe to a mobile data or voice plan, or do you want to upgrade or renew your home broadband plan?"
[0084] For low-confidence scenarios (requiring exploratory follow-up questions):
[0085] Step 1, the user inputs: "How do you guys do that thing? Hurry up."
[0086] Step 2, Semantic Routing: The semantic routing module (101) outputs a series of candidate intents with low confidence: [{'intent': 'request to complete work order', 'confidence': 0, 55}, {'intent': 'broadband speed test', 'confidence': 0, 52}, {'intent': 'phone bill recharge arrival query', 'confidence': 0, 48}].
[0087] Step 3, Dynamic Decision-Making: The dynamic decision-making module (103) determines that the highest confidence level is 0.55 < 0.60, but its further analysis reveals that the first three candidate intentions are all highly correlated with the preset topic clustering [efficiency / speed]. Therefore, the system selects path C.
[0088] Step 4, Prompt Construction: The module constructs an "Exploratory Prompt (Type 3)" with the following content: "The user's intention is related to 'efficiency or speed,' and the user has expressed an urgent desire to 'hurry up.' Please generate reassuring and exploratory questions based on this theme."
[0089] Step 5, Task Execution: The task execution module receives the instruction and generates a reply: "You seem to be in a hurry. May I ask what is slow or inconvenient for you? For example, is it the slow internet speed at home, or do you want to expedite the processing of your previous repair order?"
[0090] For fallback (fourth type) Prompt scenarios:
[0091] In extremely ambiguous or unidentifiable situations (such as when a user says "this won't work, that won't work"), the system will use a fallback Prompt to maintain the conversation, such as: "It seems you are somewhat dissatisfied with our service. Could you tell me specifically what the problem is? Or, what business goals do you hope to achieve? We will do our best to help you resolve them."
[0092] Figure 5 A session control device is shown, the device comprising:
[0093] The receiving module 50 is used to receive user request information and analyze the user request information using a natural language understanding model to obtain multiple user intentions;
[0094] Selection module 52 is used to select the user intent with the highest confidence level from the plurality of user intents as the target user intent;
[0095] The generation module 54 is used to determine the type of user intent corresponding to the user request information based on the confidence level of the target user intent, select a target session decision from multiple session decisions for generating reply messages based on the type of user intent, and generate reply information for replying to the user request information based on the target session decision.
[0096] The aforementioned session control device receives user request information and analyzes it using a natural language understanding model to obtain multiple user intents. It then selects the user intent with the highest confidence level as the target user intent. Based on the confidence level of the target user intent, it determines the type of user intent corresponding to the user request information. Based on the type of user intent, it selects a target session decision from multiple session decisions used to generate response messages and generates response information to answer the user request information based on the target session decision. By initially identifying user intents through a natural language understanding model and then selecting different session decisions to generate response information based on the confidence level of the user intent, it achieves the goal of selecting appropriate session strategies based on user intents with different confidence levels. This improves the accuracy of generated response messages and solves the technical problem of low accuracy in generating response information in related technologies.
[0097] The generation module 54 includes an intent submodule, used to determine the user intent type based on the confidence level of the target user intent, including: determining the user intent type as a first type when the confidence level of the target user intent is greater than a first threshold; determining the user intent type as a second type when the confidence level of the target user intent is between the first threshold and a second threshold; determining the multiple user intents with the highest confidence level among the multiple user intents as candidate intents when the confidence level of the target user intent is less than the second threshold; determining the user intent type based on the candidate intents, wherein the user intent types include: the first type, the second type, the third type, and the fourth type, the clarity of the user intents of the first type, the second type, the third type, and the fourth type decreases sequentially, and the first threshold is greater than the second threshold.
[0098] The intent submodule includes an intent unit and a selection unit. The intent unit is used to determine the type of the user intent based on the candidate intents, including: obtaining the topic cluster to which each candidate intent belongs; selecting the topic cluster with the highest proportion of the candidate intent from multiple topic clusters; determining that the candidate intent has topic clustering if the proportion of the highest proportion is greater than a preset proportion threshold; if the candidate intent has topic clustering, determining that the type of the user intent is the third type, otherwise the type of the user intent is the fourth type.
[0099] The selection unit is configured to select a target session decision from multiple session decisions based on the type of the user intent, including: when the type of the user intent is a first type, determining the target session decision as a first type decision, wherein the first type decision is used to instruct the generation of the response information using a first type instruction template; when the type of the user intent is a second type, determining the target session decision as a second type decision, wherein the second type decision is used to instruct the generation of the response information using a second type instruction template; when the type of the user intent is a third type, determining the target session decision as a third type decision, wherein the third type decision is used to instruct the generation of the response information using a third type instruction template; and when the type of the user intent is a third type, determining the target session decision as a third type decision, wherein the third type decision is used to instruct the generation of the response information using a third type instruction template; and when the type of the user intent is a third type decision, determining the target session decision as a third type decision, wherein the first ... In the case of the fourth type, the target session decision is determined to be a fourth type decision. The fourth type decision is used to instruct the generation of the response information using a fourth type instruction template. The first type instruction template is used to directly execute the task corresponding to the user request information. The second type instruction template is used to generate a first response information based on the candidate intent. The first response information is used to prompt the user to provide supplementary explanations for the corresponding user intent. The third type instruction template is used to generate a second response information based on the topic clustering of the candidate intent. The second response information is used to prompt the user to provide supplementary explanations for the corresponding user intent. The fourth type instruction template is used to generate a third response information. The third response information is used to prompt the user to restate the user intent.
[0100] The selection unit further includes: an execution subunit, used to obtain the target session decision; and to execute the target session decision using a task execution module with a deployed language model.
[0101] The selection unit further includes a generation subunit and an access subunit. The generation subunit is used to execute the target session decision using a task execution module with a deployed language model. This includes: when generating the response information using a first type of instruction template, extracting the first type of instruction template from a preset instruction library; generating an answer to the user request information based on the first type of instruction template using the task execution module with a deployed language model, and generating the response information based on the answer; when generating the response information using a second type of instruction template, extracting the second type of instruction template from a preset instruction library; generating the first response information based on the first type of instruction template and the candidate intent using the task execution module with a deployed language model; when generating the response information using a third type of instruction template, extracting the third type of instruction template from a preset instruction library; generating the second response information based on the third type of instruction template and the topic clustering of the candidate intent using the task execution module with a deployed language model; and when generating the response information using a fourth type of instruction template, extracting the fourth type of instruction template from a preset instruction library, wherein the fourth type of instruction template includes: multiple preset response information; and randomly selecting one preset response information from the multiple preset response information to determine as the third response information.
[0102] The access subunit is configured to generate a target instruction before the target session decision is a first type of decision and before generating the response information, wherein the target instruction is configured to execute an authentication process for verifying the user's identity or to call an API to obtain the answer.
[0103] It should be noted that, Figure 5 The session control device shown is used to perform Figure 2 The session control method shown above is also applicable to this session control device, and will not be repeated here.
[0104] This application also provides a computer device, including: a memory and a processor, wherein the memory is used to store program instructions; and the processor, connected to the memory, is used to execute the above-described session control method.
[0105] This application also provides a computer program product, including computer instructions that, when executed by a processor, implement the steps of the session control method in this application.
[0106] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0107] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0108] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0109] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0110] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0111] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0112] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A session control method, characterized by, The method comprises the following steps: receiving user request information and analyzing the user request information by using a natural language understanding model to obtain a plurality of user intents; selecting a user intent with the highest confidence from the plurality of user intents as a target user intent; determining the type of the user intent corresponding to the user request information according to the confidence of the target user intent, selecting a target session decision from a plurality of session decisions for generating a reply message according to the type of the user intent, and generating reply information for replying to the user request information according to the target session decision.
2. The method of claim 1, wherein, Determining the type of the user intent according to the confidence of the target user intent comprises: in the case that the confidence of the target user intent is greater than a first threshold, determining that the type of the user intent is a first type; in the case that the confidence of the target user intent is between the first threshold and a second threshold, determining that the type of the user intent is a second type; in the case that the confidence of the target user intent is less than the second threshold, determining a plurality of user intents with the highest confidence from the plurality of user intents as candidate intents; determining the type of the user intent according to the candidate intents, wherein the type of the user intent comprises the first type, the second type, a third type and a fourth type, the clarity of the user intent of the first type, the second type, the third type and the fourth type decreases in turn, and the first threshold is greater than the second threshold.
3. The method of claim 2, wherein, Determining the type of the user intent according to the candidate intents comprises: respectively obtaining a subject cluster to which each of the candidate intents belongs; selecting a subject cluster with the highest proportion of the candidate intents from a plurality of subject clusters; in the case that the highest proportion is greater than a preset proportion threshold, determining that the candidate intents have subject aggregation; if the candidate intents have subject aggregation, determining that the type of the user intent is the third type, otherwise the type of the user intent is the fourth type.
4. The method of claim 2, wherein, Selecting a target session decision from a plurality of session decisions according to the type of the user intent comprises: in the case that the type of the user intent is the first type, determining that the target session decision is a first type decision, and the first type decision is used to instruct to generate the reply information by using a first type instruction template; in the case that the type of the user intent is the second type, determining that the target session decision is a second type decision, and the second type decision is used to instruct to generate the reply information by using a second type instruction template; in the case that the type of the user intent is the third type, determining that the target session decision is a third type decision, and the third type decision is used to instruct to generate the reply information by using a third type instruction template; In a case where the type of the user intention is the fourth type, the target conversation decision is determined as a fourth type decision, and the fourth type decision is used to indicate that a fourth type instruction template is used to generate the reply information, wherein the first type instruction template is used to directly execute a task corresponding to the user request information, the second type instruction template is used to generate first reply information according to the candidate intention, the first reply information is used to prompt a user to supplement the corresponding user intention, the third type instruction template is used to generate second reply information according to a subject cluster to which the candidate intention belongs, the second reply information is used to prompt the user to supplement the corresponding user intention, and the fourth type instruction template is used to generate third reply information, and the third reply information is used to prompt the user to restate the user intention.
5. The method of claim 4, wherein, According to the candidate intention, the first reply information is generated, including: A reply message corresponding to each candidate intention is generated respectively to obtain a plurality of reply messages, wherein the reply message is used to prompt the user to clarify the candidate intention; A user selection instruction is received, and the user selection instruction is used to select a target reply message from the plurality of reply messages; The target reply message is determined as the first reply message.
6. The method of claim 4, wherein, The method further includes: Obtaining the target conversation decision; Using a task execution module deployed with a language model to execute the target conversation decision, wherein the natural language understanding model is a lightweight intention classification model, used to analyze all received user request information to obtain the plurality of user intentions, and the language model is a large language model, used to execute the target conversation decision in a case where an execution instruction is detected.
7. The method of claim 4, wherein, Using the task execution module deployed with the language model to execute the target conversation decision, including: In a case where the first type instruction template is used to generate the reply information, the first type instruction template is extracted from a preset instruction library; Using the task execution module deployed with the language model to generate an answer of the user request information according to the first type instruction template, and to generate the reply information according to the answer; In a case where the second type instruction template is used to generate the reply information, the second type instruction template is extracted from the preset instruction library; Using the task execution module deployed with the language model to generate the first reply information according to the first type instruction template and the candidate intention; In a case where the third type instruction template is used to generate the reply information, the third type instruction template is extracted from the preset instruction library; Using the task execution module deployed with the language model to generate the second reply information according to the third type instruction template and the subject cluster to which the candidate intention belongs; In a case where the fourth type instruction template is used to generate the reply information, the fourth type instruction template is extracted from the preset instruction library, wherein the fourth type instruction template includes a plurality of preset reply information; A preset reply information is randomly selected from the plurality of preset reply information to determine as the third reply information.
8. The method of claim 7, wherein, In a case where the target conversation decision is the first type decision, including: Before the reply information is generated, a target instruction is generated, where the target instruction is used to execute an identity verification process for verifying a user identity or call an API to obtain the answer.
9. A session control device, characterized by Comprising: A receiving module is configured to receive user request information and analyze the user request information by using a natural language understanding model to obtain a plurality of user intents; A selecting module is configured to select a user intent with the highest confidence from the plurality of user intents as a target user intent; A generating module is configured to determine a type of a user intent corresponding to the user request information according to the confidence of the target user intent, select a target session decision for generating a reply message from a plurality of session decisions for generating a reply message according to the type of the user intent, and generate reply information for replying to the user request information according to the target session decision.
10. A computer device, comprising: Comprising: A memory and a processor, where the memory is configured to store program instructions; The processor, connected with the memory, is configured to execute the session control method in any one of claims 1 to 8.
11. A computer program product comprising computer instructions, characterized in that, The computer instructions are executed by the processor to implement the session control method in any one of claims 1 to 8.