Dialogue robot interaction method and device and electronic equipment

By combining user context information and intent recognition results to construct prompt content, and using model cluster processing, the problem of lack of coherence and personalized adaptability in responses in traditional dialogue systems is solved, achieving logical consistency and personalized responses in dialogue.

CN121808016APending Publication Date: 2026-04-07JUYU (SHANGHAI) INFORMATION SERVICE 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-12-30
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Traditional dialogue systems lack coherence and personalization when generating responses, and cannot effectively integrate users' historical interaction records, long-term preferences, or dialogue states, resulting in mechanical, repetitive, or disconnected responses from user needs.

Method used

By combining the contextual information corresponding to the user identifier with the intent recognition results, prompt word content is constructed and processed using a model cluster, including dynamically matching prompt word templates, selecting a large language model with an appropriate parameter range, and a quality inspection mechanism, to ensure the consistency and personalization of the response.

Benefits of technology

It improves the coherence and personalization of dialogue, ensures logical consistency in responses, takes into account user characteristics and historical behavior, and optimizes the system's resource utilization and response efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121808016A_ABST
    Figure CN121808016A_ABST
Patent Text Reader

Abstract

The invention provides a dialogue robot interaction method and device and electronic equipment, and the method comprises the steps: obtaining a user request which comprises a user identifier and a natural language question; performing intention recognition on the natural language question through an intention recognition model to obtain an intention recognition result; obtaining context information corresponding to the user identifier, and combining the context information and the intention recognition result to obtain prompt word content; and processing the cue word content through the model cluster to obtain candidate answer content corresponding to the natural language question. In the implementation process of the scheme, the prompt word content is constructed by combining the context information corresponding to the user identifier and the intention recognition result, so that the model can ensure that the logic before and after the answer is consistent and the context association is close when the answer is generated, and the answer considers the characteristics and historical behaviors of the specific user, so that the user experience is improved. Therefore, the continuity and the personalized adaptability of the dialogue are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence (AI) and natural language processing (NLP), in particular to a dialogue robot interaction method and device and electronic equipment. BACKGROUND

[0002] At present, dialogue systems usually adopt an intent recognition method based on rules or traditional natural language processing (NLP) models, parse the natural language question input by the user through keyword matching or a shallow classification model (such as LSTM, CNN), and generate an answer in combination with a preset dialogue template. When processing user requests, such systems often only rely on local features of the current input for intent recognition, resulting in a lack of coherence and personalized adaptability in the generated answers. SUMMARY

[0003] The embodiments of the present application aim to provide a dialogue robot interaction method, device and electronic equipment for improving the problem of a lack of coherence and personalized adaptability in the answers generated by the dialogue robot.

[0004] The embodiments of the present application provide a dialogue robot interaction method, comprising: obtaining a user request, the user request comprising a user identifier and a natural language question; performing intent recognition on the natural language question through an intent recognition model to obtain an intent recognition result; obtaining context information corresponding to the user identifier, and combining the context information and the intent recognition result to obtain prompt word content; and processing the prompt word content through a model cluster to obtain candidate answer content corresponding to the natural language question. In the implementation process of the above scheme, the prompt word content is constructed by combining the context information corresponding to the user identifier and the intent recognition result, so that the model not only understands the semantic intent of the current question when generating an answer, but also fuses personalized context such as the history interaction, preferences or state of the user, thereby generating candidate answers that are more in line with the actual needs of the user and the dialogue history in the model cluster processing stage. This way of deeply fusing personalized context and intent can make the answers logically consistent and closely related in context, and the answers take into account the characteristics and historical behavior of a specific user, thereby effectively improving the coherence and personalized adaptability of the dialogue.

[0005] Optionally, in the embodiments of the present application, the context information and the intention recognition result are combined to obtain the prompt word content, including: matching a target prompt word template from a plurality of prompt word templates based on the intention recognition result; and filling the context information and the intention recognition result into the target prompt word template to obtain the prompt word content. In the implementation process of the above scheme, by dynamically matching the prompt word template based on the intention recognition result, the technical solution can realize the accurate adaptation of the prompt word content, because the intention recognition result directly reflects the real demand of the user, thereby ensuring that the generated prompt word is highly consistent with the user's intention in terms of semantics and structure, and avoiding the semantic deviation problem that may be caused by the general template. Further, by the mechanism of double filling the context information and the intention recognition result into the target template, the completeness and context relevance of the prompt word are significantly improved, because the context information provides the background and historical interaction data of the dialogue, and the intention recognition result focuses on the current demand, and the combination of the two makes the generated prompt word maintain coherence and accurately respond to the immediate demand.

[0006] Optionally, in the embodiments of the present application, the model cluster includes: a large language model in a production environment and a large language model in a test environment; and the prompt word content is processed through the model cluster, including: judging whether the service of the large language model in the production environment is abnormal, or whether the traffic of the large language model in the production environment processing the prompt word content is abnormal; and if so, the prompt word content is processed through the large language model in the test environment. In the implementation process of the above scheme, by deploying the large language model cluster in the production environment and the test environment, the high availability and fault tolerance of the service are realized. When the model in the production environment appears service abnormal or traffic abnormal, the system can automatically switch to the model in the test environment for processing, thereby avoiding service interruption and ensuring the continuity and reliability of the prompt word content processing. Further, by dynamically judging the abnormal condition of the model in the production environment and automatically switching to the model in the test environment, the technical solution realizes intelligent scheduling and load balancing of resources. This not only optimizes the overall performance of the model cluster, but also improves the resource utilization, and avoids processing delay or failure caused by overload of the model in the production environment.

[0007] Optionally, in the embodiments of the present application, the model cluster comprises a plurality of large language models with different parameter scales; processing the prompt word content through the model cluster comprises: determining the task complexity of the natural language question according to the prompt word content; and processing the prompt word content by selecting a large language model with a parameter scale corresponding to the task complexity from the model cluster. In the implementation process of the above scheme, by constructing a model cluster containing a plurality of large language models with different parameter scales, and dynamically selecting a matching model according to the task complexity of the prompt word content for processing, accurate allocation of computing resources can be achieved. This on-demand scheduling mechanism avoids the problem of resource waste or insufficient performance that may occur when a single model processes tasks of different complexities, thereby improving the resource utilization efficiency of the system as a whole. Further, by intelligently matching the task complexity with the model parameter scale, simple tasks can be quickly processed by lightweight models, while complex tasks can be deeply processed by larger-scale models. This hierarchical processing mechanism ensures both the response speed of simple tasks and the processing quality of complex tasks, optimizing the overall performance of the system.

