Customer service script testing method, device, equipment and medium

CN122614737APending Publication Date: 2026-08-21CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610890366.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-18
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

[0005]本发明的主要目的在于提供一种客服话术测试方法、装置、设备及存储介质,旨在解决现有技术中客服话术测试依赖人工盲测、规则脚本或历史日志回放,存在拟真度低、成本高、无法动态交互及自动优化的问题

Benefits of technology

[0010]有益效果:本发明涉及人工智能技术领域,公开了一种客服话术测试方法、装置、设备及介质,包括:获取历史真实对话数据和关联业务元数据,并对所述历史真实对话数据和所述关联业务元数据进行标注,生成训练样本;将所述训练样本输入大语言模型中进行训练,得到教师模型;根据所述教师模型和训练样本对学生模型进行多层知识蒸馏和对抗训练;通过虚拟用户实例驱动训练后的学生模型与被测客服系统进行动态交互测试,生成动态交互式测试结果序列;通过动态交互式测试结果序列对被测客服系统的客服话术进行评估,得到多维度量化评估指标序列;根据所述多维度量化评估指标序列对未达标会话进行自动归因和根因定位,生成优化修改方案,并根据优化修改方案对客服话术进行修正,完成客服话术测试。本发明可应用于金融科技和医疗健康等业务场景中,通过真实对话标注、教师模型训练、学生模型蒸馏对抗及虚拟用户动态交互测试与多维评估,帮助系统自动归因生成话术优化方案,提高了客服话术测试的拟真度与自动化效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122614737A_ABST
    Figure CN122614737A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and discloses a customer service dialogue test method, device, equipment and medium, which comprises the following steps: constructing a training sample by marking historical dialogue and business metadata, and training a high-fidelity teacher model according to a large language model; transferring the teacher ability to a lightweight student model through multi-layer knowledge distillation and adversarial training; dynamically interacting the student model and the measured customer service system by a virtual user instance to generate a multi-round test result sequence; quantitatively evaluating the dialogue quality in multiple dimensions based on the sequence; automatically attributing and positioning the root cause of the substandard conversation, generating an optimization modification scheme and correcting the dialogue, and completing the customer service dialogue test. The application can be applied to financial technology and medical health business scenarios, generates a dialogue optimization scheme through virtual user dynamic interactive test and multi-dimensional evaluation, and improves the fidelity and automation efficiency of the customer service dialogue test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, equipment and medium for testing customer service scripts. Background Technology

[0002] Currently, enterprises primarily rely on three methods for testing and evaluating customer service scripts (including standard human scripts and AI chatbot scripts), but all have significant drawbacks. The first is blind human testing and review, where quality control teams or external users conduct sampling tests, with each person completing only a few dozen conversations per day. This method is labor-intensive, time-consuming, cannot cover massive user profiles and long-tail scenarios, and review results depend on individual experience, leading to inconsistent standards and potentially contradictory conclusions for the same script. Furthermore, it fails to generate reproducible quantifiable metrics. The second is rule-based script testing, which pre-defines a fixed dialogue path of "user asks A → customer service answers B" and verifies it step-by-step using automated scripts. This method can only verify the pre-defined path and cannot simulate the complex emotional evolution, intent shifts, and varied expressions of real users. For example, it cannot test whether the customer service script effectively soothes a user as they gradually escalate from calm to anger; its coverage is extremely low, making it difficult to identify robustness issues under unexpected input. The third is static testing based on historical log playback, which directly uses real online dialogue records as test input and replays them into the new script. This is essentially "testing new scripts in old scenarios." Once the customer service response changes, the user's subsequent response should also change accordingly, but static replays cannot reproduce this dynamic interaction. For example, if a new script adds a reassuring phrase, whether the user will actually go from anger to calm cannot be reflected in the replay, resulting in a serious lack of generalization testing capability for the new script. The fundamental shortcoming of these three methods is the lack of a highly realistic, low-cost, quantifiable, and adaptive "virtual user" simulator that can adapt to changes in scripts. Therefore, it is impossible to conduct sufficient and objective dynamic stress testing and automatic optimization before the script goes live.

[0003] In the fintech business, manual blind testing relies on the experience of reviewers, making it difficult to establish unified quantitative standards for matching the suitability of wealth management products and compliance-compliant collection scripts. This results in insufficient coverage and inconsistencies in compliance judgments. Rule-based script testing can only verify preset paths and cannot simulate complex dynamic behaviors such as escalating user anxiety due to fund security and shifts in intent (e.g., from inquiring about credit limits to filing complaints). The ability of scripts to reassure and respond to compliance issues cannot be effectively verified. Historical log playback is a static test. After new scripts are added with risk warnings, old logs cannot reflect whether users will continue to inquire or terminate transactions, leading to the failure of generalization testing. The fundamental technical problem lies in the lack of a highly realistic virtual user simulator that can simulate the diverse behaviors, emotional states, and compliance interaction logic of financial users. Dynamic stress testing and automatic optimization cannot be performed on scripts before they go live.

[0004] In the healthcare sector, blind manual testing struggles to cover the vast array of disease types and individual patient differences. The diverse professional backgrounds of reviewers and the lack of consistency in evaluation standards regarding the standardization of medical terminology and the timeliness of risk warnings in dialogues prevent the formation of objective and reproducible quality indicators. Rule-based script testing can only validate fixed question-and-answer paths, but patient expressions are often accompanied by vague, repetitive, and emotional descriptions, and their conditions and intentions dynamically evolve (e.g., from symptom consultation to medication contraindications). Pre-set scripts cannot simulate this unstructured interaction and are insufficient to test the empathy and reassurance provided by the dialogue when patients are anxious or fearful. Static testing using historical log playback cannot adapt to the dynamic changes in patient responses after adjustments to new dialogue; for example, a new suggestion like "Please seek medical attention immediately" may alter patient compliance, and old logs cannot be restored. The core problem is the lack of realistic virtual patient simulators that can simulate real patient behavior, disease progression, and emotional fluctuations, potentially leading to communication errors. Summary of the Invention

[0005] The main objective of this invention is to provide a customer service script testing method, apparatus, equipment, and storage medium, aiming to solve the problems of low realism, high cost, and inability to dynamically interact and automatically optimize in existing customer service script testing methods that rely on manual blind testing, rule scripts, or historical log playback.

[0006] To achieve the above objectives, the present invention provides a customer service script testing method, comprising: Acquire historical real dialogue data and related business metadata, and annotate the historical real dialogue data and related business metadata to generate training samples; The training samples are input into a large language model for training to obtain a teacher model; Based on the teacher model and training samples, multi-layer knowledge distillation and adversarial training are performed on the student model; The trained student model is dynamically interacted with the customer service system under test by driving virtual user instances, generating a sequence of dynamic interactive test results. The customer service scripts of the tested customer service system are evaluated by a dynamic interactive test result sequence, resulting in a multi-dimensional quantitative evaluation index sequence. Based on the multi-dimensional quantitative evaluation index sequence, the non-compliant sessions are automatically attributed and root cause located, optimization and modification plans are generated, and customer service scripts are revised according to the optimization and modification plans to complete the customer service script test.

[0007] Furthermore, to achieve the above objectives, the present invention provides a customer service script testing device, comprising: The training sample construction module is used to acquire historical real dialogue data and related business metadata, and to annotate the historical real dialogue data and related business metadata to generate training samples. The teacher model training module is used to input the training samples into the large language model for training to obtain the teacher model; The distillation adversarial training module is used to perform multi-layer knowledge distillation and adversarial training on the student model based on the teacher model and training samples. The dynamic interaction testing module is used to drive the trained student model to conduct dynamic interaction tests with the customer service system under test through virtual user instances, and generate a sequence of dynamic interactive test results. The multidimensional evaluation index module is used to evaluate the customer service scripts of the tested customer service system through a dynamic interactive test result sequence, and obtain a multidimensional quantitative evaluation index sequence. The script optimization and correction module is used to automatically attribute and locate the root causes of substandard conversations based on the multi-dimensional quantitative evaluation index sequence, generate optimization and modification plans, and correct customer service scripts according to the optimization and modification plans to complete customer service script testing.

[0008] Furthermore, to achieve the above objectives, the present invention also provides a computer device, the computer device including a memory, a processor, and a customer service script testing program stored in the memory and executable on the processor, wherein when the customer service script testing program is executed by the processor, it implements the steps of the customer service script testing method as described above.

[0009] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a customer service script testing program, which, when executed by a processor, implements the steps of the customer service script testing method described above.

[0010] Beneficial Effects: This invention relates to the field of artificial intelligence technology and discloses a method, apparatus, device, and medium for testing customer service scripts. The method includes: acquiring historical real dialogue data and related business metadata, and annotating the historical real dialogue data and related business metadata to generate training samples; inputting the training samples into a large language model for training to obtain a teacher model; performing multi-layer knowledge distillation and adversarial training on a student model based on the teacher model and training samples; driving the trained student model to perform dynamic interactive testing with the customer service system under test through virtual user instances to generate a dynamic interactive test result sequence; evaluating the customer service scripts of the customer service system under test through the dynamic interactive test result sequence to obtain a multi-dimensional quantitative evaluation index sequence; automatically attributing and root cause analysis of substandard conversations based on the multi-dimensional quantitative evaluation index sequence, generating optimization and modification schemes, and correcting the customer service scripts according to the optimization and modification schemes to complete the customer service script testing. This invention can be applied to business scenarios such as fintech and healthcare. Through real dialogue annotation, teacher model training, student model distillation adversarial analysis, and virtual user dynamic interactive testing and multi-dimensional evaluation, it helps the system automatically attribute causes and generate script optimization schemes, improving the realism and automation efficiency of customer service script testing. Attached Figure Description

