Intelligent customer service service dialogue generation method and device, computer equipment and medium
By processing user input through large language models and reordering models, and combining intent feature vectors and contextual information, personalized and accurate intelligent customer service scripts are generated, solving the problems of script redundancy and low accuracy in traditional intelligent customer service systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-05
- Publication Date
- 2026-06-16
AI Technical Summary
Traditional intelligent customer service script generation methods suffer from noise data interference in search results, leading to redundant or inaccurate recommended scripts. Furthermore, they cannot be flexibly adjusted based on dialogue context and user feedback, resulting in low personalization.
The system processes user input using a large language model to obtain intent feature vectors. Combined with a pre-set script library and a re-ranking model, candidate script templates are selected and adjusted based on contextual information to generate the target response script.
It improves the accuracy and personalization of the script, avoids data interference from single semantic matching, and ensures that the response accurately matches the user's input and allows for personalized adjustments.
Smart Images

Figure CN122220459A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to a method, apparatus, computer equipment, and storage medium for generating service scripts for intelligent customer service. Background Technology
[0002] With the deepening of digital transformation, businesses such as product marketing and medical services are shifting from offline to online. Intelligent customer service leverages services like financial product marketing, financial product consultation, and medical and health consultation to reduce the cost of human customer service. However, traditional intelligent customer service script generation methods often rely on shallow semantic matching or keyword-based searches of script databases to retrieve target script templates. Noisy data in these databases can easily interfere with the search results, leading to redundant or inaccurate recommended scripts. Secondly, existing intelligent customer service systems use fixed script templates for skill calls, failing to flexibly adjust based on dialogue context and real-time user feedback. This results in low personalization and difficulty adapting to different customer communication styles and real-time emotional states. Therefore, improving the personalization and accuracy of service scripts has become a pressing issue. Summary of the Invention
[0003] This application provides a method, apparatus, computer equipment, and storage medium for generating service scripts for intelligent customer service, in order to improve the personalization and accuracy of service scripts.
[0004] Firstly, this application provides a method for generating service scripts for intelligent customer service, the method comprising: Upon receiving user input, the user input is processed based on a large language model to obtain the intent feature vector corresponding to the user input; Based on the intent feature vector, a matching is performed in a preset script library to obtain at least one candidate script template; The candidate script templates are reordered based on a preset reordering model to determine the target script template. Obtain the context information of the current conversation, and adjust the target dialogue template based on the context information to obtain the target response dialogue.
[0005] Secondly, this application also provides a service script generation device for intelligent customer service, the device comprising: The intent feature vector acquisition module is used to process the user input based on a large language model when the user input is received, and obtain the intent feature vector corresponding to the user input. The candidate dialogue template acquisition module is used to match the intent feature vector in a preset dialogue library to obtain at least one candidate dialogue template. The target speech template determination module is used to reorder each of the candidate speech templates based on a preset reordering model to determine the target speech template. The target response script acquisition module is used to obtain the context information of the current conversation, adjust the target response script template based on the context information, and obtain the target response script.
[0006] Thirdly, this application also provides a computer device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the intelligent customer service script generation method as described above.
[0007] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the intelligent customer service script generation method described above.
[0008] This application discloses a method, apparatus, computer device, and storage medium for generating service scripts for intelligent customer service. Upon receiving user input, the method processes the user input based on a large language model to obtain an intent feature vector corresponding to the user input. Based on the intent feature vector, it matches it in a preset script library to obtain at least one candidate script template. Based on a preset re-ranking model, it re-ranks each candidate script template to determine a target script template. It then obtains the context information of the current dialogue and adjusts the target script template based on the context information to obtain the target response script. This application first performs an initial matching using intent feature vectors to obtain at least one candidate script template. Then, it uses a re-ranking model to perform a secondary screening of each candidate script template, avoiding data interference from single semantic matching and improving the accuracy of the target script template. Secondly, it adjusts the script template in real time based on the context information to incorporate the current context, improving the personalization of the target response script. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a first schematic flowchart of a service script generation method for intelligent customer service provided in an embodiment of this application; Figure 2This is a second schematic flowchart of a service script generation method for intelligent customer service provided in an embodiment of this application; Figure 3 This is a third schematic flowchart of a service script generation method for intelligent customer service provided in an embodiment of this application; Figure 4 A schematic block diagram of a service script generation device for intelligent customer service provided in an embodiment of this application; Figure 5 A schematic block diagram of the structure of a computer device provided for an embodiment of this application. Detailed Implementation
[0011] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0012] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0013] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0014] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0015] This application provides an intelligent customer service script generation method, apparatus, computer device, and storage medium. The intelligent customer service script generation method can be applied to a server. It performs initial matching using intent feature vectors to obtain at least one candidate script template. Then, a re-ranking model is used to perform secondary filtering among the candidate script templates, avoiding data interference from single semantic matching and improving the accuracy of the target script template. Secondly, the script template is adjusted in real-time based on contextual information to integrate with the current context, improving the personalization of the target response script. The server can be a standalone server or a server cluster.
[0016] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0017] Please see Figure 1 , Figure 1 This is a schematic flowchart illustrating a service script generation method for intelligent customer service provided in an embodiment of this application. This intelligent customer service script generation method can be applied to a server. It performs an initial match using intent feature vectors to obtain at least one candidate script template. Then, a re-ranking model is used to perform a secondary screening of each candidate script template, avoiding data interference from single semantic matching and improving the accuracy of the target script template. Furthermore, the script template is adjusted in real-time based on contextual information to integrate with the current context, improving the personalization of the target response script.
[0018] like Figure 1 As shown, the intelligent customer service script generation method specifically includes steps S101 to S104.
[0019] S101. Upon receiving user input, the user input is processed based on a large language model to obtain the intent feature vector corresponding to the user input. In one embodiment, the user's original input (including colloquial expressions, typos, and ambiguous sentences) is cleaned. Specifically, a rule engine corrects typos, removes interjections, and completes elliptical sentences. Simultaneously, it analyzes the referential relationships in multi-turn dialogues to generate standardized text. For example, if a user inputs "Is the discount I mentioned yesterday still valid?", it is standardized to "Inquiring whether the discount mentioned yesterday is still available."
[0020] In one embodiment, a large language model fine-tuned with an industry corpus is used. Standardized text is input into the model, and structured intent text is output. The structured intent text includes the user's core needs (such as discount information), business entities (such as product names, event names, etc.), priority (such as urgent or normal), and sentiment.
[0021] In one embodiment, structured intent text is input into a pre-trained vectorized model to generate intent feature vectors.
[0022] Furthermore, the step of processing the user input based on the large language model to obtain the intent feature vector corresponding to the user input includes: standardizing the user input based on the large language model to obtain dialogue text, and performing intent recognition on the dialogue text to obtain intent text; and converting the intent text into the intent feature vector based on an attention weighting mechanism.
[0023] In one embodiment, a large language model is used for standardized conversion. Through three core steps—context completion, terminology standardization, and ambiguity resolution—unstructured spoken expressions are transformed into structured dialogue text.
[0024] Specifically, for elliptical sentences, the model combines dialogue history or common sense to complete the missing information. For example, in a medical scenario, if a user enters "I feel dizzy and a little nauseous, and I have a history of high blood pressure," the model automatically completes it as "User inquiry: I have recently experienced dizziness and nausea, and I have a history of high blood pressure." In a financial scenario, if a user enters "Why did my bill suddenly increase so much? I'm short on cash," the model completes it as "User feedback: My bill amount this month has increased abnormally, and I have difficulty making repayments."
[0025] Transform colloquial expressions into industry-standard terms, such as standardizing "heartache" in the medical context as "chest pain" and "financial distress" as "repayment pressure".
[0026] The semantic understanding capabilities of LLM (Large Language Model) are used to eliminate ambiguity. For example, if a user inputs "My blood pressure is high now, should I take medicine?", the model will determine from the context that it is "current blood pressure value is high" rather than "has a history of hypertension", and standardize it as "User inquiry: Current blood pressure value is high, asking if I need to take antihypertensive drugs".
[0027] In one embodiment, the large language model performs intent recognition on the standardized dialogue text, including accurately locating the user's core needs, background information, and identifying the user's emotional state.
[0028] In one embodiment, when converting intent text into intent feature vectors, differentiated weights are assigned to different elements of the structured intent text, so that the generated intent feature vectors more accurately represent the user's core intent.
[0029] Specifically, the weights can be preset based on industry scenario requirements. For example, the weight corresponding to the core demand is 40%, the weight corresponding to the key background is 35%, and the weight corresponding to the sentiment is 25%. The core demand, key background, and sentiment are converted into semantic vectors respectively, and the vectors of each element are weighted and summed to generate the final intent feature vector.
[0030] In the above embodiments, an attention mechanism is used in the vector transformation process, incorporating weight factors, so that the model can focus on key information points in the dialogue, improve the accuracy of the intent feature vector, and thus improve the accuracy of the candidate dialogue template.
[0031] S102. Based on the intent feature vector, perform matching in a preset dialogue database to obtain at least one candidate dialogue template; In one embodiment, a pre-defined script library stores at least one script template, and each script template corresponds to a semantic vector with its core semantic meaning. An efficient index is constructed using a vector database, supporting nearest neighbor search based on cosine similarity to ensure timely matching responses.
[0032] In one embodiment, similarity matching is performed between the intent feature vector and the semantic vector of the speech template to filter out at least one candidate speech template.
[0033] like Figure 2 As shown, before step S102, the intelligent customer service script generation method further includes steps S201 to S204.
[0034] S201. Obtain multi-source dialogue data, preprocess the multi-source dialogue data, and obtain at least one set of dialogue text; S202. Perform feature extraction and vectorization on each of the dialogue texts to obtain semantic feature vectors; S203. Cluster each of the dialogue texts based on the semantic feature vectors to obtain clustering results; S204. Store each of the dialogue texts according to the clustering results to generate the preset dialogue script library.
[0035] In one embodiment, high-quality dialogue data is collected through multiple channels, including but not limited to multimedia data sources such as customer service chat logs, social media interactions, and voice call transcripts. For multi-platform chat data (such as WeChat, DingTalk, and WeChat Work), unified reception and centralized management of multi-source messages are achieved by calling the open APIs (Application Programming Interfaces) of each platform.
[0036] For unstructured voice dialogue data, a conversion module based on speech recognition technology is used to convert the voice data into processable text information to obtain at least one set of dialogue text.
[0037] In one embodiment, the dialogue text is automatically cleaned, denoised, and standardized. Natural language processing techniques are used to segment the text, tag parts of speech, and identify named entities to extract semantic features and key business features (such as product names, time information, price information, etc.).
[0038] Specifically, a pre-trained rule engine and a NER (Named Entity Recognition) model are used to extract structured business information from the dialogue, including but not limited to entity features such as product name, order number, logistics status, price, and time; intent features such as the user's core needs (e.g., inquiry, complaint, purchase); and sentiment features such as the user's emotional tendency (e.g., satisfied, dissatisfied, neutral). A pre-trained language model is used to perform deep semantic encoding on the text to capture its deep semantic information.
[0039] In one embodiment, a pre-trained language model is used to vectorize the extracted features to obtain semantic feature vectors for each dialogue text. Semantic similarity is then determined based on these semantic features, and clustering is performed according to this semantic similarity.
[0040] In one embodiment, semantically similar dialogue texts are grouped together using a clustering algorithm to achieve semantic-level classification of the dialogue data and obtain at least one cluster. The clustering strategy can employ a hybrid approach combining K-Means clustering (suitable for large-scale data) and spectral clustering (suitable for non-convex data distributions). Specifically, K-Means clustering is first used to quickly divide the data into coarse-grained clusters, and then spectral clustering is used to refine the subdivisions within each coarse-grained cluster, improving clustering accuracy. The number of clusters can be automatically determined based on the business scenario and the elbow rule; for example, in an e-commerce scenario, the number of clusters could be set to 20-30 (covering the main consultation scenarios).
[0041] In another embodiment, corresponding intent scenario tags (such as logistics consultation, promotional activity consultation, etc.) or business scenario tags (such as pre-sales, after-sales, etc.) can be automatically generated based on the semantics of each cluster, providing a basis for the structured organization of the script library.
[0042] In one embodiment, the clustered dialogue text is structured and stored according to the clustering results to construct a hierarchical, semantically accurate, and easily searchable pre-defined dialogue script library, providing efficient data support for subsequent intent matching and dialogue script recommendation. Specifically, the pre-defined dialogue script library includes a relational database and a vector database. Dialogue script templates, intent tags, and business rules are stored in a relational database (such as MySQL or PostgreSQL) for convenient metadata management; the semantic vectors of the dialogue script templates are stored in a vector database to support fast retrieval based on semantic similarity.
[0043] In one embodiment, newly collected dialogue data is preprocessed, vectorized, and clustered periodically (e.g., weekly), and new dialogue templates are added to the corresponding clusters. Combined with subsequent feedback loop mechanisms (e.g., user satisfaction, usage frequency), the templates in the dialogue script library are dynamically weighted, and high-performance dialogue scripts are recommended first.
[0044] In the above embodiments, by integrating dialogue data from multiple channels, the scene coverage is improved. Through semantic feature vectorization and intelligent clustering, the data is stored according to the clustering results to generate a dialogue library. This allows dialogues with similar semantics but different expressions to be automatically classified into the same category, thereby generating a logically clear and semantically accurate dialogue system, laying a solid foundation for subsequent accurate recommendations.
[0045] S103. Based on the preset reordering model, reorder each of the candidate speech templates to determine the target speech template; In one embodiment, a pre-trained re-ranking model is used to perform a secondary screening on at least one candidate dialogue template initially retrieved, eliminating candidate dialogues with low semantic relevance, inconsistent business logic, or slow response, to ensure that the final recommendation result not only conforms to user intent and is highly consistent with business scenarios but also responds quickly.
[0046] like Figure 3 As shown, step S103 of the intelligent customer service script generation method specifically includes steps S301 to S303.
[0047] S301. Based on the reordering model, analyze the semantic matching degree, logical consistency degree, and response matching degree between each candidate dialogue template and the user input; Further, the step of analyzing the semantic matching degree, logical consistency degree, and response matching degree of each candidate dialogue template with the user input based on the re-ranking model includes: analyzing the semantic matching degree of the intent feature vector with each candidate dialogue template based on the re-ranking model; obtaining the business data corresponding to the current dialogue, analyzing the logical consistency between the business data and each candidate dialogue template based on the re-ranking model, and determining the logical consistency degree; analyzing the response urgency of the user input and the response time cost of each candidate dialogue template based on the re-ranking model, and determining the response matching degree of each candidate dialogue template according to the response urgency and the response time cost.
[0048] In one embodiment, a re-ranking model is used to deeply evaluate candidate dialogue templates from three core dimensions: semantic matching, business logic, and scenario adaptation, quantifying the overall fit between each template and the current user input.
[0049] In a specific embodiment, a pre-trained re-ranking model is used, where user input and dialogue templates are used as paired inputs, and the model directly outputs a semantic matching score (range 0-1). The re-ranking model is fine-tuned based on the BERT / LLaMA architecture, and the training data consists of pre-labeled user input-dialogue template-matching triples, supporting contextual semantic understanding. For example, if the user inputs "The logistics are too slow," the model can identify the semantic matching degree between the dialogue template "We will prioritize your express delivery" and the user's request, such as a matching degree score of 0.92, while the template "Our product quality is guaranteed" scores only 0.15.
[0050] In one embodiment, the logical consistency level is the consistency between the content of the candidate script template and the current real-time business data and business rules, so as to avoid errors in which the script conflicts with the actual business (such as the script saying "sufficient inventory" but the actual inventory is 0).
[0051] In a specific embodiment, dynamic data (such as order status, inventory quantity, and promotional rules) is obtained in real time from the business system. The LLM module in the reordering model parses the business logic of the sales script template (such as sufficient inventory for immediate shipment, support for 7-day no-reason return, etc.), and the rule engine compares the sales script logic with the real-time data to output a consistency score.
[0052] For example, complete consistency: 90-100 points (e.g., the sales pitch says "refunds and exchanges are supported," and the user's order is within the refund / exchange period); partial consistency: 60-89 points (e.g., the sales pitch says "spend 200 and get 50 off," but the current promotion is "spend 200 and get 30 off"); complete conflict: 0-59 points (e.g., the sales pitch says "sufficient inventory," but the actual inventory is 0).
[0053] In one embodiment, the response matching score is used to evaluate whether the response time cost of the script template matches the urgency level of the user input. Specifically, the re-ranking model identifies urgency keywords (such as urgent, immediately, must today, etc.) input by the user and classifies them into high, medium, and low urgency levels. Each level corresponds to a preset urgency weight coefficient. At the same time, the response time cost of the candidate script template is calculated (e.g., 0-100 points, with lower scores for fewer words and lower complexity). The response matching score = (100 - time cost score) × urgency weight coefficient, normalized to 0-100 points.
[0054] For example, if a user enters "The phone must be delivered today", the concise statement "We will prioritize delivery" scores 90 points, while the more complex statement "We will verify the logistics and arrange delivery" scores 40 points.
[0055] S302. Based on the semantic matching degree, the logical consistency degree, and the response matching degree, obtain a comprehensive score for each candidate dialogue template; S303. Obtain the candidate script template with the highest comprehensive score as the target script template.
[0056] In one embodiment, the scores of the three dimensions are merged into a comprehensive score. Specifically, the scores of each indicator are uniformly mapped to a range of 0-100 points, and the comprehensive score is generated by weighted summation. The weights of each indicator score can be set according to actual needs.
[0057] In one embodiment, all candidate script templates are sorted from highest to lowest based on their overall score, and the template with the highest overall score is selected as the target script template.
[0058] In another embodiment, when multiple candidate script templates have the same overall score, the most recently updated template is selected to ensure that the script content complies with the latest business rules.
[0059] In the above embodiments, candidate dialogue templates are screened a second time by scoring them in three dimensions: semantics, logic, and response. This breaks through the limitations of traditional single semantic matching and achieves accurate matching between the target dialogue template and the user input.
[0060] S104. Obtain the context information of the current dialogue, and adjust the target dialogue template based on the context information to obtain the target response dialogue.
[0061] In one embodiment, the contextual information includes the dialogue context, the user profile context (including but not limited to the user's historical purchase records, membership level, and preference tags), and the business context (including but not limited to real-time inventory data, current promotional activities, and order status).
[0062] In one embodiment, placeholders in the target script template are replaced with real-time data, such as replacing {product name} with "2026 smartwatch" and {discount percentage} with "20% off". At the same time, the script style is adjusted according to the user profile.
[0063] For example, different communication styles are adopted for users of different age groups (such as a lively style for young users and a steady style for older users); the professionalism and detail of the communication are automatically adjusted according to specific business scenarios (such as complaint handling, product consultation, and after-sales support); and appropriate greetings and caring language are incorporated according to contextual factors such as holidays and time periods.
[0064] Furthermore, adjusting the target dialogue template based on the context information to obtain the target response dialogue includes: analyzing the context information based on the large language model to determine the user profile and dialogue business scenario; performing dialogue style recognition and answer content retrieval based on the user dialogue and the dialogue business scenario to obtain the target dialogue style and target response content; and adjusting the target dialogue template based on the target dialogue style and the target response content to obtain the target response dialogue.
[0065] In one embodiment, a large language model is used to semantically understand contextual information, accurately identifying the user's identity characteristics, behavioral preferences, communication style, as well as the business scenario, urgency, and emotional inclination of the current conversation.
[0066] In one embodiment, contextual information includes basic user profiles (age, gender, membership level, purchase history, complaint history, preference tags), dialogue history context (such as the current dialogue round, previous questions asked by the user, responses already given by the system, and changes in the user's emotions), and real-time business data (current business status (such as product inventory, promotional activities, and order logistics status), and scenario attributes (such as pre-sales, after-sales, and marketing)).
[0067] LLM performs fusion analysis on multi-source data and outputs structured user profile tags, such as: User identity: Diamond member, Behavioral characteristics: Purchased high-end skincare products 3 times, Communication style: Concise and direct, Prefers professional terminology, Emotional tendency: Expressed dissatisfaction due to logistics delays in the current conversation.
[0068] LLM identifies scenario types and priorities by matching dialogue keywords and business data. For example: Scenario type: after-sales complaint - logistics delay; Urgency level: high (user mentions "I need it tomorrow, it must be delivered today") For example, a user inputs: "Why haven't the skincare products I ordered yesterday arrived yet? I need to give them to someone tomorrow, so they must arrive today!" The LLM analysis outputs: User profile: Diamond member, high-end skincare product user, currently dissatisfied, urgent need; Business scenario: After-sales complaint - logistics delay, high urgency.
[0069] In one embodiment, based on user profiles and business scenarios, the target speech style (such as lively, steady, professional, or reassuring) is determined, and the precise target response content (such as logistics policies, compensation plans, and product parameters) is retrieved from the knowledge base by using the corresponding intent feature vector input by the user, providing a style framework and content filling for speech generation.
[0070] In one embodiment, the style transfer capability of LLM is used to transform the target wording template into the target style, for example, transforming "insufficient stock" into the lively style "Hurry up and sell out! Only 3 left!".
[0071] In one embodiment, the knowledge base adopts a three-layer structure: a general knowledge base, an industry knowledge base, and a real-time business knowledge base. The general knowledge base contains frequently asked questions, company introductions, and policy provisions; the industry knowledge base contains specialized content tailored to different business scenarios (such as medical knowledge bases and financial knowledge bases); and the real-time business knowledge base contains dynamic data such as real-time inventory, logistics status, and promotional activities.
[0072] In one embodiment, the target response content is injected into the style-transferred target script template, and through variable replacement, style adjustment, and dynamic data filling, a natural, fluent, and highly adapted target response script is generated.
[0073] In the above embodiments, by analyzing contextual information to accurately construct user profiles and identify dialogue scenarios, the most suitable target dialogue style can be dynamically matched, improving the personalization of service dialogue. For example, lively online language can be used for younger users, while a more stable and considerate style can be used for older users. This solves the problem of rigid and impersonal traditional dialogue templates, making machine-generated dialogues more emotionally resonant and approachable, significantly improving user satisfaction. Secondly, adjustments based on complete context ensure that the generated target response dialogue flows naturally with previous dialogue history, improving the contextual coherence and naturalness of the generated dialogue.
[0074] Furthermore, after obtaining the context information of the current dialogue, adjusting the target dialogue template based on the context information, and obtaining the target response dialogue, the method further includes: returning the target response dialogue to the user and receiving feedback from the user based on the target response dialogue; analyzing the feedback to determine the weight score of the target response dialogue; and adding the target response dialogue to the preset dialogue library when the weight score is greater than or equal to a preset threshold.
[0075] In one embodiment, the target response is sent to the user during the current conversation, supporting multiple presentation formats, including plain text, mixed text and images, and embedded hyperlinks, to meet the display needs of different platforms and scenarios. Specifically, plain text responses are adapted for text-based conversations and support variable replacement. For example, in responses containing dynamic data (such as order numbers or logistics status), the system automatically replaces template variables with real-time business data from the current conversation. Voice responses are converted to natural speech using TTS (text-to-speech) technology, suitable for telephone customer service scenarios. Multimedia responses combine text, images, videos, and links, suitable for complex business explanations (such as product operation guides).
[0076] In one embodiment, actual usage data for each recommended script is collected, including metrics such as user satisfaction, problem resolution rate, and conversation duration. The script selection model is continuously optimized based on this feedback data. Specifically, the script weighting score is updated regularly (e.g., weekly), with scoring metrics including hit rate, hit rate, hit hang-up rate, hit response rate, hit response rate, conversion rate after hit, and conversion rate after hit. Scripts with excellent performance (weighting score above a threshold) are added to the preset script library; while scripts with poor performance (weighting score below a threshold) are gradually eliminated or modified and optimized.
[0077] In a specific implementation, feedback data is collected from three dimensions: the user end, the customer service end, and the business end, covering both explicit and implicit feedback. Explicit feedback is obtained by initiating an active evaluation process for users (such as a star rating for "Are you satisfied with this response?"), acquiring user responses, and performing semantic analysis on these responses to determine user evaluation. Implicit feedback is tracked through behavioral tracking (such as whether links within the message were clicked, whether follow-up questions were asked, whether a human operator was contacted, and the duration of the conversation).
[0078] In one embodiment, the system uses a multi-objective optimization algorithm to perform a weighted summation of each indicator to generate the final weight score of the speech: Weight score = Σ (indicator score × indicator weight).
[0079] For example, a marketing script has a user satisfaction score of 85, a problem resolution rate of 90%, a conversation duration reduction rate of 20%, a repeat inquiry rate of 5%, and a conversion rate of 30%, with weights of 30%, 20%, 15%, 10%, and 25% respectively. Then: Weight score = 85×0.3 + 90×0.2 + 20×0.15 + 5×0.1 + 30×0.25 = 54.5.
[0080] In one embodiment, weighted scoring thresholds are dynamically set based on business scenarios, industry benchmarks, and historical data. Specifically, an initial scoring threshold is set with reference to the industry average (e.g., a threshold of 60 points for marketing scenarios and 55 points for customer service scenarios). The threshold is automatically adjusted periodically based on the overall scoring distribution of the script library (e.g., when 80% of the scripts score ≥ 70 points, the threshold is raised to 75 points to maintain the quality of the script library).
[0081] In one embodiment, when the weight score of a sales script is greater than or equal to a preset threshold, an automatic database entry operation is performed. This includes script standardization: extracting variable placeholders (such as {order number}, {product name}) from the script and generating a reusable template structure; semantic tagging: automatically tagging the script with intent tags (such as "logistics inquiry reply" and "promotional activity introduction") and scenario tags (such as "after-sales" and "marketing") using LLM; and vector index updating: converting the standardized script into semantic vectors and updating the index of the vector database to ensure that it can be retrieved during subsequent matching.
[0082] When a script's weight score remains below the threshold (e.g., score <40 for 3 consecutive weeks), the recommendation weight is reduced: the script's recommendation priority is decreased, changing it from "preferred recommendation" to "backup recommendation"; script optimization prompts are sent to human operations staff (e.g., "User satisfaction with this script is low, we suggest optimizing the reassurance content"); automatic removal and deletion: if the score still does not meet the standard after optimization, the system automatically removes the script from the script library to avoid affecting subsequent recommendation results.
[0083] In the above embodiments, by collecting real user feedback and converting it into quantitative weight scores, the scripts with weight scores higher than the threshold are automatically included in the preset script library, making the script library a dynamic script library that can continuously iterate and evolve with user feedback. This realizes the automation and data-driven optimization of scripts, enabling the intelligent customer service system to quickly adapt to changes in business needs without the need for large-scale manual adjustments to the tag system or script templates, greatly reducing maintenance costs and improving the long-term applicability of the intelligent customer service system.
[0084] Please see Figure 4 , Figure 4 This application provides a schematic block diagram of an intelligent customer service script generation device, which is used to execute the aforementioned intelligent customer service script generation method. The intelligent customer service script generation device can be configured on a server.
[0085] like Figure 4 As shown, the intelligent customer service script generation device 400 includes: The intent feature vector acquisition module 401 is used to process the user input based on a large language model when the user input is received, and obtain the intent feature vector corresponding to the user input. The candidate dialogue template acquisition module 402 is used to match the intent feature vector in a preset dialogue library to obtain at least one candidate dialogue template. The target speech template determination module 403 is used to reorder each of the candidate speech templates based on a preset reordering model to determine the target speech template. The target response script acquisition module 404 is used to acquire the context information of the current dialogue, adjust the target script template based on the context information, and obtain the target response script.
[0086] Furthermore, the intelligent customer service script generation device 400 also includes a script library generation module, which includes: The dialogue text acquisition unit is used to acquire multi-source dialogue data, preprocess the multi-source dialogue data, and obtain at least one set of dialogue text. The feature vector acquisition unit is used to extract features from each of the dialogue texts and perform vectorization processing to obtain semantic feature vectors. The clustering result acquisition unit is used to cluster each of the dialogue texts based on the semantic feature vector to obtain the clustering result; The dialogue text storage unit is used to store each of the dialogue texts according to the clustering results, and generate the preset script library.
[0087] Furthermore, the target response script acquisition module 404 includes: The context analysis unit is used to analyze the context information based on the large language model to determine the user profile and dialogue business scenario; The response content acquisition unit is used to perform dialogue style recognition and response content retrieval based on the user's speech and the dialogue business scenario, and to obtain the target speech style and the target response content. The response script acquisition unit is used to adjust the target script template based on the target script style and the target response content to obtain the target response script.
[0088] Furthermore, the target speech template determination module 403 includes: The reordering analysis unit is used to analyze the semantic matching degree, logical consistency degree, and response matching degree of each candidate dialogue template with the user input based on the reordering model. The comprehensive scoring unit is used to obtain a comprehensive score for each candidate speech template based on the semantic matching degree, the logical consistency degree, and the response matching degree. The script template determination unit is used to obtain the candidate script template with the highest comprehensive score as the target script template.
[0089] Furthermore, the reordering analysis unit includes: The semantic matching degree analysis subunit is used to analyze the semantic matching degree between the intent feature vector and each of the candidate speech templates based on the re-ranking model. The logical consistency analysis subunit is used to obtain the business data corresponding to the current dialogue, analyze the logical consistency between the business data and each of the candidate dialogue templates based on the reordering model, and determine the degree of logical consistency. The response matching degree determination subunit is used to analyze the urgency of the user input response and the response time cost of each candidate dialogue template based on the reordering model, and determine the response matching degree of each candidate dialogue template according to the urgency of the response and the response time cost.
[0090] Furthermore, the intent feature vector acquisition module 401 includes: The intent text acquisition unit is used to standardize the user input based on the large language model to obtain dialogue text, and to perform intent recognition on the dialogue text to obtain intent text. The intent text conversion unit is used to convert the intent text into the intent feature vector based on an attention weighting mechanism.
[0091] Furthermore, the intelligent customer service script generation device 400 also includes a script database update module, which includes: The script feedback acquisition unit is used to return the target response script to the user and receive feedback from the user based on the target response script; The weighted scoring determination unit is used to analyze the feedback and determine the weighted score of the target response script; The script library update unit is used to add the target response script to the preset script library when the weight score is greater than or equal to a preset threshold.
[0092] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described apparatus and modules can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0093] The aforementioned device can be implemented as a computer program, which can be used in, for example... Figure 5 It runs on the computer device shown.
[0094] Please see Figure 5 , Figure 5 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a server.
[0095] See Figure 5 The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0096] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any intelligent customer service script generation method.
[0097] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0098] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor, it enables the processor to execute any intelligent customer service script generation method.
[0099] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0100] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0101] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps: Upon receiving user input, the user input is processed based on a large language model to obtain the intent feature vector corresponding to the user input; Based on the intent feature vector, a matching is performed in a preset script library to obtain at least one candidate script template; The candidate script templates are reordered based on a preset reordering model to determine the target script template. Obtain the context information of the current conversation, and adjust the target dialogue template based on the context information to obtain the target response dialogue.
[0102] In one embodiment, before performing the matching based on the intent feature vector in a preset script library to obtain at least one candidate script template, the processor is further configured to perform: Acquire multi-source dialogue data, preprocess the multi-source dialogue data, and obtain at least one set of dialogue text; The dialogue texts are subjected to feature extraction and vectorization to obtain semantic feature vectors. Based on the semantic feature vectors, the dialogue texts are clustered to obtain clustering results; The dialogue texts are stored according to the clustering results to generate the preset dialogue script library.
[0103] In one embodiment, when the processor adjusts the target dialogue template based on the context information to obtain the target response dialogue, it is configured to: Based on the large language model, the context information is analyzed to determine the user profile and dialogue business scenario; Based on the user's dialogue and the dialogue business scenario, the dialogue style is identified and the response content is retrieved to obtain the target dialogue style and the target response content. The target script template is adjusted based on the target script style and the target response content to obtain the target response script.
[0104] In one embodiment, when the processor reorders the candidate speech templates based on a preset reordering model to determine the target speech template, it is configured to: Based on the reordering model, the semantic matching degree, logical consistency degree, and response matching degree of each candidate dialogue template with the user input are analyzed. A comprehensive score is obtained for each candidate dialogue template based on the semantic matching degree, the logical consistency degree, and the response matching degree. The candidate script template with the highest overall score is selected as the target script template.
[0105] In one embodiment, when the processor analyzes the semantic matching degree, logical consistency degree, and response matching degree of each candidate speech template with the user input based on the reordering model, it is configured to: Based on the reordering model, the semantic matching degree between the intent feature vector and each of the candidate speech templates is analyzed; Obtain the business data corresponding to the current dialogue, and based on the reordering model, analyze the logical consistency between the business data and each of the candidate dialogue templates to determine the degree of logical consistency. Based on the reordering model, the urgency of the user input response and the response time cost of each candidate dialogue template are analyzed, and the response matching degree of each candidate dialogue template is determined according to the urgency of the response and the response time cost.
[0106] In one embodiment, when the processor processes the user input based on a large language model to obtain the intent feature vector corresponding to the user input, it is used to: The user input is standardized based on the large language model to obtain the dialogue text, and the intent is identified from the dialogue text to obtain the intent text. Based on the attention weighting mechanism, the intent text is converted into the intent feature vector.
[0107] In one embodiment, after acquiring the context information of the current conversation, adjusting the target dialogue template based on the context information, and obtaining the target response dialogue, the processor is further configured to: The target response message is returned to the user, and feedback from the user based on the target response message is received; The feedback is analyzed to determine the weight score of the target response script; When the weight score is greater than or equal to a preset threshold, the target response script is added to the preset script library.
[0108] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the intelligent customer service script generation methods provided in the embodiments of this application.
[0109] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0110] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for generating service scripts for intelligent customer service, characterized in that, include: Upon receiving user input, the user input is processed based on a large language model to obtain the intent feature vector corresponding to the user input; Based on the intent feature vector, a matching is performed in a preset script library to obtain at least one candidate script template; The candidate script templates are reordered based on a preset reordering model to determine the target script template. Obtain the context information of the current conversation, and adjust the target dialogue template based on the context information to obtain the target response dialogue.
2. The intelligent customer service script generation method according to claim 1, characterized in that, Before matching the intent feature vector in a preset script library to obtain at least one candidate script template, the method further includes: Acquire multi-source dialogue data, preprocess the multi-source dialogue data, and obtain at least one set of dialogue text; The dialogue texts are subjected to feature extraction and vectorization to obtain semantic feature vectors. Based on the semantic feature vectors, the dialogue texts are clustered to obtain clustering results; The dialogue texts are stored according to the clustering results to generate the preset dialogue script library.
3. The intelligent customer service script generation method according to claim 1, characterized in that, The step of adjusting the target dialogue template based on the context information to obtain the target response dialogue includes: Based on the large language model, the context information is analyzed to determine the user profile and dialogue business scenario; Based on the user's dialogue and the dialogue business scenario, the dialogue style is identified and the response content is retrieved to obtain the target dialogue style and the target response content. The target script template is adjusted based on the target script style and the target response content to obtain the target response script.
4. The intelligent customer service script generation method according to claim 1, characterized in that, The reordering of the candidate speech templates based on a preset reordering model to determine the target speech template includes: Based on the reordering model, the semantic matching degree, logical consistency degree, and response matching degree of each candidate dialogue template with the user input are analyzed. A comprehensive score is obtained for each candidate dialogue template based on the semantic matching degree, the logical consistency degree, and the response matching degree. The candidate script template with the highest overall score is selected as the target script template.
5. The intelligent customer service script generation method according to claim 4, characterized in that, The step of analyzing the semantic matching degree, logical consistency degree, and response matching degree of each candidate dialogue template with the user input based on the re-ranking model includes: Based on the reordering model, the semantic matching degree between the intent feature vector and each of the candidate speech templates is analyzed; Obtain the business data corresponding to the current dialogue, and based on the reordering model, analyze the logical consistency between the business data and each of the candidate dialogue templates to determine the degree of logical consistency. Based on the reordering model, the urgency of the user input response and the response time cost of each candidate dialogue template are analyzed, and the response matching degree of each candidate dialogue template is determined according to the urgency of the response and the response time cost.
6. The intelligent customer service script generation method according to claim 1, characterized in that, The process of processing the user input based on a large language model to obtain the intent feature vector corresponding to the user input includes: The user input is standardized based on the large language model to obtain the dialogue text, and the intent is identified from the dialogue text to obtain the intent text. Based on the attention weighting mechanism, the intent text is converted into the intent feature vector.
7. The intelligent customer service script generation method according to any one of claims 1-6, characterized in that, After obtaining the context information of the current dialogue, adjusting the target dialogue template based on the context information, and obtaining the target response dialogue, the method further includes: The target response message is returned to the user, and feedback from the user based on the target response message is received; The feedback is analyzed to determine the weight score of the target response script; When the weight score is greater than or equal to a preset threshold, the target response script is added to the preset script library.
8. A service script generation device for intelligent customer service, characterized in that, include: The intent feature vector acquisition module is used to process the user input based on a large language model when the user input is received, and obtain the intent feature vector corresponding to the user input. The candidate dialogue template acquisition module is used to match the intent feature vector in a preset dialogue library to obtain at least one candidate dialogue template. The target speech template determination module is used to reorder each of the candidate speech templates based on a preset reordering model to determine the target speech template. The target response script acquisition module is used to obtain the context information of the current conversation, and adjust the target response script template based on the context information to obtain the target response script.
9. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, when executing the computer program, implement the intelligent customer service script generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the intelligent customer service script generation method as described in any one of claims 1 to 7.