[0008] Optionally, in the embodiments of the present application, after obtaining the candidate answer content corresponding to the natural language question, further comprising: quality inspection on the candidate answer content to obtain a quality inspection result. In the implementation process of the above scheme, by introducing the quality inspection link of the candidate answer content, the accuracy and reliability of the answer content can be effectively improved. The quality inspection process can identify and filter out answers that do not meet the quality standards, thereby ensuring that the final output answer content has higher credibility, which is particularly important in the field of natural language processing, because incorrect answers may lead to user misunderstanding or decision-making errors. Further, by quality inspecting the candidate answer content, the system can timely discover and correct potential errors or biases, thereby reducing repeated work or error propagation in subsequent processing, improving the efficiency and response speed of the system. This optimization is particularly important for large-scale or real-time application scenarios.

[0009] Optionally, in the embodiments of the present application, the candidate answer content is subjected to quality inspection, including: obtaining a request identifier corresponding to the candidate answer content; determining whether the request identifier is in a preset whitelist; if yes, determining that the candidate answer content passes the quality inspection, and skipping subsequent sequentially executed rule filter unit, quality inspection model unit and manual bottom unit; if not, subjecting the candidate answer content to quality inspection through the rule filter unit, the quality inspection model unit and the manual bottom unit. In the implementation process of the above scheme, by introducing the request identifier and the whitelist mechanism, the technical solution can quickly identify and skip the candidate answer content from known trusted sources, thereby significantly reducing unnecessary quality inspection process calculation resource consumption and improving the overall processing efficiency of the system. This trust source-based pre-screening mechanism optimizes the allocation of computing resources under the premise of ensuring quality. Further, by adopting a hierarchical quality inspection strategy (rule filter unit, quality inspection model unit and manual bottom unit) combined with the whitelist mechanism, the dynamic configurability of the quality inspection process is realized. The system can flexibly adjust the quality inspection depth according to requests of different trust levels, while ensuring the quality of the quality inspection and avoiding resource waste caused by "one-size-fits-all".

[0010] Optionally, in the embodiments of the present application, after the candidate answer content is subjected to quality inspection, further including: determining whether the candidate answer content passes the quality inspection; if yes, sending the candidate answer content to a terminal device corresponding to a user identifier; if not, obtaining a preset bottom answer content and sending the preset bottom answer content to the terminal device corresponding to the user identifier. In the implementation process of the above scheme, by introducing the quality inspection judgment mechanism and the double protection of the preset bottom answer content, it is ensured that effective answer content can be provided to the user in any case, thereby significantly improving the reliability and user experience of the system. Specifically, the quality inspection judgment mechanism can screen out answers that do not meet the requirements, and the preset bottom answer content serves as a backup solution to fill the gap when the quality inspection fails, avoiding user interaction interruption caused by missing or unqualified answer content. Further, by dynamically switching the candidate answer content and the preset bottom answer content, the technical solution realizes flexible processing of answer content of different qualities, optimizing the output strategy of the answer content. This dynamic switching not only improves the applicability of the answer content, but also maximizes the advantages of the candidate answer content while ensuring the quality of the answer, thereby improving the overall performance and response efficiency of the system.

[0011] Optionally, in this embodiment, the method further includes: storing user requests, context information, prompt word content, candidate answer content, and quality inspection results in the training dataset; constructing positive and negative sample pairs based on the training dataset; and training the large language model in the model cluster using positive and negative sample pairs. In the implementation of the above scheme, by storing user requests, context information, prompt word content, candidate answer content, and quality inspection results in the training dataset, a more comprehensive and diverse training dataset can be constructed, thereby improving the model's generalization ability and adaptability. This comprehensive data collection method enables the model to better understand and handle various complex user requests and contextual scenarios. Furthermore, by constructing positive and negative sample pairs based on the training dataset and training the large language model in the model cluster using positive and negative sample pairs, the model's discriminative ability and answer quality can be significantly improved. The construction of positive and negative sample pairs enables the model to distinguish between high-quality and low-quality answers through comparative learning, thereby optimizing the model's output performance and reducing the probability of incorrect answers.

[0012] Optionally, in this embodiment, constructing positive and negative sample pairs based on the training dataset includes: identifying data whose candidate answers fail quality control and sampling as negative samples; re-inputting the prompt words from the training dataset into the model cluster to obtain multiple candidate answer contents; calculating the scores of the multiple candidate answer contents and selecting candidate answer contents with scores higher than the negative samples; identifying the candidate answer contents with scores higher than the negative samples as positive samples, and constructing positive and negative sample pairs based on the positive and negative samples. In the implementation of the above scheme, by directly using data that fails quality control and sampling as negative samples, the quality and representativeness of negative samples can be ensured, avoiding the subjectivity and bias of manual annotation, and improving the efficiency and accuracy of sample construction. Furthermore, by re-inputting the prompt words into the model cluster to obtain multiple candidate answer contents, the diversity of the model can be fully utilized to generate more diverse candidate answers, thereby enriching the source of positive samples and improving the coverage and representativeness of the samples.

[0013] This application also provides a chatbot interaction device, including: a user request acquisition module for acquiring user requests, the user request including: a user identifier and a natural language question; a recognition result acquisition module for performing intent recognition on the natural language question through an intent recognition model to obtain an intent recognition result; an information result combination module for acquiring contextual information corresponding to the user identifier and combining the contextual information and the intent recognition result to obtain prompt word content; and an answer content acquisition module for processing the prompt word content through a model cluster to obtain candidate answer content corresponding to the natural language question.

[0014] Optionally, in this embodiment of the application, the information result combination module includes: a prompt word template matching module, used to match a target prompt word template from multiple prompt word templates based on the intent recognition result; and a prompt word template filling module, used to fill the context information and intent recognition result into the target prompt word template to obtain the prompt word content.

[0015] Optionally, in this embodiment, the model cluster includes: a large language model in a production environment and a large language model in a test environment; the answer content acquisition module includes: a service traffic judgment module, used to judge whether the service of the large language model in the production environment is abnormal, or whether the traffic of the large language model in the production environment processing the prompt content is abnormal; and a prompt content processing module, used to process the prompt content through the large language model in the test environment if the service of the large language model in the production environment is abnormal, or the traffic of the large language model in the production environment processing the prompt content is abnormal.

[0016] Optionally, in this embodiment, the model cluster includes: multiple large language models with different parameter levels; the answer content acquisition module includes: a task complexity determination submodule, used to determine the task complexity of the natural language question based on the prompt word content; and a prompt word content processing submodule, used to select the large language model with the parameter level corresponding to the task complexity from the model cluster and process the prompt word content.

[0017] Optionally, in this embodiment of the application, the chatbot interaction device further includes: a quality inspection result acquisition module, used to perform quality inspection on the candidate answer content and obtain the quality inspection result.