[0011] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1 This is a schematic diagram of an application environment for a customer service script testing method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating an embodiment of the customer service script testing method of the present invention; Figure 3 This is a schematic diagram of the functional modules of a preferred embodiment of the customer service script testing device of the present invention; Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 5 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation

[0012] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0013] The customer service script testing method provided in this invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The server can obtain historical real dialogue data and related business metadata from the client, and annotate the historical real dialogue data and related business metadata to generate training samples. The training samples are then input into a large language model for training to obtain a teacher model. Based on the teacher model and training samples, the student model undergoes multi-layer knowledge distillation and adversarial training. The trained student model is driven by virtual user instances to conduct dynamic interactive tests with the customer service system under test, generating a dynamic interactive test result sequence. The customer service scripts of the customer service system under test are evaluated using the dynamic interactive test result sequence to obtain a multi-dimensional quantitative evaluation index sequence. Based on the multi-dimensional quantitative evaluation index sequence, non-compliant conversations are automatically attributed and root cause located, generating optimization and modification schemes. The customer service scripts are then corrected based on the optimization and modification schemes to complete the customer service script test. This invention can be applied to business scenarios such as fintech and healthcare. Through real dialogue annotation, teacher model training, student model distillation adversarial training, and virtual user dynamic interactive testing and multi-dimensional evaluation, it helps the system automatically attribute causes and generate script optimization schemes, improving the realism and automation efficiency of customer service script testing. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will now be described in detail through specific embodiments.

[0014] Please see Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the customer service script testing method provided by the present invention. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0015] like Figure 2 As shown, the customer service script testing method proposed in this invention includes the following steps: S100. Obtain historical real dialogue data and related business metadata, and annotate the historical real dialogue data and related business metadata to generate training samples. S200. Input the training samples into the large language model for training to obtain the teacher model; S300. Perform multi-layer knowledge distillation and adversarial training on the student model based on the teacher model and training samples. S400: Drive the trained student model to perform dynamic interactive testing with the customer service system under test through virtual user instances, and generate a dynamic interactive test result sequence. S500: The customer service scripts of the tested customer service system are evaluated through a dynamic interactive test result sequence to obtain a multi-dimensional quantitative evaluation index sequence. S600. Based on the multi-dimensional quantitative evaluation index sequence, automatically attribute and locate the root causes of non-compliant sessions, generate optimization and modification plans, and revise customer service scripts according to the optimization and modification plans to complete the customer service script test.

[0016] In this embodiment, firstly, it is necessary to obtain real dialogue records and related business data from the customer service system within a preset time period (e.g., the past six months), such as static profile tags like user age, membership level, and number of historical complaints. Simultaneously, each user message is dynamically labeled, and a pre-trained model is used to identify emotional states (e.g., calm, impatient, angry, disappointed) and intent types (e.g., inquiry, complaint, negotiation, urging). Behaviors such as transferring to human assistance and ending the conversation are extracted from system logs and then correlated with the user's subsequent satisfaction rating. This constructs a complete training sample of "dialogue context plus customer service reply → user's next response, emotional changes, and behavioral actions," providing multi-dimensional information for subsequent models.

[0017] Next, a large open-source model like ChatGLM-3-6B was chosen as the foundation, upon which three parallel prediction modules were added: a text generation module (autoregressive generation of user responses), a sentiment prediction module (outputting the next round of sentiment classification), and a behavior prediction module (determining whether to transfer to human intervention or file a complaint). A low-rank adaptation (LoRA) fine-tuning strategy was employed, training only low-rank matrices to conserve resources, with the optimization objective being the weighted loss across the text, sentiment, and behavior tasks. The resulting teacher model not only generates text but also simultaneously simulates user emotional evolution and business decisions, forming a simulator that "thinks, feels, and acts."

[0018] However, the teacher model has a large number of parameters, making it unsuitable for high-concurrency real-time testing. Therefore, a lightweight student model needs to be designed. The encoder can use BERT-small (with approximately one-twentieth the number of parameters of the teacher model), and the decoder can use a single-layer Long Short-Term Memory (LSTM) network or a lightweight Transformer. Sentiment and behavior predictions are performed by reusing the encoder output and passing it through a lightweight fully connected layer. Before deployment, the model is converted to the Open Neural Exchange Format (ONNX), and 8-bit integer quantization (INT8) and operator fusion are performed to keep the single inference latency within 10 milliseconds. A single T4 graphics card can support more than 200 virtual users in parallel. At the same time, a lightweight adapter layer is reserved, so that only the adapter needs to be fine-tuned when switching business lines, while the main model remains unchanged.

[0019] To enable the student model to inherit the capabilities of the teacher model, multi-level knowledge distillation and adversarial training are employed. At the output layer, the student model fits the candidate response probability distribution (soft labels) output by the teacher model, learning response diversity by minimizing KL divergence. At the attention layer, the attention map of the teacher model's encoder is calculated, and the student model's attention map is trained to minimize its mean squared error, thus inheriting the focus on business-sensitive terms (such as rejection language). At the behavior layer, the sentiment and behavior probabilities predicted by the teacher model are used as soft labels, also passed to the student model's classification head using KL divergence. Furthermore, a challenge set is constructed, containing historically real scenarios that led to customer complaints (e.g., customer service continuing to respond mechanically after a user complains three times). Adversarial examples are generated by perturbing the customer service scripts in these scenarios with synonym substitutions, etc. These examples are then incorporated into the distillation training after the teacher model provides an ideal user response, giving the student model an "offensive" testing capability to proactively uncover vulnerabilities in the scripts.

[0020] After training, the student model is deployed to a high-concurrency scheduling engine. Upon test launch, thousands of independent virtual user instances are initialized in memory. Each instance holds its own user profile settings (injected into the model as system prompts), a complete dialogue history list, and an emotion state machine. The single-round interaction process is as follows: the engine concatenates the current response from the customer service system with the user instance's dialogue history to form an interaction context (Prompt), which is then fed into the student model. The model performs parallel inference, outputting the user's text response, current emotion state, and behavioral flags such as whether a human intervention is triggered or the dialogue ends. The engine updates the dialogue history and emotion state; if a human intervention is triggered, the session is terminated and recorded. Finally, the user's response is sent to the tested customer service system, and the next round begins after the system responds. By injecting corresponding prompts for different user profiles (such as "impatient"), the student model can generate responses that better match the profile characteristics, achieving comprehensive stress testing for all types of users.

[0021] During testing, the system automatically collects data and calculates multi-dimensional quantitative indicators. Task success rate is determined by whether the user expresses closing remarks such as "thank you" and their intention is "problem solved." The robustness score of the communication style is calculated by comparing the semantic cosine similarity between the customer service response and the standard answer; if the similarity is below the threshold for three consecutive rounds, it is considered a comprehension failure. The emotion guidance index converts user emotions into numerical values ​​(anger = -2, disappointment = -1, calm = 0, satisfaction = 1), and performs a linear fit across the entire process to obtain the slope; a larger positive slope indicates better positive emotion guidance. Risk sensitivity is calculated by statistically analyzing the percentage of times the mention rate of risk keywords decreases or emotions ease after the customer service response. All indicators are automatically collected by the testing engine's data points and aggregated in real-time through the columnar storage database ClickHouse, forming a fully data-driven, subjectively independent, three-dimensional evaluation matrix.

[0022] For dialogues that fail to meet the standards, the system automatically performs attribution and root cause localization. Backtracking analysis identifies the turning point where the emotional deterioration is greatest, and integral gradient attribution technology is used to analyze the student model's attention weight at that point, extracting key segments of the customer service script that caused the user's reaction to worsen. Then, based on a triplet template of "problem segment - cause - optimization suggestion," the system fine-tunes the large model or uses Retrieval Augmentation (RAG), taking the dialogue context, risky segments, and user emotional state as input, and outputting structured modification suggestions, including problem diagnosis and specific reference scripts. The system records whether the suggestions are adopted and implemented. The newly implemented scripts re-enter the testing process, and the generated data feeds back into the student model for fine-tuning, ensuring that the simulator and business scripts evolve synchronously, forming a closed loop of continuous optimization.

[0023] This embodiment trains a teacher model by extracting real dialogues and user profiles, and obtains a lightweight student model through multi-layer knowledge distillation and adversarial training. This drives dynamic interaction testing between high-concurrency virtual users and the customer service system, automatically generating multi-dimensional quantitative evaluation indicators, and attributing and locating the causes of failed conversations, outputting optimization suggestions. It achieves low-cost, highly realistic, and self-evolving automated testing of customer service scripts, improving testing efficiency by orders of magnitude and providing objective and quantitative evaluation.