[0018] Optionally, in this embodiment, the quality inspection result acquisition module includes: a request identifier acquisition submodule, used to acquire the request identifier corresponding to the candidate answer content; a request identifier judgment submodule, used to determine whether the request identifier is in a preset whitelist; a quality inspection determination submodule, used to determine that the candidate answer content passes the quality inspection if the request identifier is in the preset whitelist, and skip the rule filter unit, quality inspection model unit, and manual fallback unit executed sequentially thereafter; and an answer content quality inspection submodule, used to perform quality inspection on the candidate answer content through the rule filter unit, quality inspection model unit, and manual fallback unit if the request identifier is not in the preset whitelist.

[0019] Optionally, in this embodiment of the application, the chatbot interaction device further includes: a content quality inspection judgment module, used to determine whether the candidate answer content passes the quality inspection; an answer content sending module, used to send the candidate answer content to the terminal device corresponding to the user identifier if the candidate answer content passes the quality inspection; and a fallback content sending module, used to obtain preset fallback answer content and send the preset fallback answer content to the terminal device corresponding to the user identifier if the candidate answer content fails the quality inspection.

[0020] Optionally, in this embodiment of the application, the chatbot interaction device further includes: a training data storage module, used to store user requests, context information, prompt word content, candidate answer content and quality inspection results in a training dataset; and a language model training module, used to construct positive and negative sample pairs based on the training dataset and train the large language model in the model cluster through the positive and negative sample pairs.

[0021] Optionally, in this embodiment, the language model training module includes: a negative sample determination submodule, used to determine data whose candidate answer content fails quality inspection and sampling as negative samples; a prompt word input submodule, used to re-input the prompt word content in the training dataset into the model cluster to obtain multiple candidate answer contents; a candidate answer filtering module, used to calculate the scores of multiple candidate answer contents and filter out candidate answer contents with scores greater than those of negative samples; and a positive sample determination submodule, used to determine candidate answer contents with scores greater than those of negative samples as positive samples and construct positive-negative sample pairs based on the positive and negative samples.

[0022] This application also provides an electronic device, including a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the machine-readable instructions are executed by the processor to perform the methods described above.

[0023] This application also provides a computer-readable storage medium storing a computer program, which is executed by a processor to perform the methods described above.

[0024] This application also provides a computer program product, including: a computer program or computer instructions, which are executed by a processor to perform the method described above. Attached Figure Description

[0025] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 The illustration shows a flowchart of the chatbot interaction method provided in an embodiment of this application; Figure 2 The illustrated flowchart shows the supervised fine-tuning (SFT) process provided in the embodiments of this application; Figure 3 The diagram shown is a structural schematic of the chatbot interaction device provided in an embodiment of this application; Figure 4 The diagram shows a structural schematic of an electronic device provided in an embodiment of this application. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in the embodiments of this application are for illustrative and descriptive purposes only and are not intended to limit the protection scope of the embodiments of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in the embodiments of this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of the embodiments of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0028] Furthermore, the described embodiments are merely a part of the embodiments of this application, and not all of them. The components of the embodiments of this application described and illustrated herein can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed embodiments of this application, but merely to illustrate selected embodiments of this application.

[0029] It is understood that the terms "first" and "second" in the embodiments of this application are used to distinguish similar objects. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different. In the description of the embodiments of this application, the term "and / or" is merely a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship. The term "multiple" refers to two or more (including two), and similarly, "multiple groups" refers to two or more groups (including two groups).

[0030] It should be noted that the chatbot interaction method provided in this application can be executed by an electronic device. Here, an electronic device refers to a device terminal or server with the function of executing computer programs. Device terminals include, for example, smartphones, personal computers, tablets, personal digital assistants, or mobile internet devices. A server refers to a device that provides computing services through a network. Servers include, for example, x86 servers and non-x86 servers. Non-x86 servers include, for example, mainframes, minicomputers, and UNIX servers.

[0031] Traditional dialogue systems typically rely on rule-based or early Natural Language Processing (NLP) models for intent recognition. These methods often use keyword matching, regular expressions, or shallow neural network models (such as LSTM and CNN) to parse user-input natural language questions. Their core logic is to map user statements to predefined intent categories and trigger static, tied-to-intention templates to generate responses. Because these models lack the ability to model deep semantics and contextual relationships, and heavily depend on manually designed features or limited labeled data, their understanding is limited to surface vocabulary and fixed sentence structures, making it difficult to capture subtle differences or complex expressions in the user's true intent.

[0032] For this reason, such systems typically rely solely on isolated textual features of the current input when processing user requests, failing to effectively integrate contextual information such as the user's historical interaction records, long-term preferences, or dialogue state. This "memoryless" or "weak context" processing mechanism makes it difficult for the system to maintain logical consistency across multiple rounds of dialogue and to dynamically adjust its response strategy based on user identity or behavioral characteristics. As a result, while the generated responses may be grammatically correct in a single round, they appear mechanical, repetitive, or disconnected from user needs within the overall dialogue flow, leading to insufficient coherence and a lack of personalized adaptation. Therefore, responses generated by traditional dialogue systems lack coherence and personalized adaptability.

[0033] Please see Figure 1The illustrated flowchart represents a chatbot interaction method provided in this application embodiment. The main idea of ​​this method is to construct prompt content by combining contextual information corresponding to the user identifier with intent recognition results. This allows the model to not only understand the semantic intent of the current question when generating an answer, but also to integrate personalized context such as the user's historical interactions, preferences, or states, thereby effectively improving the coherence and personalized adaptability of the dialogue. The implementation methods of the above-mentioned chatbot interaction method may include: Step S110: Obtain the user request, which includes: user identifier and natural language question.

[0034] A user request is an interactive information request submitted by a user to the system. It usually includes a user identifier and a natural language query. These user requests are typically collected through front-end interfaces (such as web pages, apps, and voice devices) and transmitted over the network to the back-end system server for processing.

[0035] A user identifier is a unique identifier used to associate a user's contextual information or historical data to enable personalized services. This user identifier can be generated through a registration system (such as an auto-incrementing ID in a database), obtained through third-party login (such as OpenID), or obtained by hashing device information.

[0036] Natural language problems involve questions or instructions posed by users in the form of everyday human language (unstructured text or speech), which the system needs to understand and answer. For example, it could be "Will it rain in Beijing tomorrow?".

[0037] Step S120: Perform intent recognition on the natural language question using the intent recognition model to obtain the intent recognition result.

[0038] An intent recognition model is a machine learning or deep learning model used to understand and analyze natural language questions, determining the user's intent or need (such as querying, performing an action, or seeking advice). This intent model can be trained on labeled data (such as labeling question intent categories). Understandably, the application of such intent recognition models enables natural language questions to be parsed and understood more accurately, thereby reducing the possibility of misunderstanding user intent and improving the interaction efficiency and user experience of chatbots, because the intent recognition results can directly guide the subsequent prompt generation and answer selection process.

[0039] The intent recognition result is a structured output of the intent recognition model, representing the core intent or classification label of the user's question. It can be generated by the intent recognition model through reasoning about the input question and may include a probability distribution or confidence score.

[0040] Step S130: Obtain the context information corresponding to the user identifier, and combine the context information and the intent recognition result to obtain the prompt word content.

[0041] Contextual information consists of historical interaction records, preferences, environmental data, etc., associated with a user's identifier, used to supplement the semantics of the current problem. For example, user history can be extracted from databases, caches, or logs as contextual information.

[0042] The prompt content is a structured input combining contextual information and intent recognition results, used to guide the model cluster in generating responses. This can be achieved through string concatenation, template filling, or structured data transformation (such as JSON serialization). It's understandable that generating prompt content by combining contextual information corresponding to the user identifier with intent recognition results can significantly improve the personalized response capabilities of chatbots. This is because the contextual information includes the user's historical interaction data, allowing the generated responses to better match the user's specific needs and preferences, rather than simply being based on an isolated understanding of the current question.

[0043] Step S140: Process the prompt words using a model cluster to obtain candidate answers to the natural language question.

[0044] A model cluster is a set of large language models working collaboratively. It is a collection of multiple large language models that can be distributed in production and testing environments and can have different parameter scales. The model cluster is used to process prompt words and selects the appropriate model for processing based on different conditions (such as service anomalies, traffic anomalies, or task complexity) to ensure service stability under high concurrency.

[0045] The aforementioned candidate answers can be a list of possible answers output by the model cluster, which needs further filtering or optimization before being returned to the user. It is understandable that by using a model cluster to process the prompt words, the advantages of different models can be fully utilized, improving the diversity and accuracy of the answers. This is because a model cluster can process multiple prompt words in parallel, generating multiple candidate answers, and thus selecting the optimal answer, avoiding the limitations or biases that may exist with a single model.

[0046] In implementing the above scheme, prompt content is constructed by combining contextual information corresponding to the user identifier with intent recognition results. This allows the model to not only understand the semantic intent of the current question when generating answers, but also integrate personalized context such as the user's historical interactions, preferences, or states. This results in candidate answers that better match the user's actual needs and dialogue history during the model cluster processing stage. This deep integration of personalized context and intent ensures logical consistency and close contextual association in the answers, taking into account the specific user's characteristics and historical behavior, thus effectively improving the coherence and personalization of the dialogue. Furthermore, by dynamically combining contextual information and intent recognition results to generate prompt content, flexible utilization of dialogue context is achieved, enabling the chatbot to maintain coherence and consistency in multi-turn dialogues, avoiding the disconnect in answers caused by ignoring context in traditional methods.

[0047] As an optional implementation of step S110 above, for example, user requests are obtained through a multi-channel interface, which may include a web page, a mobile app, a voice interaction device, etc. The generation of the user identifier requires a combination of various technical means, such as generating a unique database ID (e.g., UUID) based on user registration information, obtaining an OpenID through a third-party login interface, or hashing device fingerprint information (e.g., IMEI, IP address). Natural language question collection can support text input and speech-to-text (ASR) functions, where voice input can be denoised and semantically corrected using a speech recognition model. For example, when a user asks "Help me book a high-speed rail ticket for tomorrow morning" through a voice device, the voice signal can be converted into the text "Help me book a high-speed rail ticket for tomorrow morning," thus obtaining the user identifier (e.g., the hash value corresponding to the device ID) and the question text.

[0048] As an optional implementation of step S120 above, for example, a classification model based on the Transformer architecture (such as BERT, RoBERTa) or a lightweight model (such as DistilBERT) can be used as the intent recognition model to perform intent recognition on the natural language question above and obtain the intent recognition result. The intent recognition model can be trained on a labeled dataset, where each sample can contain a natural language question and a corresponding intent label (such as "book tickets", "check remaining tickets", "change tickets"). The output of the intent recognition result can be structured data, such as JSON format: {"intent":"book tickets","confidence":0.92,"slots":{"departure point":"Beijing","destination":"Shanghai","time":"2025-12-10"}}. If the model confidence is lower than a preset threshold (such as 0.7), a manual review process can be triggered or a backup intent recognition model can be called for secondary verification.

[0049] As an optional implementation of step S130 above, the implementation of combining contextual information and intent recognition results to obtain prompt word content may include: Step S131: Match the target prompt word template from multiple prompt word templates based on the intent recognition result.

[0050] For example, in implementing step S131 above, if the intent recognition result is "booking tickets", the template containing "recommending train routes for booking based on user's historical preferences" can be matched from multiple prompt word templates as the target prompt word template. It is understood that by generating prompt words using a template-based filling method, processing efficiency is significantly improved while ensuring semantic accuracy. This is because the template predefines the optimal language structure and key information positions, and the system only needs to perform structured information insertion operations, avoiding the complex computational overhead of real-time language generation.

[0051] Step S132: Fill the target prompt word template with the context information and intent recognition results to obtain the prompt word content.

[0052] For example, step S132 can be implemented by dynamically loading context information and intent recognition results based on intent tags, and then filling the target prompt word template with the context information and intent recognition results to obtain the prompt word content. It is understood that obtaining context information can rely on a distributed storage system (such as Redis or HBase) to store user historical interaction records (such as dialogue history over the past 30 days), preference settings (such as frequently used train types and seat classes), and environmental data (such as geographical location and device type). For example, if user A's history shows a preference for "second-class seats" and "G-series high-speed trains," and the current question is "help me book a ticket," then the context information could include: {"user_id":"A123456","history":["Last booking time was 2025-11-20","Selected second-class seats 2 times"],"preference":{"seat_type":"second-class seats","train_type":"G"},"location":"Haidian District, Beijing"}.

[0053] As an optional implementation of step S140 above, the model cluster may include: a large language model in a production environment and a large language model in a test environment; the implementation of processing prompt word content through the model cluster may include: Step S141: Determine whether the service of the large language model in the production environment is abnormal, or whether the traffic of the large language model in the production environment processing the prompt word content is abnormal.

[0054] Large language models in production environments refer to models that provide services to users in real-world applications. These are typically deployed in live, real-world environments and are stable versions that have undergone thorough testing and optimization. Models are trained using large-scale training data and computing resources, and then rigorously tested and optimized before being deployed to production servers.