[0024] In the healthcare field, customer service scripts involve sensitive scenarios such as patient consultations, appointment booking, drug information, medical insurance policies, and chronic disease management. Inappropriate scripts can easily lead to complaints or medical disputes. We extracted real doctor-patient dialogue data and patient profiles (age, medical history, membership level, etc.) from hospitals or internet healthcare platforms over the past six months to train a teacher model to learn the emotional evolution (e.g., anxiety, urgency, disappointment) and behavioral decisions (transfer to human agent, complain, end the conversation) of different patients under different conditions. A lightweight student model was used to concurrently simulate thousands of patients with different diseases, personalities, and medical experiences to dynamically stress test intelligent triage or human script templates. Evaluation indicators included task success rate (whether the patient's problem was resolved), emotional guidance index (whether patient anxiety was alleviated), and risk sensitivity (whether keywords such as "complaint" and "misdiagnosis" were promptly identified). Failed dialogues were attributed and optimized, generating suggestions such as changing the mechanical response "Please follow the procedure" to "I understand your condition; I will expedite your specialist consultation." After updating the scripts, the model was retested and incrementally fine-tuned to continuously improve the quality of doctor-patient dialogues and patient satisfaction.

[0025] In the fintech field, customer service representatives must handle high-compliance, high-risk conversations involving credit card applications, loan approvals, financial advice, account security, and fee disputes. Historical conversations and user profiles (asset level, number of past complaints, risk appetite, etc.) are extracted from financial customer service systems to train teacher models to understand user emotions and behavioral patterns when prompting, questioning, or complaining. Lightweight student models can simulate thousands of virtual users with varying investment experience, patience levels, and sensitivity to conduct large-scale concurrent testing of financial or debt collection scripts. Quantitative evaluation metrics include task success rate (whether the user completes the transaction), script robustness score (stability of responses to unexpected questions such as "Why are the returns lower than expected?"), and risk sensitivity (whether non-compliant expressions such as "guaranteed returns" or "concealing risks" are avoided). The system automatically identifies the root cause of non-compliant conversations; for example, if a "refusal to pay" statement triggers a user complaint, it generates a revised script such as, "I have recorded your request, and we will review it as soon as possible and give you a response according to the terms." After the new scripts were launched, they were retested and the model was fine-tuned using new data increments to form a self-evolving closed loop, effectively reducing regulatory risks and customer complaint rates, and improving the compliance and user trust of financial customer service.

[0026] In one embodiment, S100 includes: S101. Extract historical real dialogue data and related business metadata within a preset time period from the conversation archive database; S102. Input the first user message in the historical real dialogue data into the pre-trained text classification model and output the identity category; S103. Obtain key user information from the business system, and construct static profile tags based on the key user information and identity category; S104. Perform emotion recognition on each user message in historical real dialogue data using an emotion recognition model to obtain the emotion type; S105. Use the intent recognition model to identify the intent of each user message in the historical real dialogue data to obtain the intent type; S106. Extract hard behavior tags from system logs and correlate them with satisfaction scores from user-submitted evaluation data. S107. Construct dynamic behavior tags based on the emotion type, intention type, hard behavior tags, and satisfaction scores; S108. Generate training samples based on historical real dialogue data, related business metadata, static profile tags, and dynamic behavior tags.

[0027] In this embodiment, the system connects to the customer service system's session archive database via an application programming interface (API) to extract real conversation records within a preset time period (the most recent six months). Simultaneously, it obtains business metadata associated with each conversation, such as user ID, conversation time, customer service ID, and business type. This data will be used for subsequent tag construction and model training.

[0028] For the extracted historical real-world dialogue data, the first user message from each dialogue is extracted and input into a pre-trained text classification model. This model can identify the user's identity category, such as determining whether the user is a "new user," "experienced user," or "insider." This classification result helps to understand the user's initial behavioral tendencies and level of expertise.

[0029] Simultaneously, key user information fields, including age, membership level, and number of historical complaints, are directly retrieved from the user table in the business system. This structured information is combined with the identity categories identified earlier through the model to construct static user profile tags. These static profile tags describe the user's inherent and relatively stable attributes, providing a foundation for subsequently simulating differentiated responses from different user groups to customer service scripts.

[0030] While building static profiles, it's also necessary to create dynamic behavioral tags for each user message in the conversation. Specifically, for each user message, firstly, an emotion recognition model is used to identify the corresponding emotion type, such as "calm," "anxious," "angry," or "disappointed." Then, an intent recognition model is used to classify the intent of the same message, outputting the intent type, such as "inquiry," "complaint," "negotiation," or "urging." Both models typically use pre-trained deep learning models and are fine-tuned on customer service dialogue data to ensure accuracy.

[0031] Beyond the emotions and intentions conveyed at the text level, it's also necessary to extract hard behavior tags from system logs. Hard behavior tags refer to the recordable actions a user takes during a conversation, such as whether they transferred the call to a human agent, whether they proactively ended the conversation, or whether they submitted a work order. These actions can be directly parsed from the customer service system's operation logs. Additionally, user-submitted feedback data (such as satisfaction ratings) is also linked to the corresponding conversation, serving as an important indicator of the overall effectiveness of the dialogue.

[0032] By integrating the obtained emotion types, intent types, hard behavior labels, and satisfaction scores, dynamic behavior labels are formed for each user message or each round of dialogue. These dynamic behavior labels depict the user's real-time state changes and behavioral responses during the dialogue process, serving as key supervisory signals for subsequent training of a highly realistic user simulator.

[0033] Finally, structured training samples are generated based on the complete content of historical real dialogues, associated business metadata, and static profile tags and dynamic behavior tags constructed for each dialogue. Each training sample typically contains a mapping relationship such as "dialogue context + current customer service response → user's next response + emotional change + behavioral action". This sample structure enables the model to learn: given a user profile, historical dialogue background, and the latest customer service response, how the user will respond, how their emotions will evolve, and whether key business actions such as transferring to a human agent will be triggered.

[0034] This embodiment extracts historical dialogues and business metadata from the conversation archive. Utilizing text classification, emotion recognition, intent recognition models, system logs, and evaluation data, it constructs static user profile tags and dynamic behavior tags, ultimately generating multi-dimensional training samples containing dialogue context, user profiles, emotions, intents, and behaviors. This data construction method provides rich and structured supervision signals for subsequent highly realistic virtual user simulations, enabling the model to learn the differentiated responses of different user profiles to the same script, significantly improving the realism and effectiveness of customer service script testing.

[0035] In the healthcare field, patient consultations are often accompanied by complex emotions such as anxiety, urgency, and even fear. Inappropriate wording can lead to complaints or doctor-patient conflicts. This study extracts nearly six months of historical doctor-patient dialogue records and related business metadata (such as patient age, medical history, membership level, and department visited) from internet hospitals or online consultation platforms. The first patient message in each dialogue is input into a pre-trained text classification model to identify the patient's identity category (first-time visitor, follow-up visitor, family member consulting on behalf of another, etc.). Static profile tags are constructed by combining these with fields such as age and number of historical complaints from the business system. Subsequently, an emotion recognition model is used to classify each patient message by emotion (anxiety, impatience, disappointment, calmness), and an intent recognition model is used to label the intent type (consulting about symptoms, inquiring about medication, complaining about long waiting times, requesting referral to a specialist, etc.). Hard behavior tags (whether to transfer to human agent, whether to end the dialogue, whether to submit a complaint ticket) are extracted from system logs and linked to the patient's post-consultation satisfaction rating. These emotions, intents, hard behaviors, and satisfaction are integrated into dynamic behavior tags, which, along with the original dialogue text and metadata, generate training samples. These samples can depict real-world scenarios such as "the escalating anxiety of elderly patients with chronic diseases while waiting for a response," laying a data foundation for subsequent training of virtual patient simulators. This enables comprehensive automated testing of medical customer service scripts, improving service quality and patient satisfaction.

[0036] In the fintech field, customer service representatives must handle highly sensitive conversations involving loan approvals, financial advice, fee disputes, and account security. These conversations are characterized by significant user emotional fluctuations and stringent compliance requirements. Historical dialogues and business metadata, including user asset levels, number of past complaints, and product holdings, are extracted from the financial customer service system. The first user message in the dialogue is input into a text classification model, which outputs the user's identity category (novice investor, experienced customer, internal tester, etc.). This is then combined with business data to construct static profile tags. Subsequently, an emotion recognition model is used to label the emotional state of each user message (anxious, questioning, angry, calm), and an intent recognition model is used to classify intent (complaining about interest rates, urging loan disbursement, requesting explanations of terms, inquiring about regulatory risks, etc.). Hard behavior tags (whether to transfer to human agent, whether to submit a regulatory complaint, whether to end the conversation prematurely) are extracted from system logs and correlated with user satisfaction scores. These multi-dimensional tags are combined into dynamic behavior tags and used with dialogue history to generate training samples. For example, a sample could present the complete chain of a high-net-worth user's emotions shifting from calm to questioning due to lower-than-expected investment returns, ultimately leading to a complaint. These data samples enable the virtual user simulator to learn the reaction patterns of users with different asset levels and patience levels to financial statements. They can then be used for large-scale automated testing to evaluate the compliance, risk mitigation capabilities, and customer satisfaction of the statements, effectively reducing customer complaint rates and regulatory penalties for financial institutions.

[0037] In one embodiment, S200 includes: S201. Configure the text generation module, sentiment prediction module, and behavior prediction module in the large language model; S202. Use the input samples of the training samples as conditional information and the output samples of the training samples as supervision information; S203. Input the conditional information and the supervision information into the configured large language model, and train the text generation module, the sentiment prediction module and the behavior prediction module through the conditional information and the supervision information; S204. Fine-tune the trained large language model using a fine-tuning strategy to generate a teacher model.

[0038] In this embodiment, during the configuration of the large language model, three parallel task modules need to be added to the model simultaneously: a text generation module, a sentiment prediction module, and a behavior prediction module. The text generation module typically employs an autoregressive generation approach, predicting the user's next response word by word based on the existing dialogue context and customer service replies. Its training objective is the cross-entropy loss function, used to measure the difference between the predicted word sequence and the actual user response. The sentiment prediction module, above the last hidden state of the large language model, connects a fully connected layer (i.e., a linear transformation layer) to perform a multi-classification task, outputting the user's sentiment category in the next round of dialogue, such as changing from calm to anger. Common categories include calm, impatient, angry, and disappointed. The behavior prediction module, also based on the last hidden state, uses another fully connected layer to predict whether the user will perform a key business action, such as transferring to human assistance, filing a complaint, or ending the conversation prematurely.

[0039] After completing the module configuration, the model is trained using the previously constructed training samples. Each training sample consists of two parts: an input sample and an output sample. The input sample serves as conditional information, including the complete dialogue history, the customer service representative's current response, and the user's static profile tags (such as age, membership level, and identity category) and current emotional state. The output sample serves as supervision information, corresponding to the actual user's next response text, the next emotional type, and the actual action label. During training, the conditional information is input into the configured large language model. Based on the conditional information, the model generates prediction results through three modules: the text generation module outputs the predicted user response, the emotion prediction module outputs the predicted emotion category, and the behavior prediction module outputs the predicted behavior label. Then, these three prediction results are compared with the corresponding real output samples (i.e., supervision information) to calculate the loss. The total loss function is a weighted sum of the losses from the three tasks; for example, the text generation loss weight is 1, the emotion prediction loss weight is 0.5, and the behavior prediction loss weight is 0.3. The model parameters are continuously adjusted through the backpropagation algorithm, enabling the model to simultaneously learn to generate reasonable user responses, accurately predict emotional evolution, and judge the user's next key behavior.

[0040] After training, to achieve better performance and avoid overfitting with limited computing resources, a fine-tuning strategy is employed to adjust the model's parameters. Specifically, Low-Rank Adaptation (LoRA) is used. The core idea is to add two low-rank matrices (usually set to 16) next to the weight matrix of the original large language model. During training, only the parameters of these low-rank matrices are updated, while the core parameters of the original model are frozen. This significantly reduces the number of parameters that need to be trained, lowers memory usage, and allows the model to quickly adapt to the specific distribution of customer service dialogue scenarios. The large language model obtained after this fine-tuning is called the "teacher model." This teacher model can not only generate fluent natural language responses but also simultaneously output emotional changes and business behavior decisions, becoming a highly realistic user simulator with the ability to "think, feel, and act."

[0041] This embodiment configures three modules—text generation, sentiment prediction, and behavior prediction—in parallel on a large language model. Multi-task training is performed using dialogue context and user profiles as conditions, and real user responses and behaviors as supervision. The teacher model is then fine-tuned using low-rank adaptation (LoRA). This teacher model can simultaneously simulate users' language expression, emotional evolution, and key business decisions, providing high-fidelity behavioral examples for subsequent lightweight student models, significantly improving the realism of virtual users and business consistency.

[0042] In the healthcare field, when training a teacher model using the above method, patient messages, emotional states (anxiety, urgency, disappointment), and behaviors (transfer to specialist, complaint, end of consultation) from historical doctor-patient dialogues can be used as monitoring signals. Given a patient profile (e.g., a patient with chronic disease, a first-time visitor) and a customer service response, the model learns to simultaneously generate the patient's next response, predict emotional evolution (e.g., from anxiety to anger), and key behaviors (requesting a human intervention). This teacher model can provide high-quality soft labels for subsequent lightweight student models, enabling them to simulate the complex psychological changes of real patients even under high-pressure testing. This allows for accurate assessment of the safety and soothing effect of medical communication techniques, reducing doctor-patient disputes.

[0043] In the fintech field, the training of the teacher model can integrate user complaint records, rate dispute dialogues, and satisfaction scores. The model receives user profiles (asset level, risk preference) and customer service scripts, while simultaneously outputting user text responses, emotion categories (questioning, anger, calm), and behavioral markers (complaining to regulatory authorities, ending the conversation prematurely). Through fine-tuning, the teacher model masters typical user reaction patterns to sensitive phrases such as "refusal to pay compensation" and "interest rate adjustments" in financial scenarios. This model provides emotion-behavioral joint soft tags for the distillation student model, ensuring that virtual users in subsequent high-concurrency tests can both reasonably question and trigger compliance risk points, helping financial institutions identify script loopholes in advance and reduce regulatory penalties and customer complaint risks.

[0044] In one embodiment, S300 includes: S301. Load the trained teacher model and training samples into the knowledge distillation container, and initialize the encoder-decoder architecture as the student model. S302. Distillation training is performed through a multi-level knowledge distillation module. During the distillation training process, the output differences between the teacher model and the student model at each level are extracted, and the differences are compared layer by layer to obtain the comparison results. S303. Adjust the network parameters of the student model according to the comparison results, and at the same time input the static portrait labels in the training samples as conditional prompts into the student model until the difference between the output of the student model at each level and the teacher model converges. S304. Generate an adversarial sample dataset based on the customer complaint scenario and load it into the adversarial training container; S305. During the execution of the adversarial training module, the customer service scripts in the adversarial samples are input into the teacher model to obtain the ideal user response. S306. Input the ideal user response into the student model and adjust the parameters to obtain the student model.

[0045] In this embodiment, after training the teacher model, its capabilities need to be transferred to a lighter student model suitable for high-concurrency inference. First, the trained teacher model and the previously constructed training samples are loaded into a knowledge distillation container, and an encoder-decoder architecture is initialized as the student model. The student model's encoder uses a lightweight BERT-small (approximately one-thirtieth the number of parameters of the teacher model) to understand customer service scripts and dialogue history; the decoder uses a single-layer long short-term memory network or a lightweight Transformer to generate user response text; sentiment and behavior prediction reuse the encoder's output, implemented through a lightweight fully connected layer.

[0046] Next, distillation training is performed using a multi-level knowledge distillation module. In this process, for the same input sample (including dialogue history, customer service responses, and user profiles), both the teacher model and the student model generate outputs simultaneously, and then the differences between the two are extracted and compared layer by layer. Specifically, this includes three levels: The first step is output layer distillation. The teacher model generates a probability distribution for the input, representing the Top-K candidate responses it deems reasonable and their probabilities (i.e., soft labels). The student model fits the teacher model's output by minimizing the KL divergence (a metric for measuring the difference between two distributions), thereby learning the diversity and reasonableness of user responses.

[0047] The second aspect is attention transfer. The average weight map of the last layer of the teacher model's encoder, multi-head attention, is extracted. This map reflects the teacher model's attention to words in different positions when generating responses, especially to business-sensitive words (such as rejection language and complex terminology). The student model also calculates its own attention map, and then the mean squared error loss between the two is calculated. This forces the student model to invest equal attention in the same keywords, thereby inheriting the teacher model's ability to perceive "verbal pitfalls."

[0048] Thirdly, there is behavioral-level distillation. The emotion category probability vector and behavior category probability vector predicted by the teacher model are also used as soft labels, which are transmitted to the corresponding classification heads of the student model through KL divergence loss, ensuring that the student model is consistent with the teacher model in terms of emotion evolution and behavioral decision-making logic.

[0049] In each distillation iteration, a comprehensive loss is calculated based on the differences across multiple levels (output layer KL divergence, attention MSE loss, and emotion and behavior KL divergence), and then backpropagation is used to adjust the network parameters of the student model. Simultaneously, during training, static profile labels from the training samples (e.g., user age, membership level, identity category, etc.) are input as condition prompts into the student model's encoder, enabling the student model to learn to generate differentiated responses based on different user profiles. This process is repeated until the difference between the student model's output at each level and the teacher model converges to below a preset threshold.

[0050] In addition to conventional distillation, adversarial training is needed to enhance the student model's ability to proactively identify vulnerabilities in customer service communication. First, real scenarios that lead to user dissatisfaction are collected from historical customer complaint data, such as "customer service continuing to respond mechanically after a user complains three times," forming a challenge set. Then, the customer service communication in these scenarios is perturbed by operations such as synonym replacement, adding redundant modifiers, and changing sentence order, generating an adversarial example dataset. These adversarial examples are then loaded into an adversarial training container.

[0051] During adversarial training, for each adversarial sample (i.e., the perturbed customer service script), it is input into the teacher model along with the corresponding dialogue history. The teacher model outputs the expected reaction of the "ideal user" under such adverse conditions, including reasonable user response text, emotional changes, and behavioral actions. Due to its larger parameter set and greater capabilities, the teacher model can provide reasonable and self-consistent user simulation results. Subsequently, this ideal user reaction is used as a supervisory signal and input into the student model for parameter adjustment, enabling the student model to learn that even when faced with aggressive or abnormally expressed customer service scripts, it can simulate the reactions of a real user. Through this targeted reinforcement, the student model gains the ability to proactively discover the "weaknesses" of customer service scripts, transforming it from a simple passive verifier in subsequent testing into an "offensive" testing tool that actively uncovers script vulnerabilities. Finally, the student model obtained after multi-level distillation and adversarial training becomes a lightweight virtual user simulator that can be used for high-concurrency, low-latency dynamic testing.

[0052] This embodiment transfers the capabilities of the teacher model to a lightweight student model through multi-level knowledge distillation (output layer, attention layer, and behavior layer). Combined with adversarial training oriented towards customer complaint scenarios, the student model inherits the teacher's accurate simulation of emotional evolution and risk perception. The resulting student model combines high realism with low inference latency, supports high-concurrency dynamic testing, and proactively uncovers vulnerabilities in communication techniques.

[0053] In the healthcare field, a trained teacher model (capable of simulating patient emotions and behaviors) and doctor-patient dialogue samples are loaded into a distillation container to initialize a lightweight encoder-decoder student model. Through multi-level distillation, the student model learns the teacher's attention distribution regarding key behaviors such as escalating patient anxiety and a tendency to complain. Simultaneously, adversarial examples are generated for real-world customer complaint scenarios such as "excessive waiting time" and "doubts about misdiagnosis." The teacher outputs ideal patient responses (such as conditional statements transitioning from anger to calm), which are then used to adjust the student model's parameters. Ultimately, the student model can concurrently simulate thousands of virtual patients with different conditions and personalities with low latency, stress-testing online consultation scripts, proactively identifying risk points where reassurance fails or conflicts escalate, and improving the quality of healthcare services.

[0054] In the fintech field, a teacher model integrating user complaint records and regulatory feedback, along with training samples, is loaded into a distillation vessel to initialize a lightweight student model. Through attention transfer, the student model inherits the teacher's sensitivity to high-risk statements such as "refusal to pay" and "illegal promises." During the adversarial training phase, adversarial samples are constructed based on historical customer complaints such as "interest rate disputes" and "overly aggressive collection." The teacher model first generates ideal user responses (e.g., shifting from complaint to rational negotiation) and then guides the student model's learning. Ultimately, the student model can drive a massive number of virtual users to concurrently test financial management or collection techniques, accurately identifying weaknesses that could trigger regulatory complaints. This ensures compliance while improving customer satisfaction and significantly reducing operational risks for financial institutions.

[0055] In one embodiment, S400 includes: S401. Initialize several virtual user instances in the memory of the scheduling engine; S402. The current response of the customer service system under test is combined with the historical dialogue of the virtual user instance to form an interaction context through the scheduling engine; S403. Input the interaction context into the student model for parallel reasoning, and output the user's reply text, user's emotional state, and behavior trigger flags. S404. Update the historical dialogue and emotional state of the corresponding virtual user instance based on the user's reply text, user's emotional state and behavior trigger flag. S405. Generate a dynamic interactive test result sequence based on the user's response text, user emotional state, and behavioral trigger flags output in each round of interaction.

[0056] In this embodiment, several virtual user instances are initialized in the scheduling engine's memory. Each instance independently holds its own profile settings, a complete list of dialogue history, and an emotion state machine. The profile settings typically exist in the form of system prompts, such as injecting a prompt for an "impatient" user: "You are an impatient customer who dislikes waiting and complicated explanations; you want a straightforward solution." These prompts are fixedly appended to the beginning of the input sequence during inference, thereby guiding the student model to generate user behaviors that match the profile. Each virtual user instance also maintains all historical messages from the start of the dialogue to the current moment, as well as a numerical or categorical variable representing the current emotional state (such as calm, impatient, angry, etc.).

[0057] Once the customer service system under test returns its current response, the scheduling engine concatenates this response with the dialogue history saved in the corresponding virtual user instance to form a complete interaction context. This context is typically organized in the order of "system prompt + historical dialogue turn (user's previous sentence, customer service's previous sentence, etc.) + customer service's current response," and serves as the input to the student model.

[0058] Subsequently, the scheduling engine groups the interaction contexts of multiple virtual user instances into a batch and feeds them into the student model in parallel for inference. The student model adopts a lightweight encoder-decoder architecture, supporting high-throughput forward computation. After parallel inference, the model outputs three parts for each instance: the user's response text (natural language sentence), the user's emotional state (e.g., the output is a probability distribution of emotional categories, taking the category corresponding to the maximum value, such as "anger"), and a behavior trigger flag (one or more boolean values, indicating whether key actions such as "transfer to human agent", "end conversation", or "submit work order" are triggered).

[0059] After receiving the output, the scheduling engine updates the state of the corresponding virtual user instance based on these three results. The specific operations include: appending the newly generated user reply text to the end of the instance's dialogue history list; replacing the current emotional state saved in the instance with the newly output user emotional state; if the behavior trigger flag indicates "transfer to human" or "end dialogue", then the instance is marked as terminated and will no longer participate in subsequent rounds, and its termination reason is recorded (such as transfer to human, user-initiated termination, etc.).

[0060] Throughout the dialogue test, each round of interaction generates a set of outputs: user response text, changes in emotional state, and behavioral triggers. The scheduling engine organizes these outputs into a dynamic interactive test result sequence in chronological order. This sequence not only includes the complete dialogue text record but also preserves the evolution trajectory of the user's emotional state in each turn and the timing of key business actions. By analyzing this result sequence, the performance of customer service scripts under different user profiles and different emotional stages can be evaluated, such as calculating quantitative indicators like the conversion rate to human intervention, the inflection point of emotional deterioration, and task success or failure. This dynamic multi-round concurrent testing method allows virtual users to adjust their state in real time as the dialogue progresses, just like real users, forming a realistic game with the customer service system, thereby covering a large number of user types and dialogue paths in a short period of time.

[0061] This embodiment initializes a large number of virtual user instances in the scheduling engine's memory. Each instance holds an independent profile, dialogue history, and emotional state. The responses from the customer service representative under test are concatenated with the history and input into a lightweight student model for parallel inference. The model outputs user text, emotion, and behavioral markers, dynamically updates the instance states, and finally generates a complete sequence of interaction test results. This achieves high concurrency, low latency, multi-turn dynamic dialogue testing, realistically simulating the evolution of user emotions and changes in decision-making.

[0062] In the healthcare field, thousands of virtual patient instances are initialized in the scheduling engine. Each instance is infused with a profile of different conditions (chronic or acute), age, and medical history. When the online consultation or intelligent triage system returns a customer service response, the engine concatenates the response with the instance's historical dialogue, feeds it into a student model for parallel reasoning, and outputs the virtual patient's next response, emotional state (e.g., anxiety turning into anger), and behavioral markers (whether to request a transfer to a live doctor or to file a complaint). The system updates the patient's emotions and history in real time, continuing interaction until the dialogue ends. By analyzing the dynamic test result sequence, it is possible to identify which phrases are likely to cause patient emotional distress or complaints, thereby optimizing medical communication in advance, improving patient satisfaction, and reducing the risk of doctor-patient disputes.

[0063] In the fintech field, tens of thousands of virtual user instances are initialized in the scheduling engine. Each instance is configured with a profile including asset level, risk preference, and historical complaint count. When the wealth management or debt collection customer service system returns a response, the engine concatenates the response with the user's history, inputs it in parallel into the student model, and batches out the user's text, emotional state (questioning, anger, calm), and behavioral markers (whether to transfer to human agent, whether to complain to regulatory authorities). The system dynamically updates the status of each instance, generating a large-scale multi-turn dialogue sequence. The test results can quantitatively assess the compliance and risk mitigation capabilities of the communication scripts. For example, if a certain type of communication script frequently triggers "complaint" behavior, the problem can be located and modified. This solution significantly improves the coverage and efficiency of financial communication script stress testing and effectively reduces regulatory risks.

[0064] In one embodiment, S500 includes: S501. Analyze the target sessions that meet the business success conditions in the sequence of dynamic interactive test results, and generate a task success rate based on the target sessions. S502. Calculate the robustness score of the sales script based on the semantic similarity between the non-standard responses and standard answers output by the customer service system under test. S503. The user's emotional state in the dynamic interactive test result sequence is labeled to obtain emotional label values; S504. Perform linear fitting on the emotion label values ​​to obtain the emotion guidance index; S505. Analyze the user's reply text, identify risk keywords, and calculate the risk sensitivity based on the risk keywords; S506. Generate a multi-dimensional quantitative evaluation index sequence based on the task success rate, speech robustness score, emotion guidance index, and risk sensitivity.

[0065] In this embodiment, after completing the dynamic interactive test, the test results need to be quantitatively evaluated from multiple dimensions. First, the number of sessions that meet the business success conditions in all test sessions is counted, and the task success rate is calculated. The business success conditions need to be predefined according to the specific business scenario. Common rules include: the user expresses a clear positive closing remark at the end of the conversation (e.g., "thank you," "problem solved"), and the user's intent recognition result is in the "problem solved" category; or the user does not trigger negative behaviors such as transferring to human assistance, filing a complaint, or ending the conversation prematurely. The number of sessions that meet this condition is counted, and divided by the total number of test sessions, the task success rate is obtained. This indicator reflects the effectiveness of customer service scripts in helping users achieve their goals.

[0066] Secondly, a robustness score is calculated to measure the customer service script's ability to reliably respond to non-standard, intention-shifting, or adversarial inputs. In practice, for unexpected questions or inputs containing adversarial examples from users during testing, the actual response from the tested customer service system and the ideal answer pre-stored in the standard knowledge base are both vectorized (e.g., using a pre-trained sentence encoder like Sentence-BERT), and the semantic vector cosine similarity between the two is calculated. The similarity value ranges from 0 to 1, with values ​​closer to 1 indicating a closer resemblance to the standard answer. A similarity threshold (e.g., 0.7) is set; if the similarity between the customer service response and the standard answer is below this threshold for three consecutive rounds of non-standard questions, it is considered a "comprehension failure." The robustness score is calculated as: 1 minus (number of comprehension failures divided by the total number of non-standard questions). A higher score indicates that the customer service script maintains a reasonable and accurate response capability when faced with various user inputs that deviate from expectations.

[0067] The Emotion Guidance Index quantifies the positive or negative impact of customer service scripts on user emotions during a conversation. First, the user's emotional state in each round of the dynamic interactive test result sequence is labeled with numerical values: anger is assigned -2, disappointment -1, calm 0, and satisfaction 1. After obtaining the emotional label value for each round, a linear fit is performed with the conversation round number as the x-axis and the emotional label value as the y-axis, and the slope of the fitted line is calculated. This slope is the Emotion Guidance Index: a positive and larger slope indicates that the customer service script can gradually guide the user's emotions from negative to positive; a negative slope indicates that the script causes the user's emotions to worsen. This index objectively assesses the emotional management ability of customer service scripts from the perspective of emotional evolution trends.

[0068] Risk sensitivity is used to measure whether customer service scripts can effectively resolve conflicts in high-risk scenarios. First, risk keywords are detected in user responses, such as identifying sensitive words like "complaint," "exposure," "315" (China's consumer rights day), "media," and "law." When these risk keywords appear in a round of user messages, it's recorded as a high-risk trigger. Then, the user's emotional state and response content are observed in the next round after the customer service response: if the mention rate of risk keywords in the next round of user messages decreases (i.e., they no longer appear or decrease significantly), or if the user's emotional state changes from anger and disappointment to calm, it's recorded as an "effective interception." The risk sensitivity calculation formula is: number of effective interceptions divided by the total number of high-risk triggers. This indicator reflects the customer service script's ability to promptly soothe and resolve risks when faced with intense user emotions or threats of complaints.

[0069] Finally, the calculated task success rate, script robustness score, emotion guidance index, and risk sensitivity are aggregated to generate a multi-dimensional quantitative evaluation indicator sequence. These indicators collect data in real time through the automatic data collection mechanism in the testing engine and are aggregated and calculated using columnar databases such as ClickHouse, ultimately outputting a structured evaluation report. This evaluation sequence is entirely data-driven, avoiding the bias of subjective reviews, enabling objective comparison and trend tracking of customer service script quality, and providing strict factory quality standards for subsequent script iterations.

[0070] This embodiment uses dynamic interaction test results to statistically analyze business success rate, calculate script robustness score, emotion guidance index, and risk sensitivity, forming a multi-dimensional quantitative evaluation indicator sequence. Completely data-driven and unaffected by subjective factors, it transforms script quality from qualitative judgment to precise quantification, providing objective and reproducible factory quality standards for the iterative optimization of customer service scripts.

[0071] In the healthcare field, the dynamic dialogue results between virtual patients and customer service systems are quantitatively evaluated. First, the percentage of successful sessions that resolve patient inquiries or complete appointments is statistically analyzed to obtain the task success rate. Then, the semantic similarity between the customer service response and a standard medical knowledge base is calculated when a patient provides unexpected symptom descriptions, assessing the robustness of the communication. Patient emotions (anxiety, calmness, anger) are mapped to numerical values, and a linear fit yields an emotion guidance index, reflecting the effectiveness of the communication in alleviating patient anxiety. Risk keywords such as "complaint," "misdiagnosis," and "exposure" in patient responses are detected, calculating risk sensitivity. By combining these indicators, the safety and reassurance effect of medical communication can be automatically assessed, avoiding subjective review bias and helping medical institutions continuously improve service quality.

[0072] In the fintech field, multi-dimensional quantitative evaluations are conducted on dialogues between virtual users and wealth management or debt collection customer service representatives. Task success rate measures whether the user ultimately completes the transaction or reaches a settlement. Robustness scoring of the communication script checks the semantic consistency between customer service responses and compliant standard answers when users question "Why did the returns decrease?" or "Why was compensation refused?". Emotional guidance index tracks the evolution of user behavior from questioning to anger or calm. Risk sensitivity identifies keywords such as "regulatory complaints," "315" (China's consumer rights day), and "lawsuit," and assesses whether the communication script can effectively mitigate risk. All indicators are automatically collected and aggregated by an engine to generate quantitative reports. Financial institutions can use this data to strictly control the compliance of their communication scripts, reduce regulatory penalties and customer complaint risks, and achieve data-driven quality control.

[0073] In one embodiment, S600 includes: S601. Based on the multi-dimensional quantitative evaluation index sequence, perform a retrospective analysis on the non-compliant sessions to generate root cause inflection points for failed conversations. S602. Using integral gradient attribution technique, analyze the change in attention weight of the student model at the root cause inflection point of the failed dialogue; S603. Extract key segments of customer service scripts at the root cause inflection point of failed dialogues based on the changes in attention weights, and generate a root cause localization sequence for failed dialogues. S604. Generate an optimized modification scheme based on the failed dialogue root cause inflection point and failed dialogue root cause localization sequence. S605. The customer service script is revised by optimizing the modification scheme; S606. Re-execute the dynamic interaction test on the revised customer service script, and make incremental fine-tuning of the student model based on the generated test data.

[0074] In this embodiment, based on a multi-dimensional quantitative evaluation index sequence, it is possible to identify which sessions fail to meet preset business standards (e.g., task success rate below a threshold, negative emotion guidance index, or excessively low risk sensitivity). Backtracking analysis is performed on these substandard sessions, examining changes in the user's emotional state and behavioral triggers round by round from the last round of the conversation backward to identify the key turning point leading to ultimate failure. Specifically, this involves scanning the entire conversation's emotion tag value sequence to locate the turn where the emotion value drops most significantly or where negative behavior (such as switching to human intervention or mentioning complaint keywords) first appears. The interaction point between the user message and the customer service response in that turn is considered the root cause turning point of the failed conversation. This turning point signifies that the customer service script failed to effectively address the user's needs or emotions, leading to the subsequent conversation's failure.

[0075] After identifying the inflection point, integral gradient attribution technique is used to analyze the internal attention mechanism of the student model at this inflection point. Integral gradients are an interpretability method for attribution in deep neural networks. Their core idea is to quantify the contribution of each input feature to the model output by calculating the path integral of the input feature from a baseline value (such as an all-zero vector) to the actual input value. In practice, the interaction context at the inflection point (including dialogue history, current customer service response, and user profile) is used as input, and the user response text, sentiment prediction, or behavior prediction output by the student model is used as the target output. The integral gradient value of each token in the input sequence relative to the target output is calculated, and then summed to obtain the attribution score for each token. The focus is on the changes in multi-head attention weights in the student model's encoder: the sum of attention weights corresponding to each word in the customer service script segment under the input at the inflection point is extracted, and compared with the model's attention distribution in normal dialogue to identify locations where weights significantly increase or decrease. Words with significantly increased weights are often key triggers leading to negative user reactions, while words with significantly decreased weights may be important information ignored by the model.

[0076] Based on the aforementioned changes in attention weight, specific words or phrases that lead to a worsening user response are extracted from key segments of customer service scripts. These include mechanical expressions or evasive phrases such as "unable to meet" or "following regulations." These extracted key segments are then arranged in the order they appear in the script to form a root cause localization sequence for failed conversations. This sequence precisely identifies which part, sentence, or words in the customer service script triggered user dissatisfaction, emotional deterioration, or complaint behavior.

[0077] Next, by combining the root cause turning points and root cause localization sequences of failed conversations, an optimization and modification plan is generated. Specifically, using "conversation context + risk fragment + user emotional state" as input, a pre-tuned large language model or a Retrieval-Augmented Generation (RAG) system is invoked. This model, based on a library of historical high-quality dialogue examples and a "problem fragment-cause-optimization suggestion" triple template, outputs structured optimization suggestions. The output typically includes a problem diagnosis (e.g., "The customer service representative used the rejection phrase 'We can't do this' in the 5th round, which angered the user") and specific suggested modification scripts (e.g., changing "We can't do this" to "I understand your request; let me check if there are other solutions for you"). This optimization plan can be directly implemented.

[0078] After obtaining the optimized and modified plan, the original customer service scripts were revised. Revisions could be made by human quality inspectors adopting suggestions and modifying the script template, or by using automated scripts to directly replace the target segment. The revised script version was then redeployed to the customer service system under test.

[0079] Finally, the revised and deployed new dialogue is re-tested using dynamic interaction, meaning it undergoes multiple rounds of concurrent dialogue with virtual user instances again via the scheduling engine. Data generated from the new tests (including user responses, emotional evolution, and behavioral triggers) is collected along with the old data. This new data is then used to incrementally fine-tune the student model. Incremental fine-tuning refers to iteratively training the already trained student model using only the newly generated dialogue data, typically with a low learning rate and small batch size to avoid catastrophic forgetting. Through this closed-loop feedback mechanism, the student model learns the real-world user reaction patterns after the dialogue updates, allowing the simulator to evolve synchronously with the business dialogue, maintaining high realism and avoiding the "deployment-and-obsolescence" problem of traditional static tools, thus achieving continuous self-optimization of the testing system.

[0080] This embodiment performs backtracking analysis on substandard conversations to pinpoint the root cause inflection point. It utilizes integral gradient attribution technology to extract changes in the student model's attention weights, identifies key problematic segments in the customer service script, generates optimization and modification plans, corrects the script, and incrementally fine-tunes the student model after retesting. This forms a closed loop of "defect discovery → cause localization → automatic repair → continuous evolution," significantly improving script quality and the test system's adaptability.

[0081] In the healthcare field, when the test results of virtual patients and consultation scripts show a negative emotion guidance index or an excessive complaint rate, the system automatically revisits the dialogue to pinpoint the turning point where the patient's emotions escalate from anxiety to anger. Using integral gradient technology, the system analyzes the student model's attention weight at that point, extracting keywords or phrases in the customer service script that trigger dissatisfaction, such as "Please wait according to the procedure," which leads to patient disappointment. Based on this, the system generates optimization suggestions, such as changing it to "I understand you are anxious, I will expedite your processing immediately." The revised script is redeployed, driving virtual patient testing again, and the student model is fine-tuned using newly generated dialogue data. Through this closed loop, the intelligent consultation scripts of medical institutions can continuously self-optimize, effectively alleviating patient anxiety and reducing complaint rates.

[0082] In the fintech field, when virtual user testing reveals that a certain financial communication script has excessively low risk sensitivity, frequently triggering "complaints to regulatory authorities" behavior, the system automatically retraces the conversation to pinpoint the turning point where customer service responses first use evasive statements such as "cannot meet" in response to avoid responsibility. Using integral gradient attribution analysis of the student model's attention distribution, the system precisely extracts phrases that escalate user emotions, such as "This is company policy and cannot be changed." The system then generates modified scripts based on a compliance knowledge base, such as "I have recorded your request and will submit it to a senior specialist to advocate for your rights." After the new script is launched, it is retested, and the student model is incrementally fine-tuned using test data. This closed loop allows financial communication scripts to both mitigate regulatory risks and effectively resolve user dissatisfaction, achieving a dual evolution in compliance and user experience.

[0083] In one embodiment, a customer service script testing device is provided, which corresponds one-to-one with the customer service script testing methods described in the above embodiments. (Refer to...) Figure 3 , Figure 3 This is a schematic diagram of the functional modules of a preferred embodiment of the customer service script testing device of the present invention. The modules include a training sample construction module 10, a teacher model training module 20, a distillation adversarial training module 30, a dynamic interaction testing module 40, a multi-dimensional evaluation index module 50, and a script optimization and correction module 60. Detailed descriptions of each functional module are as follows: The training sample construction module 10 is used to acquire historical real dialogue data and related business metadata, and to annotate the historical real dialogue data and the related business metadata to generate training samples. The teacher model training module 20 is used to input the training samples into the large language model for training to obtain the teacher model. Distillation adversarial training module 30 is used to perform multi-layer knowledge distillation and adversarial training on the student model based on the teacher model and training samples; The dynamic interaction test module 40 is used to drive the trained student model to conduct dynamic interaction tests with the customer service system under test through virtual user instances, and generate a dynamic interactive test result sequence. The multidimensional evaluation index module 50 is used to evaluate the customer service scripts of the tested customer service system through a dynamic interactive test result sequence, and obtain a multidimensional quantitative evaluation index sequence. The script optimization and correction module 60 is used to automatically attribute and locate the root causes of substandard conversations based on the multi-dimensional quantitative evaluation index sequence, generate optimization and modification plans, and correct customer service scripts according to the optimization and modification plans to complete customer service script testing.

[0084] In one embodiment, the training sample construction module 10 includes: Extract historical real-time dialogue data and related business metadata within a preset time period from the session archive database; Input the first user message from the historical real dialogue data into the pre-trained text classification model, and output the identity category; Obtain key user information from the business system, and construct static profile tags based on the key user information and identity category; The emotion recognition model is used to identify the emotion of each user message in historical real dialogue data to obtain the emotion type. The intent type is obtained by identifying the intent of each user message in historical real dialogue data through an intent recognition model. Extract hard behavior tags from system logs and correlate them with satisfaction scores from user-submitted evaluation data; Dynamic behavior tags are constructed based on the aforementioned emotion type, intention type, hard behavior tags, and satisfaction scores; Training samples are generated based on historical real-world dialogue data, related business metadata, static profile tags, and dynamic behavior tags.

[0085] In one embodiment, the teacher model training module 20 includes: Configure text generation, sentiment prediction, and behavior prediction modules in the large language model; The input samples of the training samples are used as conditional information, and the output samples of the training samples are used as supervision information. The conditional information and the supervision information are input into the configured large language model, and the text generation module, sentiment prediction module and behavior prediction module are trained using the conditional information and the supervision information. The teacher model is generated by fine-tuning the trained large language model using a fine-tuning strategy.

[0086] In one embodiment, the distillation adversarial training module 30 includes: Load the trained teacher model and training samples into the knowledge distillation container, and initialize the encoder-decoder architecture as the student model; Distillation training is performed through a multi-level knowledge distillation module. During the distillation training process, the output differences between the teacher model and the student model at each level are extracted, and the differences are compared layer by layer to obtain the comparison results. Adjust the network parameters of the student model based on the comparison results, and at the same time, input the static portrait labels in the training samples as conditional prompts into the student model until the difference between the output of the student model and the teacher model at each level converges. An adversarial sample dataset is generated based on customer complaint scenarios and loaded into an adversarial training container; During the execution of the adversarial training module, customer service scripts from adversarial samples are input into the teacher model to obtain ideal user responses. The ideal user response is input into the student model, and the parameters are adjusted to obtain the student model.

[0087] In one embodiment, the dynamic interaction testing module 40 includes: Initialize several virtual user instances in the scheduling engine's memory; The scheduling engine concatenates the current response of the customer service system under test with the historical dialogue of the virtual user instance to form an interaction context. The interaction context is input into the student model for parallel inference, and the user's reply text, user's emotional state, and behavior trigger flags are output. Update the historical dialogue and emotional state of the corresponding virtual user instance based on the user's reply text, user's emotional state, and behavior trigger flags; Based on the user's response text, user emotional state, and behavioral trigger flags output in each round of interaction, a dynamic interactive test result sequence is generated.

[0088] In one embodiment, the multidimensional evaluation index module 50 includes: Analyze the target sessions that meet the business success conditions in the sequence of dynamic interactive test results, and generate the task success rate based on the target sessions. The robustness score of the communication script is calculated based on the semantic similarity between the non-standard responses and standard answers output by the tested customer service system. The user's emotional state in the dynamic interactive test result sequence is labeled to obtain emotional label values; A linear fit is performed on the emotion label values ​​to obtain the emotion guidance index; Analyze user response text to identify risky keywords, and calculate risk sensitivity based on the risky keywords; A multi-dimensional quantitative evaluation index sequence is generated based on the task success rate, the robustness score of the communication script, the emotion guidance index, and the risk sensitivity.

[0089] In one embodiment, the script optimization and correction module 60 includes: Based on the multi-dimensional quantitative evaluation index sequence, back-analysis is performed on the non-compliant sessions to generate root cause inflection points of failed dialogues. The integral gradient attribution technique was used to analyze the changes in attention weights of the student model at the root cause inflection point of the failed dialogue. Based on the changes in attention weights, extract key segments of customer service scripts at the root cause inflection points of failed conversations to generate a root cause localization sequence for failed conversations. An optimized modification scheme is generated by the root cause inflection point and root cause localization sequence of failed dialogues. The customer service script was revised by optimizing the modification plan; The revised customer service script was re-tested using dynamic interaction, and the student model was incrementally fine-tuned based on the generated test data.

[0090] For specific limitations regarding the customer service script testing device, please refer to the aforementioned limitations on the customer service script testing method, which will not be repeated here. Each module in the aforementioned customer service script testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0091] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides determination and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a customer service script testing method on the server side.

[0092] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides determination and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the client-side functions or steps of a customer service script testing method.

[0093] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Acquire historical real dialogue data and related business metadata, and annotate the historical real dialogue data and related business metadata to generate training samples; The training samples are input into a large language model for training to obtain a teacher model; Based on the teacher model and training samples, multi-layer knowledge distillation and adversarial training are performed on the student model; The trained student model is dynamically interacted with the customer service system under test by driving virtual user instances, generating a sequence of dynamic interactive test results. The customer service scripts of the tested customer service system are evaluated by a dynamic interactive test result sequence, resulting in a multi-dimensional quantitative evaluation index sequence. Based on the multi-dimensional quantitative evaluation index sequence, the non-compliant sessions are automatically attributed and root cause located, optimization and modification plans are generated, and customer service scripts are revised according to the optimization and modification plans to complete the customer service script test.

[0094] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, and a computer program is stored thereon, which, when executed by a processor, performs the following steps: Acquire historical real dialogue data and related business metadata, and annotate the historical real dialogue data and related business metadata to generate training samples; The training samples are input into a large language model for training to obtain a teacher model; Based on the teacher model and training samples, multi-layer knowledge distillation and adversarial training are performed on the student model; The trained student model is dynamically interacted with the customer service system under test by driving virtual user instances, generating a sequence of dynamic interactive test results. The customer service scripts of the tested customer service system are evaluated by a dynamic interactive test result sequence, resulting in a multi-dimensional quantitative evaluation index sequence. Based on the multi-dimensional quantitative evaluation index sequence, the non-compliant sessions are automatically attributed and root cause located, optimization and modification plans are generated, and customer service scripts are revised according to the optimization and modification plans to complete the customer service script test.

[0095] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0096] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0097] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0098] It should be noted that any software tools or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0099] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for testing customer service scripts, characterized in that, Includes the following steps: Acquire historical real dialogue data and related business metadata, and annotate the historical real dialogue data and related business metadata to generate training samples; The training samples are input into a large language model for training to obtain a teacher model; Based on the teacher model and training samples, multi-layer knowledge distillation and adversarial training are performed on the student model; The trained student model is dynamically interacted with the customer service system under test by driving virtual user instances, generating a sequence of dynamic interactive test results. The customer service scripts of the tested customer service system are evaluated by a dynamic interactive test result sequence, resulting in a multi-dimensional quantitative evaluation index sequence. Based on the multi-dimensional quantitative evaluation index sequence, the non-compliant sessions are automatically attributed and root cause located, optimization and modification plans are generated, and customer service scripts are revised according to the optimization and modification plans to complete the customer service script test.

2. The customer service script testing method as described in claim 1, characterized in that, Acquire historical real dialogue data and related business metadata, and annotate the historical real dialogue data and related business metadata to generate training samples, including: Extract historical real-time dialogue data and related business metadata within a preset time period from the session archive database; Input the first user message from the historical real dialogue data into the pre-trained text classification model, and output the identity category; Obtain key user information from the business system, and construct static profile tags based on the key user information and identity category; The emotion recognition model is used to identify the emotion of each user message in historical real dialogue data to obtain the emotion type. The intent type is obtained by identifying the intent of each user message in historical real dialogue data through an intent recognition model. Extract hard behavior tags from system logs and correlate them with satisfaction scores from user-submitted evaluation data; Dynamic behavior tags are constructed based on the aforementioned emotion type, intention type, hard behavior tags, and satisfaction scores; Training samples are generated based on historical real-world dialogue data, related business metadata, static profile tags, and dynamic behavior tags.

3. The customer service script testing method as described in claim 1, characterized in that, The training samples are input into a large language model for training to obtain a teacher model, including: Configure text generation, sentiment prediction, and behavior prediction modules in the large language model; The input samples of the training samples are used as conditional information, and the output samples of the training samples are used as supervision information. The conditional information and the supervision information are input into the configured large language model, and the text generation module, sentiment prediction module and behavior prediction module are trained using the conditional information and the supervision information. A fine-tuning strategy is used to fine-tune the trained large language model to generate a teacher model.