[0055] For example, the implementation of step S141 above can be described as follows: It is understood that the aforementioned model cluster may include a large language model in a production environment and a large language model in a test environment. The high-precision large model deployed in the production environment (such as Qwen3-32B or DeepSeek-V3) is used to respond to user requests in real time, has high resource utilization, and requires monitoring of its service health status through a heartbeat probe mechanism (e.g., sending an HTTP request every 30 seconds to check response time). The server can determine whether the service of the large language model in the production environment is abnormal, or whether the traffic of the large language model in the production environment processing prompt word content is abnormal.

[0056] Step S142: If the service of the large language model in the production environment is abnormal, or the traffic of the large language model in the production environment processing the prompt content is abnormal, then the prompt content is processed through the large language model in the test environment.

[0057] For example, in the implementation of step S142 above, if the service of the large language model in the production environment is abnormal, or if the traffic of the large language model in the production environment processing the prompt content is abnormal, then the prompt content is processed by the large language model in the test environment. The large language model in the test environment refers to a new version or experimental model used for development and testing, typically used for verification and improvement before formal deployment. The model can be trained and debugged in the development environment and deployed to a test server for performance and security testing. The large language model in the test environment can deploy lightweight models (such as Qwen3-4B) and experimental models for offline training data generation, handling abnormal traffic (such as automatically diverting 20% ​​of requests to the test environment when the production environment is overloaded), and supporting A / B testing of the new model's effectiveness. The above technical solution provides redundancy for the production environment by deploying a backup large language model in the test environment. This design enhances the system's robustness, enabling rapid response to sudden problems in the production environment and reducing the risk of service quality degradation due to model failure. Furthermore, by monitoring the service status and traffic of the production environment model in real time, this technical solution achieves dynamic awareness of the model cluster's operating status. This proactive monitoring mechanism can promptly identify potential problems and take countermeasures before the impact of the problems escalates, thereby improving the stability and maintainability of the system.

[0058] Optionally, the model cluster can perform proactive routing based on task analysis. Based on the intent recognition results and / or analysis of the text length and sentence structure of the natural language question, the task complexity of the natural language question is initially assessed. Subsequently, based on the assessed task complexity, a large language model with a corresponding number of parameters is selected from the model cluster for processing. For example, low-complexity tasks can use lightweight models with fewer parameters to improve response speed and resource efficiency, while high-complexity tasks can use models with more parameters to ensure the depth and accuracy of the answer.

[0059] Optionally, routing degradation can also be performed based on health status. The system can determine in real-time whether the model's service is abnormal (e.g., detected via a heartbeat probe mechanism) or whether its real-time request traffic exceeds a preset threshold. If so, all or part of the current request is diverted to a backup large language model in the test environment for processing to ensure service continuity and trigger an alarm to notify operations personnel.

[0060] As an optional implementation of step S140 above, the model cluster may include: multiple large language models with different parameter scales. The implementation method of processing prompt word content through a model cluster may include: Step S143: Determine the task complexity of the natural language problem based on the prompt words.

[0061] The prompt words refer to the combined and filled input text used to guide the large language model to generate the required answer.

[0062] Step S144: Select a large language model with a parameter level corresponding to the task complexity from the model cluster and process the prompt word content.

[0063] Task complexity refers to the processing difficulty and resource requirements of a natural language problem, and is usually related to the length, specialization, and logic of the problem. Specifically, complexity can be determined by analyzing features such as the length of the prompts, keywords, and sentence structure.

[0064] The implementation of steps S143 to S144 above can be exemplified by determining the task complexity of a natural language problem based on the prompt words, and then selecting a large language model with a parameter level corresponding to the task complexity from a model cluster. Since large models with different parameter levels can achieve a dynamic balance between resource efficiency and response quality, the model cluster prioritizes calling large language models from the production environment, ensuring service continuity during traffic peaks or model anomalies. Here, parameter level refers to the number of trainable parameters in a large language model, typically proportional to the model's size and capabilities. It is understood that by adopting a dynamic model selection strategy, computing resources can be flexibly allocated according to actual task requirements, avoiding the high energy consumption problem caused by fixed use of a single large model. This adaptive mechanism can significantly reduce the overall energy consumption of the system while ensuring task processing effectiveness, achieving the goal of green computing. Furthermore, by establishing a model cluster and intelligent scheduling mechanism, the system can automatically adapt to natural language processing tasks of different complexities without manual intervention in model selection. This automated processing flow not only improves the system's intelligence but also greatly reduces the cost of manual parameter tuning and maintenance.

[0065] As an optional implementation of step S140 above, after obtaining the candidate answers corresponding to the natural language question, it may further include: Step S145: Perform quality inspection on the candidate answers and obtain the quality inspection results.

[0066] Candidate answers refer to the preliminary answers generated by the large language model based on the prompt words. These answers need to be quality checked before it can be sent to the user.

[0067] Quality inspection refers to the quality check of candidate answers, which can include assessments of content accuracy, security, compliance, etc., and can be achieved through a multi-layered inspection process, such as rule filters, quality inspection models, and manual review.

[0068] In implementing the above solution, the introduction of a quality inspection step can further optimize the overall system performance. By inspecting candidate responses, the system can promptly identify and correct potential errors or deviations, thereby reducing repetitive work or error propagation in subsequent processing and improving system efficiency and response speed. This optimization is particularly important for large-scale or real-time applications. Furthermore, the above technical solution possesses strong scalability and adaptability. The quality inspection step can be customized according to different application scenarios or needs, such as adjustments based on specific domain expertise or quality requirements. This allows the technical solution to flexibly address diverse application needs, enhancing the system's versatility and practicality.

[0069] As an optional implementation of step S145 above, the implementation of quality inspection of candidate answer content may include: Step S145a: Obtain the request identifier corresponding to the candidate answer content.

[0070] A request identifier is a unique identifier for a user request, used to track and manage the request processing flow. This request identifier can be generated by the system when a user request is received and attached to the entire request processing process.

[0071] Step S145b: Determine whether the request identifier is in the preset whitelist.

[0072] A pre-defined whitelist refers to a set of pre-approved identifiers or sources that allow requests to bypass some or all quality control processes. It can be a set of trusted identifiers configured and maintained by the system administrator.

[0073] For example, after obtaining the request identifier corresponding to the candidate answer content, it can be determined whether the request identifier is in a preset whitelist. If the request identifier is in the preset whitelist, it means that the user request corresponding to the request identifier is issued by a user terminal in the whitelist. In this case, the subsequent quality inspection process can be bypassed, that is, the rule filter unit, quality inspection model unit, and manual fallback unit executed in sequence can be skipped, and the candidate answer content can be sent directly to the user terminal corresponding to the request identifier.

[0074] Step S145c: If the request identifier is in the preset whitelist, the candidate answer content is determined to have passed the quality inspection, and the subsequent rule filter unit, quality inspection model unit and manual fallback unit are skipped.

[0075] For example, in the implementation of step S145c above: if the request identifier is within a preset whitelist, the candidate answer content is determined to have passed the quality inspection, and the subsequent sequential execution of the rule filter unit, quality inspection model unit, and manual fallback unit is skipped. In other words, if the request identifier is within the preset whitelist, it indicates that the user request corresponding to that request identifier was issued by a user terminal within the whitelist. In this case, the subsequent quality inspection process can be bypassed, i.e., the subsequent sequential execution of the rule filter unit, quality inspection model unit, and manual fallback unit is skipped, and the candidate answer content is directly sent to the user terminal corresponding to that request identifier. The rule filter unit refers to a component that performs preliminary screening of candidate answer content based on preset rules. A series of content inspection rules can be implemented through programming, such as semantic security detection and sensitive content determination for candidate answer content. It is understandable that by setting a manual fallback unit as the final quality inspection stage and forming a cascade relationship with the preceding automated quality inspection unit, this solution maintains the efficiency advantage of automated processing while providing a guarantee mechanism for manual intervention in complex or edge cases, thereby achieving a balance between quality inspection accuracy and processing efficiency.

[0076] Step S145d: If the request identifier is not in the preset whitelist, the candidate answer content is inspected through the rule filter unit, the quality inspection model unit, and the manual fallback unit.

[0077] The implementation of step S145d above is as follows: If the request identifier is not in the preset whitelist, the rule filter unit, quality inspection model unit, and manual fallback unit can be used to perform semantic security detection and sensitive content determination on the candidate answer content. The quality inspection model unit can also perform quality inspection on the candidate answer content using a large language model. Furthermore, the manual fallback unit can send the candidate answer content to the human reviewer's terminal device for further manual quality inspection. The manual fallback unit refers to the final inspection performed by a human reviewer after the automatic quality inspection process. The quality inspection model unit is a component that uses a deep learning model to evaluate the quality of candidate answer content, such as a trained answer quality scoring model. This answer quality scoring model can be trained using Low-Rank Adaptation (LoRA) Supervised Fine-Tuning (SFT) methods, using stored real data and manually labeled quality inspection results. The stored real data includes the user's current input, context information, prompts, robot answers, and quality inspection results. In the implementation of the above scheme, by designing the rule filter and the quality inspection model unit in series, the system can first quickly filter obviously unqualified content through rules, and then perform more refined model analysis on the remaining content. This hierarchical processing method not only ensures the comprehensiveness of quality inspection, but also avoids the computational overhead caused by directly using complex models.

[0078] Please see Figure 2 The illustration shows a flowchart of the Supervised Fine-Tuning (SFT) process provided in this application embodiment; it describes the complete process of constructing a professional domain quality inspection model by performing Supervised Fine-Tuning (SFT) on a large language model (or "base model") based on LoRA (Low-Rank Adaptation) technology. The process begins with a "storage module," which provides "business data" annotated by "experts" as training samples. Simultaneously, a fixed "base model" receives "contextual information" and generates "robot responses." Both of these, along with the business data, are input into the initialized LoRA module for fine-tuning. Finally, the trained "quality inspection model" is saved and used to evaluate the quality of the robot's responses in specific business scenarios.

[0079] Understandably, the core idea of ​​the aforementioned Supervised Fine-Tuning (SFT) is to leverage a supervised learning paradigm to fine-tune a pre-trained model end-to-end using paired input-output data (such as instruction-response, original text-translation, etc.). Given input text x and target output y, the model adjusts its parameters by minimizing the negative log-likelihood (NLL) loss.

[0080] in, Indicates the model in parameters Generate target sequence The conditional probability is obtained through gradient descent, which optimizes the model weights to significantly improve its generation capability for specific tasks.

[0081] As an optional implementation of step S140 above, after quality control of the candidate answers, the following may also be included: Step S146: Determine whether the candidate answer content passes the quality inspection.

[0082] Step S147: If the candidate answer content passes the quality inspection, the candidate answer content is sent to the terminal device corresponding to the user identifier.

[0083] For example, the implementation of steps S146 to S147 above is as follows: If the request identifier (such as user ID or request ID) is in a preset whitelist (configured by the system administrator), the rule filtering and quality inspection model evaluation are skipped directly, and the candidate answer content is determined to have passed the quality inspection. Based on preset business rules (such as a sensitive word library and compliance clauses), regular expression matching and semantic analysis are performed on the candidate answer content. If the candidate answer content contains preset sensitive words, rule filtering is triggered, and the candidate answer content is marked as failing the quality inspection. After the candidate answer content is quality inspected, the inspection result is obtained. Then, based on the inspection result, it is determined whether the candidate answer content has passed the quality inspection. If the candidate answer content has passed the quality inspection, it is sent to the terminal device corresponding to the user identifier.

[0084] Step S148: If the candidate answer fails the quality inspection, obtain the preset fallback answer and send the preset fallback answer to the terminal device corresponding to the user identifier.

[0085] The implementation of step S148 above is as follows: If the candidate answer fails the quality inspection, a preset fallback answer is retrieved from a pre-stored database or file system, and the corresponding fallback template is matched according to the specific reason for the quality inspection failure (such as rule filtering, quality inspection model scoring, or manual review). For example, if rule filtering is triggered by "sensitive words," the "sensitive word trigger" template is called; if the quality inspection model score is below the threshold, the "general fallback" template is called. Finally, the preset fallback answer is sent to the terminal device corresponding to the user identifier. The preset fallback answer refers to the default safe answer provided by the system when the candidate answer fails the quality inspection. This preset fallback answer can be a standard answer template content pre-set by the system administrator. In the implementation of the above scheme, by dynamically switching between candidate answer content and preset fallback answer content, this technical solution achieves flexible processing of answer content of different quality and optimizes the output strategy of answer content. This dynamic switching not only improves the applicability of the answer content but also maximizes the advantages of the candidate answer content while ensuring answer quality, thereby improving the overall performance and response efficiency of the system. Furthermore, by introducing pre-set fallback answers, the system's reliance on candidate answers is reduced, enhancing its robustness. Even if anomalies occur during candidate answer generation or quality control, the system can still maintain normal operation using the pre-set fallback answers, thereby reducing the risk of system failure and improving system stability and availability.

[0086] As an optional implementation of the above-mentioned chatbot interaction method, it also includes: Step S150: Store the user request, context information, prompt words, candidate answer content, and quality inspection results in the training dataset.

[0087] For example, step S150 can be implemented by storing user requests, context information, prompt words, candidate answers, and quality control results in a training dataset using an executable program compiled in a preset programming language. The training dataset refers to a collection of data used to train or optimize a large language model, containing user requests, context information, prompt words, candidate answers, and quality control results, and is formed by collecting, organizing, and labeling interaction data from real-world applications.