4. The customer service script testing method as described in claim 1, characterized in that, Based on the teacher model and training samples, the student model undergoes multi-layer knowledge distillation and adversarial training, including: Load the trained teacher model and training samples into the knowledge distillation container, and initialize the encoder-decoder architecture as the student model; Distillation training is performed through a multi-level knowledge distillation module. During the distillation training process, the output differences between the teacher model and the student model at each level are extracted, and the differences are compared layer by layer to obtain the comparison results. Adjust the network parameters of the student model based on the comparison results, and at the same time, input the static portrait labels in the training samples as conditional prompts into the student model until the difference between the output of the student model and the teacher model at each level converges. An adversarial sample dataset is generated based on customer complaint scenarios and loaded into an adversarial training container; Adversarial training is performed through the adversarial training module. During the adversarial training, customer service scripts from adversarial samples are input into the teacher model to obtain ideal user responses. The ideal user response is input into the student model to adjust the parameters, resulting in a trained student model.

5. The customer service script testing method as described in claim 1, characterized in that, The trained student model is dynamically interacted with the customer service system under test using virtual user instances, generating a sequence of dynamic interactive test results, including: Initialize several virtual user instances in the scheduling engine's memory; The scheduling engine concatenates the current response of the customer service system under test with the historical dialogue of the virtual user instance to form an interaction context. The interaction context is input into the student model for parallel inference, and the user's reply text, user's emotional state, and behavior trigger flags are output. Update the historical dialogue and emotional state of the corresponding virtual user instance based on the user's reply text, user's emotional state, and behavior trigger flags; Based on the user response text, user emotional state, and behavioral trigger flags output in each round of interactive testing, a dynamic interactive test result sequence is generated.

6. The customer service script testing method as described in claim 1, characterized in that, The customer service scripts of the tested customer service system are evaluated through a dynamic interactive test result sequence, resulting in a multi-dimensional quantitative evaluation index sequence, including: Analyze the target sessions that meet the business success conditions in the sequence of dynamic interactive test results, and generate the task success rate based on the target sessions. The robustness score of the communication script is calculated based on the semantic similarity between the non-standard responses and standard answers output by the tested customer service system. The user's emotional state in the dynamic interactive test result sequence is labeled to obtain emotional label values; A linear fit is performed on the emotion label values ​​to obtain the emotion guidance index; Analyze user response text to identify risky keywords, and calculate risk sensitivity based on the risky keywords; A multi-dimensional quantitative evaluation index sequence is generated based on the task success rate, the robustness score of the communication script, the emotion guidance index, and the risk sensitivity.

7. The customer service script testing method as described in claim 1, characterized in that, Based on the multi-dimensional quantitative evaluation index sequence, the non-compliant sessions are automatically attributed and root cause located, optimization and modification plans are generated, and customer service scripts are revised according to the optimization and modification plans. Customer service script testing is then completed, including: Based on the multi-dimensional quantitative evaluation index sequence, back-analysis is performed on the non-compliant sessions to generate root cause inflection points of failed dialogues. The integral gradient attribution technique was used to analyze the changes in attention weights of the student model at the root cause inflection point of the failed dialogue. Based on the changes in attention weights, extract key segments of customer service scripts at the root cause inflection points of failed conversations to generate a root cause localization sequence for failed conversations. An optimized modification scheme is generated by the root cause inflection point and root cause localization sequence of failed dialogues. The customer service script was revised by optimizing the modification plan; The revised customer service script was re-tested using dynamic interaction, and the student model was incrementally fine-tuned based on the generated test data.