[0088] Step S160: Construct positive and negative sample pairs based on the training dataset, and train the large language model in the model cluster using the positive and negative sample pairs.

[0089] Positive and negative sample pairs refer to comparative data used for model training. Positive samples represent high-quality answers, while negative samples represent unsatisfactory answers. These pairs can be constructed by classifying and pairing answers in the training dataset based on their quality. It's understandable that training through model clusters fully utilizes distributed computing resources, accelerating the training process while improving model stability and reliability. This cluster training method not only improves training efficiency but also enables more efficient optimization of the model on large-scale data, further enhancing model performance.

[0090] As an optional implementation of step S160 above, the implementation of constructing positive and negative sample pairs based on the training dataset may include: Step S161: Data whose candidate responses fail quality inspection or random sampling are identified as negative samples.

[0091] For example, the implementation of step S161 above involves obtaining stored real data, which may include the user's current input, context information, prompts, robot responses, and quality inspection results. Data that fails quality inspection or random sampling is filtered out from this real data, and data whose candidate responses fail quality inspection or random sampling is identified as negative samples.

[0092] Step S162: Re-input the prompt words from the training dataset into the model cluster to obtain multiple candidate answer contents.

[0093] For example, the implementation of step S162 above involves re-inputting the prompt words from the training dataset into the model cluster to obtain multiple candidate answer contents, and then inputting these multiple candidate answer contents into the score calculation model so that the score calculation model can calculate the scores of these multiple candidate answer contents.

[0094] Step S163: Calculate the scores of multiple candidate answer contents, and select candidate answer contents with scores greater than negative samples from the multiple candidate answer contents.

[0095] An example implementation of step S163 above is as follows: Multiple candidate answer contents are input into a score calculation model, which then calculates scores for each candidate answer. Based on these scores, the candidate answer contents are labeled. For instance, experts may use GSB (Good, Same, Bad) labeling to compare each candidate answer with a negative sample. Candidate answer contents with scores higher than the negative sample are labeled "Good," those with scores equal to the negative sample are labeled "Same," and those with scores lower than the negative sample are labeled "Bad."

[0096] Step S164: Determine the candidate answer content with a score greater than that of the negative sample as the positive sample, and construct positive and negative sample pairs based on the positive and negative samples.

[0097] For example, step S164 can be implemented as follows: candidate answer content with scores greater than negative samples can be identified as positive samples, and positive-negative sample pairs can be constructed based on the positive and negative samples. After constructing the positive-negative sample pairs, the quality inspection large language model in the quality inspection model unit can be optimized using the constructed positive and negative samples based on Lora's Direct Preference Optimization (DPO) algorithm, thereby obtaining an optimized model with domain-specific speaking style. The aforementioned Direct Preference Optimization (DPO) algorithm is an improvement on traditional reinforcement learning-based preference optimization methods (such as Proximal Policy Optimization, PPO), aiming to optimize the model output more directly and stably, making it conform to human expectations. The aforementioned DPO, through analytical derivation, transforms the reinforcement learning objective into a simple supervised learning problem, thereby avoiding the complex policy gradient optimization process. Specifically, the optimization objective of the above DPO can be expressed as:

[0098] in, For the best answer, This is the worst answer. It is a strategy model that needs to be optimized. It is a reference model with fixed parameters. It is a hyperparameter that controls the optimization intensity. This refers to the sigmoid function, an objective function that directly optimizes the preference ranking output by the model without requiring an additional reward model or reinforcement learning optimizer. Understandably, by calculating scores for multiple candidate answers and selecting those with scores higher than negative samples as positive samples, the quality of positive samples is ensured to be higher than that of negative samples, thus creating a more significant discriminative effect during training and improving the model's discriminative ability. Furthermore, constructing positive-negative sample pairs based on positive and negative samples allows for direct comparison of the differences between them, enabling the model to more clearly learn the feature differences between high-quality and low-quality answers during training, thereby improving the model's generation quality.

[0099] Please see Figure 3 The diagram shown is a structural schematic of the chatbot interaction device provided in an embodiment of this application; this application provides a chatbot interaction device 200, including: User request acquisition module 210 is used to acquire user requests, which include user identifier and natural language questions.

[0100] The recognition result acquisition module 220 is used to perform intent recognition on natural language questions through the intent recognition model and obtain intent recognition results.

[0101] The information result combination module 230 is used to obtain the context information corresponding to the user identifier, and combine the context information and the intent recognition result to obtain the prompt word content.

[0102] The answer content acquisition module 240 is used to process the prompt words through the model cluster to obtain candidate answer content corresponding to the natural language question.

[0103] As an optional implementation of the above-mentioned device, the information result combination module includes: The prompt word template matching module is used to match the target prompt word template from multiple prompt word templates based on the intent recognition results.

[0104] The prompt word template filling module is used to fill the target prompt word template with context information and intent recognition results to obtain the prompt word content.

[0105] As an optional implementation of the above-mentioned device, the model cluster includes: a large language model in a production environment and a large language model in a testing environment; the response content acquisition module includes: The service traffic judgment module is used to determine whether the service of the large language model in the production environment is abnormal, or whether the traffic of the large language model in the production environment processing the prompt word content is abnormal.

[0106] The prompt content processing module is used to process the prompt content through the large language model in the test environment if the service of the large language model in the production environment is abnormal, or if the traffic of the large language model in the production environment is abnormal in processing the prompt content.

[0107] As an optional implementation of the above-mentioned device, the model cluster includes: multiple large language models with different parameter magnitudes; the response content acquisition module includes: The task complexity determination submodule is used to determine the task complexity of a natural language problem based on the content of the prompt words.

[0108] The prompt word content processing submodule is used to select a large language model with a parameter level corresponding to the task complexity from the model cluster and process the prompt word content.

[0109] As an optional implementation of the above-mentioned device, the chatbot interaction device further includes: The quality inspection result acquisition module is used to perform quality inspection on candidate answer content and obtain quality inspection results.

[0110] As an optional implementation of the above-mentioned device, the quality inspection result acquisition module includes: The request identifier retrieval submodule is used to retrieve the request identifier corresponding to the candidate answer content.

[0111] The request identifier determination submodule is used to determine whether the request identifier is in the preset whitelist.

[0112] The quality inspection determination submodule is used to determine whether the candidate answer content passes the quality inspection if the request identifier is in the preset whitelist, and skips the rule filter unit, quality inspection model unit and manual fallback unit that are executed in sequence.

[0113] The answer content quality inspection submodule is used to perform quality inspection on candidate answer content through the rule filter unit, quality inspection model unit, and manual fallback unit if the request identifier is not in the preset whitelist.

[0114] As an optional implementation of the above-mentioned device, the chatbot interaction device further includes: The content quality inspection judgment module is used to determine whether the content of candidate answers passes the quality inspection.

[0115] The response content sending module is used to send the candidate response content to the terminal device corresponding to the user identifier if the candidate response content passes the quality inspection.

[0116] The fallback content sending module is used to obtain preset fallback content if the candidate answer content fails the quality inspection, and send the preset fallback answer content to the terminal device corresponding to the user identifier.

[0117] As an optional implementation of the above-mentioned device, the chatbot interaction device further includes: The training data storage module is used to store user requests, context information, prompt words, candidate answers, and quality inspection results in the training dataset.

[0118] The language model training module is used to construct positive and negative sample pairs based on the training dataset and to train the large language model in the model cluster using the positive and negative sample pairs.

[0119] As an optional implementation of the above-mentioned device, the language model training module includes: The negative sample determination submodule is used to identify candidate responses that fail quality inspection or random sampling as negative samples.

[0120] The prompt input submodule is used to re-input the prompt content from the training dataset into the model cluster to obtain multiple candidate answer contents.

[0121] The candidate answer filtering module is used to calculate the scores of multiple candidate answer contents and filter out the candidate answer contents with scores greater than those of the negative samples.

[0122] The positive sample determination submodule is used to identify candidate answer content with scores greater than negative samples as positive samples, and to construct positive-negative sample pairs based on positive and negative samples.

[0123] It should be understood that this device corresponds to the above-described dialogue robot interaction method embodiment and is capable of performing the various steps involved in the above method embodiment. The specific functions of this device can be found in the description above, and detailed descriptions are appropriately omitted here. The device includes at least one software functional module that can be stored in memory or embedded in the device's operating system (OS) in the form of software or firmware.

[0124] Please see Figure 4 The diagram shows a structural schematic of an electronic device provided in an embodiment of this application. An electronic device 300 provided in this application includes a processor 310 and a memory 320. The memory 320 stores machine-readable instructions executable by the processor 310. When the machine-readable instructions are executed by the processor 310, the method described above is performed.

[0125] This application embodiment also provides a computer-readable storage medium 330, on which a computer program is stored. This computer program is executed by a processor 310 to perform the methods described above. The computer-readable storage medium 330 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0126] This application also provides a computer program product, including: a computer program or computer instructions, which are executed by a processor to perform the method described above.

[0127] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0128] It should be understood that the disclosed apparatus and methods can also be implemented in other ways, as provided in the embodiments of this application. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending primarily on the functions involved.

[0129] Furthermore, the functional modules of each embodiment in this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. In addition, in the description of this specification, the reference to terms such as "one embodiment," "some embodiments," "example," "specific example," "some examples," etc., means that the specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0130] The above description is only an optional implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of this application should be covered within the protection scope of the embodiments of this application.

Claims

1. A method for interacting with a chatbot, characterized in that, include: Obtain a user request, which includes: a user identifier and a natural language question; The intent recognition model is used to identify the intent of the natural language question, and the intent recognition result is obtained. Obtain the context information corresponding to the user identifier, and combine the context information with the intent recognition result to obtain the prompt word content; The prompt words are processed by a model cluster to obtain candidate answers to the natural language question.

2. The method according to claim 1, characterized in that, The step of combining the context information and the intent recognition result to obtain the prompt word content includes: Based on the intent recognition results, the target prompt word template is matched from multiple prompt word templates; The context information and the intent recognition result are filled into the target prompt word template to obtain the prompt word content.

3. The method according to claim 1, characterized in that, The model cluster includes: a large language model in the production environment and a large language model in the test environment; the processing of the prompt word content through the model cluster includes: Determine whether the service of the large language model in the production environment is abnormal, or whether the traffic of the large language model in the production environment processing the prompt word content is abnormal; If so, the prompt word content is processed using a large language model in the test environment.

4. The method according to claim 1, characterized in that, The model cluster includes: multiple large language models with different parameter scales; the processing of the prompt word content through the model cluster includes: Determine the task complexity of the natural language problem based on the content of the prompt words; The model cluster selects a large language model with a parameter magnitude corresponding to the task complexity and processes the prompt word content.

5. The method according to claim 1, characterized in that, After obtaining the candidate answers to the natural language question, the method further includes: The candidate answers are subjected to quality inspection, and the inspection results are obtained.

6. The method according to claim 5, characterized in that, The quality inspection of the candidate answers includes: Obtain the request identifier corresponding to the candidate answer content; Determine whether the request identifier is in a preset whitelist; If so, the candidate answer content is determined to have passed the quality inspection, and the subsequent rule filter unit, quality inspection model unit, and manual fallback unit are skipped. If not, the candidate answer content is quality checked through the rule filter unit, the quality inspection model unit, and the manual backup unit.

7. The method according to claim 5, characterized in that, After performing quality control on the candidate answers, the process further includes: Determine whether the candidate answer content passes the quality inspection; If so, the candidate answer content is sent to the terminal device corresponding to the user identifier; If not, then obtain the preset fallback answer and send the preset fallback answer to the terminal device corresponding to the user identifier.

8. The method according to claim 5, characterized in that, Also includes: The user request, the context information, the prompt word content, the candidate answer content, and the quality inspection result are stored in the training dataset; Positive and negative sample pairs are constructed based on the training dataset, and the large language model in the model cluster is trained using the positive and negative sample pairs.

9. The method according to claim 8, characterized in that, The step of constructing positive and negative sample pairs based on the training dataset includes: Data whose candidate responses fail quality control or random sampling are identified as negative samples. The prompt words from the training dataset are re-input into the model cluster to obtain multiple candidate answer contents; Calculate the scores of the multiple candidate answer contents, and filter out the candidate answer contents with scores greater than those of the negative samples from the multiple candidate answer contents; Candidate answer contents with scores greater than those of the negative samples are identified as positive samples, and positive-negative sample pairs are constructed based on the positive samples and the negative samples.

10. A conversational robot interaction device, characterized in that, include: The user request acquisition module is used to acquire user requests, which include: user identifier and natural language questions; The recognition result acquisition module is used to perform intent recognition on the natural language question through the intent recognition model and obtain the intent recognition result; The information result combination module is used to obtain the context information corresponding to the user identifier, and combine the context information and the intent recognition result to obtain the prompt word content; The answer content acquisition module is used to process the prompt word content through a model cluster to obtain candidate answer content corresponding to the natural language question.

11. An electronic device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, the machine-readable instructions being executed by the processor to perform the method of any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the method according to any one of claims 1 to 9.

13. A computer program product, characterized in that, include: A computer program or computer instructions that, when executed by a processor, perform the method according to any one of claims 1 to 9.