8. A customer service script testing device, characterized in that, The customer service script testing device includes: The training sample construction module is used to acquire historical real dialogue data and related business metadata, and to annotate the historical real dialogue data and related business metadata to generate training samples. The teacher model training module is used to input the training samples into the large language model for training to obtain the teacher model; The distillation adversarial training module is used to perform multi-layer knowledge distillation and adversarial training on the student model based on the teacher model and training samples. The dynamic interaction testing module is used to drive the trained student model to conduct dynamic interaction tests with the customer service system under test through virtual user instances, and generate a sequence of dynamic interactive test results. The multidimensional evaluation index module is used to evaluate the customer service scripts of the tested customer service system through a dynamic interactive test result sequence, and obtain a multidimensional quantitative evaluation index sequence. The script optimization and correction module is used to automatically attribute and locate the root causes of substandard conversations based on the multi-dimensional quantitative evaluation index sequence, generate optimization and modification plans, and correct customer service scripts according to the optimization and modification plans to complete customer service script testing.

9. A computer device, characterized in that, The computer device includes a memory, a processor, and a customer service script testing program stored in the memory and executable on the processor. When the customer service script testing program is executed by the processor, it implements the steps of the customer service script testing method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a customer service script testing program, which, when executed by a processor, implements the steps of the customer service script testing method as described in any one of claims 1-7.