Customer service reply interception method and its device, equipment and medium
By introducing a dual detection mechanism of preset violation rules and large language models in the customer service reply system, optimized text is generated, and the problem that traditional quality inspection methods cannot correct violation responses in real time is solved, achieving more efficient customer service reply quality control and user satisfaction improvement.
Patent Information
- Application Number
- CN202411944637.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-04
AI Technical Summary
Traditional customer service reply quality inspection methods cannot improve user satisfaction while correcting illegal responses in real time, and cannot effectively deal with complex language expressions and potential violations, making them prone to missed or missed inspections.
By responding to customer service replies events, obtain the text to be sent and the dialogue context, use preset violation rules and large language models for double detection, and generate an optimization requirement description if there are violations or potential problems, and generate multiple alternative optimization texts through the optimized text generation model.
Real-time interception and optimization of customer service replies is achieved, the quality of reply and user satisfaction is improved, and comprehensive, accurate and efficient detection of sent texts is ensured.
Smart Images

Figure CN119760093A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of e-commerce technology, and in particular to a customer service reply interception method and its device, equipment, and medium. Background Art
[0002] In the field of e-commerce technology, providing customer service is crucial. It not only responds to the inquiries and needs of buyers of goods instantly, but also usually provides personalized shopping suggestions and / or solutions, thereby significantly improving consumers' shopping experience and satisfaction. For merchants, high-quality customer service is a key factor in building customer trust, enhancing brand loyalty and promoting sales.
[0003] However, the traditional customer service response quality inspection method often performs a unified quality inspection on the conversation between the user and the customer service after the customer service is completed. This method will result in the inability to correct the illegal replies sent by the customer service in a timely manner, resulting in the illegal replies being sent to the user, which reduces user satisfaction. Although the traditional customer service quality inspection method realizes real-time quality inspection when the user is talking to the customer service, it uses static rules for simple keyword filtering, which cannot cope with complex language expressions and potential violations, and is prone to missed detection or false detection.
[0004] In view of the shortcomings of traditional practices, the applicant has been engaged in research in related fields for a long time and has taken a different approach to solve industry problems in the field of e-commerce technology. Summary of the invention
[0005] The primary purpose of the present application is to solve at least one of the above problems and provide a customer service reply interception method and its device, equipment, and medium.
[0006] In order to meet the various objectives of this application, this application adopts the following technical solutions:
[0007] A customer service reply interception method provided to meet one of the purposes of this application includes the following steps:
[0008] Respond to the customer service reply event, obtain the text to be sent for the event and the conversation context generated by the conversation between the customer service and the user;
[0009] When the text to be sent does not hit the preset violation rule, calling the large language model to further detect whether the text to be sent has a preset potential problem;
[0010] When the text to be sent does not have any preset potential problem, sending the text to be sent as a target reply text to the user;
[0011] When the text to be sent hits a preset rule of illegal behavior or has a preset potential problem, determining an optimization requirement description of the text to be sent;
[0012] The text to be sent, the conversation context and the optimization requirement description are input into the optimization text generation model to obtain multiple candidate optimization texts, so that the customer service can determine the target reply text to send to the user based on the multiple candidate optimization texts and the text to be sent.
[0013] On the other hand, a customer service reply interception device provided to meet one of the purposes of the present application includes:
[0014] The text acquisition module is used to respond to the customer service reply event, obtain the text to be sent for the event and the conversation context generated by the conversation between the customer service and the user;
[0015] A violation detection module, used for calling a large language model to further detect whether the text to be sent has a preset potential problem when the text to be sent does not hit a preset violation rule;
[0016] A reply text sending module, used for sending the text to be sent as a target reply text to the user when the text to be sent does not have a preset potential problem;
[0017] An optimization requirement description determination module, used to determine the optimization requirement description of the text to be sent when the text to be sent hits a preset violation rule or has a preset potential problem;
[0018] The alternative text generation module is used to input the text to be sent, the conversation context and the optimization requirement description into the optimization text generation model to obtain multiple alternative optimization texts, so that the customer service can determine the target reply text and send it to the user based on the multiple alternative optimization texts and the text to be sent.
[0019] On the other hand, a computer device provided to meet one of the purposes of the present application includes a central processing unit and a memory, and the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the customer service reply interception method described in the present application.
[0020] On the other hand, a computer program product provided to meet another purpose of the present application includes a computer program / instruction, which, when executed by a processor, implements the steps of the method described in any embodiment of the present application.
[0021] The technical solution of this application has many advantages, including but not limited to the following aspects:
[0022] This application combines preset violation rules and potential problems to achieve dual detection of texts to be sent, and realizes real-time interception and optimization of customer service replies to improve the quality of customer service replies and user satisfaction. Specifically, this application can perform real-time detection of texts to be sent, intercept them in time when the texts to be sent violate the rules, and provide multiple alternative optimized texts for customer service to choose and refer to after interception, helping customer service to determine a more appropriate reply in a short time, improving reply efficiency and user satisfaction.
[0023] In the process of real-time detection of texts to be sent, we first use preset violation rules to quickly identify obvious violations, and then further use the natural language understanding capabilities of the large language model to deeply detect whether there are potential problems in the texts to be sent from a semantic level. The combination of these two steps can achieve comprehensive, accurate and efficient detection of texts to be sent. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0025] Figure 1 The network architecture of the e-commerce platform exemplified in this application;
[0026] Figure 2 This is a flowchart of a typical embodiment of the customer service reply interception method of the present application;
[0027] Figure 3 This is a functional block diagram of the customer service reply interception device of this application;
[0028] Figure 4 A schematic diagram of the structure of a computer device used in this application. DETAILED DESCRIPTION
[0029] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0030] like Figure 1 In the network architecture shown, the e-commerce platform 82 is deployed on the Internet to provide corresponding services to its users. Similarly, the devices 80 of the merchant users of the e-commerce platform 82 and the devices 81 of the consumer users are also connected to the Internet to use the services provided by the e-commerce platform.
[0031] The exemplary e-commerce platform 82 provides supply and demand matching of products and / or services to the general public with the help of Internet infrastructure. In the e-commerce platform 82, products and / or services are provided as commodity information. To simplify the description, the concepts of commodity, product, etc. are used in this application to refer to the products and / or services in the e-commerce platform 82, which may specifically be physical products, digital products, tickets, service subscriptions, other offline services, etc.
[0032] In reality, all entities can access the e-commerce platform 82 as users, use various online services provided by the e-commerce platform 82, and achieve the purpose of participating in the business activities achieved by the e-commerce platform 82. These entities can be natural persons, legal persons or social organizations, etc. Corresponding to the two types of entities, merchants and consumers in business activities, the e-commerce platform 82 has two types of users, merchant users and consumer users. All entities in the product distribution chain in business activities, including manufacturers, sellers, retailers, logistics providers, etc., can use online services in the e-commerce platform 82 as merchant users, while consumers in business activities, including real or potential consumers, can use online services in the e-commerce platform 82 as their corresponding consumer users. In actual business activities, the same entity can act as both a merchant user and a consumer user, and this should be understood flexibly.
[0033] The infrastructure used to deploy the e-commerce platform 82 mainly includes the backend architecture and frontend equipment. The backend architecture runs various online services through the service cluster, including middleware or frontend services for the platform, services for consumers, services for merchants, etc., to enrich and improve its service functions; the frontend equipment mainly covers the terminal devices used by users to access the e-commerce platform 82 as clients, including but not limited to various mobile terminals, personal computers, point-of-sale devices, etc. For example, merchant users can enter product information for their online stores through their terminal devices 80, or generate their product information using the interfaces opened by the e-commerce platform; consumer users can access the webpage of the online store implemented by the e-commerce platform 82 through their terminal devices 81, trigger the shopping process through the shopping buttons provided on the webpage, and call various online services provided by the e-commerce platform 82 during the shopping process, so as to achieve the purpose of shopping orders.
[0034] In some embodiments, the e-commerce platform 82 may be implemented by a processing facility including a processor and a memory, the processing facility storing a set of instructions that, when executed, cause the e-commerce platform 82 to perform the e-commerce and support functions involved in the present application. The processing facility may be part of a server, client, network infrastructure, mobile computing platform, cloud computing platform, fixed computing platform, or other computing platform, and provides electronic components, merchant equipment, payment gateways, application developers, marketing channels, transportation providers, customer equipment, point-of-sale equipment, etc. of the e-commerce platform 82.
[0035] The e-commerce platform 82 can be implemented as online services such as cloud computing services, software as a service (SaaS), infrastructure as a service (IaaS), platform as a service (PaaS), desktop as a service (DaaS), hosted software as a service, mobile backend as a service (MBaaS), information technology management as a service (ITMaaS), etc. In some embodiments, the various functional components of the e-commerce platform 82 can be implemented to be suitable for operation on various platforms and operating systems. For example, for an online store, its administrator users enjoy the same or similar functions regardless of various embodiments such as iOS, Android, HomonyOS, or web pages.
[0036] The e-commerce platform 82 can realize the corresponding independent station for each merchant to run its corresponding online store, and provide the merchant with the corresponding business management engine instance for the merchant to establish, maintain and run one or more online stores in one or more independent stations. The business management engine instance can be used for content management, task automation and data management of one or more online stores, and various specific business processes of the online store can be configured through interfaces or built-in components to support the implementation of business activities. The independent station is the infrastructure of the e-commerce platform 82 with cross-border service functions. Merchants can maintain their online stores more centrally and autonomously based on the independent station. The independent station usually has a domain name and storage space dedicated to the merchant, and different independent stations are relatively independent. The e-commerce platform 82 can provide standardized or personalized technical support for a large number of independent stations, so that merchant users can customize their own business management engine instance and use this business management engine instance to maintain one or more online stores they own.
[0037] The online store can implement backend configuration and maintenance by having the merchant user log in to its business management engine instance as an administrator. With the support of various online services provided by the infrastructure of the e-commerce platform 82, the merchant user can configure various functions in its online store as an administrator, view various data, etc. For example, the merchant user can manage various aspects of its online store, such as viewing the online store's recent activities, updating the online store's product catalog, managing orders, recent visit activities, total order activities, etc.; the merchant user can also view more detailed information about the business and visitors to the merchant's online store by obtaining reports or metrics, such as showing a sales summary of the merchant's overall business, specific sales and participation data of active sales marketing channels, etc.
[0038] The e-commerce platform 82 may provide communication facilities and associated merchant interfaces for providing electronic communications and marketing, such as utilizing electronic message aggregation facilities to collect and analyze communication interactions between merchants, consumers, merchant devices, customer devices, point-of-sale devices, etc., aggregating and analyzing communications, such as for increasing the potential for providing product sales, etc. For example, a consumer may have a question related to a product, which may generate a dialogue between the consumer and the merchant (or an automated processor-based agent on behalf of the merchant), where the communication facility is responsible for interacting and providing the merchant with analysis on how to increase the probability of a sale.
[0039] In some embodiments, an application suitable for installation in a terminal device can be provided to serve the access needs of different users, so that various users can access the e-commerce platform 82 by running the application in the terminal device, such as the merchant backend module of the online store in the e-commerce platform 82, etc. In the process of implementing business activities through these functions, the e-commerce platform 82 can implement various functions related to supporting the implementation of business activities as middleware or online services and open corresponding interfaces, and then implant the toolkit corresponding to the interface access function into the application to implement function expansion and task implementation. The business management engine can include a series of basic functions, and expose these functions to online services and / or application calls through APIs. Online services and applications use corresponding functions by remotely calling corresponding APIs.
[0040] With the support of various components of the business management engine instance, the e-commerce platform 82 can provide online shopping functions, enabling merchants to establish connections with customers in a flexible and transparent manner. Consumer users can select items online, create product orders, provide the delivery address of the goods in the product order, and complete the payment confirmation of the product order. Then, the merchant can review and complete or cancel the order. The review component carried by the business management engine instance can realize the compliance use of business processes to ensure that the order is suitable for fulfillment before actual fulfillment. Orders may sometimes be fraudulent and need to be verified (such as ID card checks). There is a payment method that requires merchants to wait to ensure that funds are received, which can play a role in preventing such risks, etc. Order risks may be generated by fraud detection tools submitted by third parties through order risk APIs, etc. Before fulfillment, merchants may need to obtain payment information or wait to receive payment information in order to mark the order as paid, so that the merchant can prepare to deliver the product. Such situations can be reviewed accordingly. The review process can be implemented by the fulfillment component. Merchants can use the fulfillment component to review, adjust work, and trigger related fulfillment services, such as: manual fulfillment services, which are used when merchants pick and pack products in boxes, purchase shipping labels and enter their tracking numbers, or simply mark items as fulfilled; custom fulfillment services, which can define email notifications; API fulfillment services, which can trigger third-party applications to create fulfillment records in third parties; legacy fulfillment services, which can trigger custom API calls from the business management engine to third parties; gift card fulfillment services. You can provide the generation of numbers and activate gift cards. Merchants can use the order printer application to print shipping orders. The fulfillment process can be executed when the items are packed in boxes and ready for shipping, tracking, delivery, consumer receipt verification, etc.
[0041] It can be seen that the services provided by the e-commerce platform are based on products. The corresponding commodity data is the basic data of the e-commerce platform. The commodity information is provided through commodity data. The mining and utilization of commodity data is the basis for realizing various technical services, including using the user transaction data and commodity data in the commodity data of the e-commerce platform to provide basic services for the operation of the data processing system. Therefore, the data processing system can run on any one or more servers of the e-commerce platform's cluster, so as to realize various functions by using the various commodity data provided by the e-commerce platform.
[0042] A customer service reply interception method of the present application can be programmed as a computer program product and deployed in a client or server for execution. For example, in the exemplary application scenario of the present application, it can be deployed and implemented in a server of an e-commerce customer service platform, thereby accessing an interface opened after the computer program product is running and performing human-computer interaction with the process of the computer program product through a graphical user interface to execute the method.
[0043] See also Figure 2 The customer service reply interception method of the present application, in its typical embodiment, includes the following steps:
[0044] Step S5100: respond to the customer service reply event, obtain the text to be sent of the event and the conversation context generated by the conversation between the customer service and the user;
[0045] The e-commerce platform can provide e-commerce customer service services, and provide users with multiple entrances for using e-commerce customer service services, for example: integrating real-time chat windows, customer service links, customer service icons, customer buttons, etc. in the website or mobile application carrying the e-commerce platform, and users can use the e-commerce customer service services through any of the said entrances to consult the corresponding e-commerce customer service. When the user uses the e-commerce customer service service, the e-commerce platform creates a conversation window between the user and the e-commerce customer service so that the user can consult the questions he wants to know through the conversation window, and then the conversation context generated by the user and the customer service conversation can be obtained, and the present application monitors the customer service reply event in real time. In one embodiment, the interception logic is embedded in the customer service message sending interface. When the customer service enters the text to be sent and clicks the reply send button, the interception logic will be called to detect the text to be sent. The present application obtains the text to be sent of the customer service reply event by responding to the customer service reply event, and obtains the conversation context generated by the conversation between the customer service and the user to ensure that the text to be sent can reflect the background and context of the current conversation. The conversation context includes the historical conversation content between the customer service and the user. Specifically, the conversation context refers to the conversation record between the customer service and the user before the current customer service reply event occurs. The conversation record includes information such as questions raised by the user and the customer service reply. The purpose of the conversation context is to provide more background information to better understand the current conversation situation and to more accurately modify the text to be sent.
[0046] Step S5200: When the text to be sent does not match the preset violation rule, calling the large language model to further detect whether the text to be sent has a preset potential problem;
[0047] After obtaining the text to be sent and the conversation context generated by the conversation between the customer service and the user, the text to be sent is matched with the preset violation rules. The violation rules are a series of rules pre-defined based on actual business scenarios and user feedback, covering sensitive words, improper expressions, legal risks, service specifications and other aspects. For example, the preset violation rules may include prohibiting the use of insulting language, avoiding privacy information, prohibiting the release of false information, etc. In one embodiment, the text to be sent is quickly matched by a rule engine, which will segment and vectorize the text and calculate the similarity between the text fragment and the keyword set in the rule. If the text to be sent does not match the violation judgment rule, it is determined that the text to be sent does not hit the preset violation rule. For the specific judgment steps, please refer to the subsequent specific implementation method, which will not be repeated here.
[0048] In another embodiment, a preset violation rule is obtained, and the violation rule includes a manually defined sensitive word library, an inappropriate expression template, and a reply disabling rule in a specific scenario. The text to be sent is directly input into the large language model, and the natural language understanding ability of the large language model is used to perform a multi-dimensional analysis of the text to be sent. Specifically, the large language model will perform semantic analysis on the text to be sent, identify the keywords, semantic structures, and potential intentions therein, and compare them with the preset violation rules. For example, the large language model will detect whether the text to be sent contains words in the sensitive word library, whether it conforms to the semantic pattern in the inappropriate expression template, or whether the reply disabling rule in a specific scenario is triggered. If the text to be sent does not find content that matches the violation rule during the semantic analysis process, it is determined that the text to be sent does not hit the preset violation rule, and the large language model is called to further detect whether there are preset potential problems in the text to be sent.
[0049] In another embodiment, the large language model can analyze potential problems of the text to be sent from a semantic level. The text to be sent and the preset potential problem detection rules are input into the problem detection prompt text to generate a problem detection prompt instruction. The potential problem detection rules are defined based on business needs and actual scenarios, and the potential problem detection rules cover a variety of potential problem types that may affect user experience or cause problems. For example, the potential problem detection rules include semantic fuzziness rules, which are used to detect whether the text to be sent has unclear expressions and unclear semantics; inappropriate tone rules, which are used to detect whether the text to be sent uses an overly blunt, indifferent or unfriendly tone; missing information rules, which are used to detect whether the text to be sent lacks necessary background information or solution details; potential misleading rules, which are used to detect whether the text to be sent may cause user misunderstandings or negative emotions. The large language model combines the semantics of the text to be sent and the potential problem detection rules to determine whether there are potential problems corresponding to the potential problem detection rules. For specific judgment steps, please refer to the subsequent specific implementation methods, which will not be repeated here.
[0050] Through this dual detection mechanism, not only can obvious violations be quickly identified, but the accuracy and compliance of the response content can also be further ensured from a semantic level, thereby improving the quality of customer service responses and user satisfaction.
[0051] Step S5300: When the text to be sent does not have any preset potential problem, the text to be sent is sent to the user as a target reply text;
[0052] If the previous step determines that the text to be sent does not have any preset potential problems, the corresponding text to be sent is sent to the user as the target reply text. Specifically, if it is determined that the text to be sent does not have any preset potential problems, that is, the text to be sent does not contain any ambiguous, inappropriate or potentially misleading content at the semantic level, the text to be sent can be directly sent to the user as the target reply text. This step ensures the accuracy and compliance of the reply content, while avoiding unnecessary interception or delay, and improving the efficiency of customer service responses.
[0053] In one embodiment, in order to further improve the user experience, the text to be sent is formatted, such as adding appropriate punctuation, adjusting the paragraph structure, or highlighting key information, so that the reply content is clearer and easier to read. It is also possible to automatically add necessary background information or related links based on the conversation context to help users better understand the reply content. In this way, while ensuring compliance, it is possible to provide users with a high-quality reply experience, thereby improving user satisfaction and service efficiency.
[0054] Step S5400: When the text to be sent hits a preset rule of illegal behavior or has a preset potential problem, determining an optimization requirement description of the text to be sent;
[0055] According to the judgment result that the text to be sent hits the violation behavior rule or has a potential problem, the corresponding target violation judgment rule or target potential problem is determined. For example, if the text to be sent hits the corresponding violation behavior rule of "prohibiting the use of insulting language", the target violation judgment rule is the corresponding violation judgment rule; if the text to be sent has the potential problem of "semantic ambiguity", the target potential problem is "semantic ambiguity".
[0056] In one embodiment, the target violation judgment rule or target potential problem and the text to be sent are input into the optimization demand generation prompt text to generate the optimization demand generation instruction. The optimization demand generation prompt text is pre-defined based on the business scenario and actual needs, and is intended to guide the large language model to generate a specific optimization demand description. The generated optimization demand description is intended to provide clear guidance for subsequent text optimization, ensuring that the reply content can better meet user needs and comply with business specifications. For example, the optimization demand generation prompt text includes "Please generate the optimization demand description according to the following violation judgment rules: No insulting language is allowed" or "Please generate the optimization demand description according to the following potential problems: semantic ambiguity". The optimization demand generation instruction is input into the large language model to control the large language model to generate the corresponding optimization demand description according to the target violation judgment rule or target potential problem. For example, the generated optimization demand description may be "Please modify the text to be sent to avoid using insulting language" or "Please clarify the semantics of the text to be sent to ensure clear expression". In this way, clear guidance can be provided for the subsequent optimization text generation to ensure that the optimized reply text meets compliance requirements and improves user experience.
[0057] Step S5500: input the text to be sent, the conversation context and the optimization requirement description into the optimization text generation model to obtain multiple candidate optimization texts, so that the customer service can determine the target reply text to send to the user based on the multiple candidate optimization texts and the text to be sent.
[0058] After determining the optimization requirement description of the text to be sent, the text to be sent, the conversation context, and the optimization requirement description are passed as input to the pre-trained optimization text generation model. The optimization text generation model is built on a large language model and has powerful natural language generation capabilities. It can generate multiple candidate optimization texts based on the input content for customer service selection and reference.
[0059] Specifically, the text to be sent, the conversation context, and the optimization requirement description are integrated into an input prompt, for example: "Please generate multiple candidate optimization texts based on the following text to be sent, conversation context, and optimization requirement description: [text to be sent], [conversation context], [optimization requirement description]". The input prompt is passed to the optimization text generation model to control the optimization text generation model to generate multiple candidate optimization texts. The generated candidate optimization texts will be improved for specific problems in the optimization requirement description, such as adjusting semantic expression, supplementing background information, optimizing tone and style, etc., while maintaining coherence and consistency with the conversation context.
[0060] The generated alternative optimization texts can be set to 3 to 5, and each alternative optimization text represents a different optimization direction. For example, one alternative text focuses more on semantic clarity, another alternative text focuses more on expression friendliness, and the third alternative text focuses more on information completeness. These alternative optimization texts provide customer service with a variety of choices, helping them find the most appropriate reply content in a short time.
[0061] After generating the alternative optimized texts, these alternative optimized texts are presented to the customer service for selection based on the actual situation. The customer service can compare the alternative optimized texts with the original text to be sent, and select the most appropriate target reply text to send to the user based on the conversation context and user needs. If the customer service believes that the alternative optimized text still needs further adjustment, the alternative text can be manually modified or regenerated. In this way, not only the efficiency of reply content generation is improved, but also flexible optimization options are provided for the customer service, ensuring that the reply text finally sent can better meet user needs and improve user experience.
[0062] It can be known from the typical embodiments of the present application that the technical solution of the present application has many advantages, including but not limited to the following aspects:
[0063] This application builds a complete closed-loop process from customer service response event response to final reply text generation, and ensures the compliance, accuracy and user satisfaction of customer service replies through multi-level detection, optimization and generation mechanisms. By responding to customer service reply events, the text to be sent and the conversation context are obtained, providing comprehensive background information for subsequent detection and optimization. Then, through the dual detection mechanism of the rule engine and the large language model, the text to be sent is quickly matched and deeply semantically analyzed, which can not only quickly identify obvious violations, but also further ensure the accuracy and compliance of the reply content from a semantic level. If the text to be sent does not hit the violation rules and there are no potential problems, it is directly sent to the user as the target reply text, which improves the reply efficiency; if the violation rules are hit or there are potential problems, an optimization requirement description is generated to provide clear guidance for subsequent text optimization. Then the text to be sent, the conversation context and the optimization requirement description are input into the optimization text generation model to generate multiple alternative optimization texts for customer service selection and reference. These alternative optimized texts not only improve the specific problems in the optimization requirement description, but also maintain coherence and consistency with the conversation context, providing customer service with a variety of options to help them find the most appropriate reply content in a short time. This not only significantly improves the compliance and accuracy of customer service replies, but also provides customer service with flexible optimization options by optimizing the efficient generation capabilities of the text generation model, ensuring that the final reply text sent can better meet user needs and improve user experience.
[0064] Different from the traditional customer service reply quality inspection method, this application combines preset violation rules and potential problems to achieve dual inspection of the text to be sent, and realizes real-time interception and optimization of customer service replies to improve the quality of customer service replies and user satisfaction. Specifically, this application can perform real-time inspection of the text to be sent, intercept it in time when the text to be sent violates the rules, and provide multiple alternative optimized texts for customer service to choose and refer to after interception, helping customer service to determine a more appropriate reply in a short time, improving reply efficiency and user satisfaction.
[0065] In the process of real-time detection of texts to be sent, we first use preset violation rules to quickly identify obvious violations, and then further use the natural language understanding capabilities of the large language model to deeply detect whether there are potential problems in the texts to be sent from a semantic level. The combination of these two steps can achieve comprehensive, accurate and efficient detection of texts to be sent.
[0066] In a further embodiment, when the text to be sent does not hit a preset violation rule, calling a large language model to further detect whether the text to be sent has a preset potential problem includes the following steps:
[0067] Step S5210: obtaining the preset violation rules, wherein the violation rules include a plurality of violation determination rules;
[0068] Before the implementation of the embodiment of the present application, the preset violation rules are preloaded and obtained. The violation rules are formulated based on business needs and actual scenarios, covering violation judgment criteria in multiple dimensions, aiming to ensure the compliance and security of customer service reply content. Violation rules are usually defined and maintained by the platform operation team or legal compliance department based on relevant laws and regulations, industry standards and user feedback.
[0069] Specifically, the violation rules include multiple violation determination rules, each of which corresponds to a specific violation type. For example, the violation determination rules include sensitive word rules, legal risk rules, service specification rules, and user experience rules. Among them, the sensitive word rules define sensitive words or phrases that are prohibited from use, such as insulting language, discriminatory expressions, politically sensitive content, etc.; the legal risk rules cover content that may cause legal disputes, such as false propaganda, privacy infringement, and disclosure of commercial secrets; the service specification rules involve the basic norms of customer service replies, such as avoiding the use of vague expressions, prohibiting shirking of responsibility, and avoiding excessive promises; the user experience rules focus on whether the reply content may cause user dissatisfaction or misunderstanding, such as stiff tone, unclear expression, incomplete information, etc.
[0070] The preset violation rules can be used to determine whether the text to be sent contains violations corresponding to the violation rules, providing a basis for subsequent further detection.
[0071] Step S5220: input the text to be sent into a rule engine, and the rule engine performs a matching operation on the text to be sent according to a preset violation rule;
[0072] The rule engine is the core component used to perform violation rule matching, and can efficiently match the text to be sent with the violation rules.
[0073] In one embodiment, after obtaining the text to be sent, the text to be sent is input into a pre-configured rule engine for matching operations. Specifically, the rule engine first pre-processes the input text to be sent, including operations such as word segmentation and vectorization. The word segmentation operation splits the text to be sent into multiple independent text fragments, such as words or phrases; the vectorization operation converts the text fragments after word segmentation into numerical feature vectors to match the violation rules. Then the rule engine compares these text fragment feature vectors with the keyword set in the preset violation rules one by one. The keyword set in the violation rules is usually composed of sensitive words, phrase templates or regular expressions, and each keyword corresponds to a specific violation type. The rule engine calculates the similarity value between the text fragment feature vector of the text to be sent and each keyword vector in the keyword set, for example, using methods such as cosine similarity or edit distance. If a text fragment matches a keyword in the keyword set, the rule engine records the matching result and finally determines that the text to be sent hits the preset violation rule.
[0074] If the text to be sent does not match any violation determination rules, the rule engine will output a matching result and trigger a subsequent call to the large language model to further detect whether the text to be sent has preset potential problems. For the specific steps, please refer to the subsequent specific implementation method, which will not be repeated here.
[0075] Through this matching operation based on the rule engine, obvious violations can be quickly identified in a short period of time, providing a basis for further detection. At the same time, the efficiency and accuracy of the rule engine also ensure the stable operation of the customer service response interception mechanism.
[0076] Step S5230: If the text to be sent does not match any of the violation determination rules in the violation rules, it is determined that the text to be sent does not hit the preset violation rules, and the large language model is called to further detect whether the text to be sent has any preset potential problems.
[0077] After the rule engine completes the matching operation, if the text to be sent does not match any of the violation judgment rules in the preset violation rules, it is determined that the text to be sent does not hit the preset violation rules. At this time, the text to be sent will not be directly output to the user, but the large language model will be further called for deeper detection to ensure the accuracy and compliance of the reply content.
[0078] In actual e-commerce customer service scenarios, the text to be sent can be the reply text entered by the customer service when handling user complaints or disputes. For example, after purchasing a product, the user questions the quality of the product and uses emotional or offensive language. At this time, the customer service will reply with a reply text (i.e., the text to be sent) that says "Please stay calm and avoid using inappropriate language." Although the reply text is intended to guide users to communicate rationally, it has problems such as inappropriate tone or unfriendly expression. Specifically, the text to be sent and the preset potential problem detection rules are input into the problem detection prompt text to generate a problem detection prompt instruction. The problem detection prompt text is a preset template used to guide the large language model to detect potential problems. For example, the problem detection prompt instruction may be: "Please analyze the following text to see if there are potential problems such as semantic ambiguity, inappropriate expression, or potential misunderstandings of users: [text to be sent]".
[0079] In one embodiment, by embedding the text to be sent and the potential problem detection rules into the problem detection prompt text, a complete problem detection prompt instruction can be generated. For example, for the text to be sent "Please keep calm and avoid using inappropriate language", the generated prompt instruction is: "Please analyze whether there are potential problems such as inappropriate tone, unfriendly expression, or possible misunderstandings of users based on the following text to be sent and potential problem detection rules: Please keep calm and avoid using inappropriate language.". The problem detection prompt instruction is then input into the large language model, and the large language model is controlled to perform potential problem detection on the text to be sent according to the potential problem detection rules, and output the corresponding potential problems. For example, the text to be sent "Please keep calm and avoid using inappropriate language." has the potential problem of unfriendly expression.
[0080] Through this dual detection mechanism, not only can obvious violations be quickly identified, but the accuracy and compliance of the response content can also be further ensured from a semantic level, thereby improving the quality of customer service responses and user satisfaction.
[0081] In this embodiment, through the dual detection mechanism of the rule engine and the large language model, a comprehensive and accurate detection of the text to be sent is achieved. The preset violation rules cover multiple dimensions of violation judgment criteria, ensuring the comprehensiveness and compliance of the detection. The text to be sent is input into the rule engine, and through operations such as word segmentation, vectorization and similarity calculation, it is matched with the keyword set in the violation rules to quickly identify obvious violations. If the text to be sent does not match the violation judgment rules, the large language model is called for a deeper semantic analysis to determine whether there are preset potential problems. The large language model uses problem detection prompt instructions and combines potential problem detection rules to perform multi-dimensional semantic analysis on the text to be sent, such as whether the semantics are clear, whether the tone is friendly, whether the information is complete, and whether it may cause user misunderstandings. This dual detection mechanism can not only quickly identify obvious violations, but also further ensure the accuracy and compliance of the reply content through the deep semantic analysis of the large language model, significantly improving the quality of customer service replies and user satisfaction.
[0082] In a further embodiment, the text to be sent is input into a rule engine, and the rule engine performs a matching operation on the text to be sent according to a preset violation rule, including the following steps:
[0083] Step S5221, segmenting and vectorizing the text to be sent to obtain multiple text segment feature vectors;
[0084] After the text to be sent is input into the rule engine, the text is segmented. Segmentation is the process of splitting the text to be sent into multiple independent text fragments (such as words, phrases or sentence fragments) so that the subsequent matching operation can more accurately analyze the content of each fragment. The segmentation operation is usually based on natural language processing technology, such as using Chinese segmentation tools (such as Jieba) or English segmentation tools (such as NLTK) to split the text according to the grammatical structure of the language. After the segmentation is completed, each text fragment is vectorized. Vectorization is the process of converting text fragments into numerical feature vectors so that computers can process these text fragments efficiently. Vectorization is usually based on word embedding technology (such as Word2Vec, GloVe) or pre-trained language models (such as BERT, GPT) to map each text fragment into a high-dimensional vector space. These feature vectors can not only capture the semantic information of the text fragment, but also reflect its importance in the context. For example, for the text to be sent "Please do not use insulting language", the following text fragments may be obtained after segmentation: "please", "do not", "use", "insulting", "language". These text fragments are then converted into corresponding feature vectors. Through word segmentation and vectorization processing, the text to be sent is converted into multiple text fragment feature vectors, which provides a basis for subsequent similarity calculation and matching operations. These feature vectors can be efficiently compared with the keyword set in the violation rules, so as to quickly determine whether the text to be sent hits the preset violation rules.
[0085] Step S5222: Calculate similarity between the plurality of text segment feature vectors and each keyword vector in the keyword set corresponding to the violation rule to obtain a corresponding similarity value;
[0086] After completing the word segmentation and vectorization of the text to be sent, the similarity between each text segment feature vector and each keyword vector in the keyword set corresponding to the violation rule is calculated. Keywords are extracted from multiple violation determination rules in the violation rule to form a keyword set corresponding to the violation rule. In one embodiment, each keyword in the keyword set directly extracted from the violation rule can be expanded, including synonym expansion, variant expansion, etc., so as to add the expanded words or phrases to the keyword set to expand the keyword set.
[0087] Each keyword in the keyword set is also vectorized and converted into a corresponding feature vector. Then the feature vector of the text segment of the text to be sent is compared with each keyword in the keyword set one by one. Similarity calculation can use methods such as cosine similarity or Euclidean distance to measure the similarity between two vectors. Cosine similarity is a commonly used method to calculate the cosine similarity between the two vectors. If the calculation result is 0.95, it means that the two vectors are very similar; if the calculation result is 0.20, it means that the two vectors are less similar.
[0088] The similarity between each text segment feature vector and all keyword vectors in the keyword set is calculated, and each calculation result is recorded. These similarity values reflect the degree of match between the text segment to be sent and the keywords in the violation rules, providing a basis for subsequent judgment of whether the preset violation rules are hit.
[0089] Through this similarity calculation, it is possible to efficiently identify whether the text to be sent contains sensitive words or inappropriate expressions, thereby quickly determining whether further detection of potential problems is required.
[0090] Step S5223: compare the calculated similarity value with a preset similarity threshold to determine whether the text to be sent hits a preset violation rule.
[0091] After the similarity calculation is completed, the similarity value between each text segment feature vector and the keyword vector is compared with the preset similarity threshold. The similarity threshold is pre-set to determine whether the text to be sent hits the preset violation rules. The threshold is usually set based on business needs and actual scenarios, and is adjusted by the platform operation team or technical experts based on historical data and experience.
[0092] In one embodiment, each similarity value is compared with a preset similarity threshold value one by one. If a certain similarity value is greater than or equal to the preset similarity threshold value, it is determined that the text segment successfully matches the corresponding keyword, that is, it hits the preset violation rule. For example, assuming that the similarity threshold value is 0.85, and the similarity value between a certain text segment and the keyword is 0.92, it is determined that the text segment hits the violation rule.
[0093] This judgment mechanism based on similarity thresholds can quickly identify obvious illegal content in a short period of time, providing a basis for subsequent further detection. At the same time, the flexible setting of similarity thresholds also ensures detection accuracy and efficiency, and can adapt to the needs of different scenarios.
[0094] In this embodiment, the text to be sent is segmented, split into multiple independent text fragments, and these fragments are converted into numerical feature vectors through vectorization technology, thereby providing an efficient data basis for subsequent matching operations. Then, the similarity between these feature vectors and the keyword vectors in the keyword set corresponding to the violation rules is calculated, and the matching degree between the text fragment to be sent and the keyword is measured by methods such as cosine similarity or Euclidean distance, and the corresponding similarity value is recorded. Finally, the calculated similarity value is compared with the preset similarity threshold to determine whether the text to be sent hits the preset violation rules. This mechanism can not only quickly identify whether the text to be sent contains sensitive words or inappropriate expressions, but also ensure detection accuracy and efficiency through flexible threshold setting to meet the needs of different scenarios.
[0095] In a further embodiment, when the text to be sent does not hit a preset violation rule, calling a large language model to further detect whether the text to be sent has a preset potential problem includes the following steps:
[0096] Step S5240: When the text to be sent does not hit the preset violation rule, the text to be sent and the preset potential problem detection rule are input into the problem detection prompt text to obtain a problem detection prompt instruction;
[0097] After determining that the text to be sent does not hit the preset violation rules, the large language model is further called to perform a deeper detection to determine whether there are preset potential problems. Specifically, the preset potential problem detection rules are obtained. In one embodiment, the text to be sent and the potential problem detection rules are input into the problem detection prompt text to generate a problem detection prompt instruction. By embedding the text to be sent and the potential problem detection rules into the prompt text, a complete problem detection prompt instruction can be generated. For example, for the text to be sent "Please do not use insulting language", the generated prompt instruction "Please analyze whether there are potential problems such as semantic ambiguity, inappropriate tone or missing information based on the following text to be sent and potential problem detection rules: Please do not use insulting language."
[0098] In this way, the large language model is provided with clear detection targets and input content, ensuring that it can efficiently and accurately analyze whether the text to be sent has preset potential problems.
[0099] Step S5250: input the problem detection prompt instruction into the large language model, and control the large language model to determine whether the text to be sent has corresponding potential problems according to the potential problem detection rule.
[0100] After the problem detection prompt is generated, the instruction is input into the pre-trained large language model, which controls the large language model to perform a detailed analysis of the text to be sent according to the problem detection prompt and potential problem detection rules. The large language model has powerful natural language understanding and generation capabilities, and can deeply analyze the potential problems of the text from a semantic level.
[0101] Specifically, the large language model will combine the text to be sent in the problem detection prompt instruction and the potential problem detection rules to perform a multi-dimensional semantic analysis on the text to be sent. For example, the large language model will analyze whether the semantics of the text to be sent are clear, whether the tone is friendly, whether the information is complete, and whether it may cause user misunderstanding or negative emotions. The large language model will determine whether there are preset potential problems by capturing the deep semantic information of the text. For example, for the text to be sent "Please do not use insulting language", the large language model will perform operations based on the problem detection prompt instruction, including determining whether "Please do not use insulting language" clearly expresses the prohibited language type; determining whether "Please do not use insulting language" conveys a friendly tone to avoid users feeling ordered or accused. Analyze whether "Please do not use insulting language" may cause user misunderstanding.
[0102] Based on the detection results of the large language model, it is determined whether there are potential problems in the text to be sent. This deep detection mechanism based on the large language model can not only quickly identify obvious violations, but also further ensure the accuracy and compliance of the reply content from a semantic level, thereby improving the quality of customer service replies and user satisfaction.
[0103] In this embodiment, after determining that the text to be sent does not hit the preset violation rules, the text to be sent and the preset potential problem detection rules are further input into the problem detection prompt text to generate a problem detection prompt instruction. The problem detection prompt instruction provides a clear detection target and input content for the large language model, ensuring that it can efficiently and accurately analyze whether there are preset potential problems in the text to be sent. The problem detection prompt instruction is input into the large language model, and the control model performs a multi-dimensional semantic analysis of the text to be sent according to the potential problem detection rules, including whether the semantics are clear, whether the tone is friendly, whether the information is complete, and whether it may cause user misunderstandings or negative emotions. This can not only quickly identify obvious violations, but also further ensure the accuracy and compliance of the reply content through deep semantic analysis, significantly improving the quality of customer service replies and user satisfaction. Through this clear rule guidance and model deep analysis combined, it can provide more comprehensive detection support for customer service services, ensuring that the generated reply content is more in line with business specifications and user needs.
[0104] In a further embodiment, when the text to be sent hits a preset violation rule or has a preset potential problem, determining an optimization requirement description of the text to be sent includes the following steps:
[0105] Step S5410, in response to the determination result that the text to be sent hits the rule of illegal behavior or has the potential problem, determining the corresponding target illegal behavior determination rule or target potential problem;
[0106] During the detection process, if the text to be sent hits the preset violation rules, or the large language model detects that it has preset potential problems, the corresponding target violation judgment rules or target potential problems are determined based on the detection results. This technology is designed to provide clear guidance for subsequent text optimization to ensure that the reply content can better meet user needs and comply with business regulations.
[0107] In one embodiment, if the text to be sent and the potential problem detection rules are input into the large language model for detection, then a potential problem in the potential problem detection rules corresponding to the detection result is extracted as the target potential problem. If the text to be sent and the violation rules are used for matching, then a violation determination rule in the violation rules corresponding to the detection result is extracted. In this way, a clear input basis can be provided for the subsequent generation of optimization requirements, ensuring that the generated optimization requirement description can accurately reflect the specific problems of the text to be sent, thereby providing clear optimization guidance for customer service.
[0108] Step S5420: input the target violation determination rule or the target potential problem into the optimization demand generation prompt text to obtain the optimization demand generation instruction;
[0109] After determining the target violation judgment rule or target potential problem, input it into the preset optimization requirement generation prompt text to generate the optimization requirement generation instruction. The optimization requirement generation prompt text is a preset template used to guide the large language model to generate the optimization requirement description. By embedding the target violation judgment rule or target potential problem into the optimization requirement generation prompt text, a complete optimization requirement generation instruction can be generated. For example, the generated optimization requirement generation instruction may be:
[0110] “Please generate an optimization requirement description based on the following problem description and optimization goal: The text to be sent has a stiff tone and needs to be adjusted to make it more friendly and professional.”
[0111] In this way, clear input content and optimization goals are provided to the large language model, ensuring that it can generate accurate and clear descriptions of optimization requirements, providing strong support for subsequent text optimization.
[0112] Step S5430: input the optimization requirement generation instruction into the large language model, and control the large language model to generate a corresponding optimization requirement description according to the target violation determination rule or target potential problem.
[0113] After generating the optimization requirement generation instruction, the optimization requirement generation instruction is input into the pre-trained large language model, and the large language model is controlled to generate the corresponding optimization requirement description according to the optimization requirement generation instruction and the target violation judgment rule or target potential problem. The large language model has a strong natural language understanding and generation capability, and can generate clear and accurate optimization requirement descriptions based on the input content.
[0114] Specifically, the large language model will combine the target violation judgment rules or target potential problems and the text to be sent in the optimization demand generation instruction to generate a detailed optimization demand description. For example, for the optimization demand generation instruction "Please generate an optimization demand description based on the target violation judgment rules or target potential problems and the text to be sent: The text to be sent has a stiff tone and needs to be adjusted to be more friendly and professional", the large language model will generate the following optimization demand description "The tone of the text to be sent is too stiff. It is recommended to adjust the tone and use a more friendly and professional expression, such as changing 'Please do not use insulting language' to 'Thank you for your understanding, please avoid using inappropriate language so that we can better serve you'."
[0115] The generated optimization requirement description not only clarifies the specific issues that need to be optimized, but also provides specific optimization suggestions to help customer service quickly understand and implement optimization. In this way, the large language model can generate clear and specific optimization requirement descriptions based on the target violation judgment rules or target potential problems, providing clear optimization guidance for customer service, thereby improving the quality of reply content and user satisfaction.
[0116] In this embodiment, after detecting that the text to be sent hits the violation rules or has potential problems, the corresponding target violation judgment rules or target potential problems are first determined to provide a clear input basis for the subsequent optimization demand generation. Then the target violation judgment rules or target potential problems are input into the preset optimization demand generation prompt text to generate the optimization demand generation instructions, which provide clear optimization targets and input content for the large language model. Finally, the optimization demand generation instructions are input into the large language model, and the control model generates the corresponding optimization demand description according to the target violation judgment rules or target potential problems. This mechanism not only ensures the accuracy and pertinence of the optimization demand description, but also provides specific optimization suggestions through the natural language generation capabilities of the large language model. Through the implementation of this embodiment, clear optimization guidance can be provided to customer service to ensure that the generated reply content is more in line with business specifications and user needs.
[0117] In a further embodiment, the text to be sent, the conversation context and the optimization requirement description are input into the optimization text generation model to obtain a plurality of candidate optimization texts, so that the customer service can determine the target reply text according to the plurality of candidate optimization texts and the text to be sent and send it to the user, and the following steps are included:
[0118] Step S6100: Obtain the target reply text determined by the customer service, and use the target reply text and its corresponding text to be sent, conversation context, and optimization requirement description as a training instance;
[0119] After the customer service determines the target reply text based on multiple candidate optimized texts and the original text to be sent, the target reply text is automatically recorded and obtained. The target reply text is the reply content finally selected by the customer service, which is usually an optimized text that can better meet user needs and comply with business specifications.
[0120] The target reply text and its corresponding original text to be sent, the conversation context, and the optimization requirement description are integrated into a training instance. The training instance is a data unit used to optimize the training of the text generation model, which contains complete input and output information. Specifically, the training instance includes the target reply text, that is, the reply content finally determined by the customer service, as the output label of the model; the original text to be sent, that is, the text to be sent initially entered by the customer service, as one of the inputs of the model; the conversation context, that is, the conversation history between the customer service and the user, including the user's questions, the customer service's replies, etc., as one of the inputs of the model; and the optimization requirement description, which clarifies the specific problems and optimization directions of the text to be sent, as one of the inputs of the model.
[0121] For example, suppose the text to be sent that the customer service initially inputs is "Please do not use insulting language", and the corresponding generated optimization requirement description is "The tone is harsh, it is recommended to adjust the tone to make it more friendly and professional", and multiple alternative optimization texts are provided. The target reply text that the customer service finally chooses is "Thank you for your understanding, please avoid using inappropriate language so that we can better serve you". At this time, the target reply text and its corresponding original text to be sent, the conversation context, and the optimization requirement description are integrated into a training instance. In this way, the actual selection and optimization process of the customer service can be recorded as a training instance, providing high-quality data support for the subsequent optimization text generation model training. The training instance not only contains input and output information, but also reflects the optimization requirements and user feedback in actual business scenarios, which can help the model better learn how to generate high-quality reply content.
[0122] Step S6200: Collect multiple training instances to form a training data set. When the total number of training instances in the training data set is greater than a preset number threshold, construct a fine-tuning training set based on the training data set.
[0123] After obtaining multiple training instances, these training instances are integrated into a training data set. The training data set is the core data resource for optimizing the training of the text generation model, and contains a large number of training instances. Specifically, the training instances of customer service in actual work are continuously monitored and collected. Whenever the customer service determines a target reply text, the target reply text and its corresponding original text to be sent, the conversation context, and the optimization requirement description are integrated into a training instance and added to the training data set. In this way, high-quality training data can be continuously accumulated to support the continuous optimization of the model.
[0124] When the total number of training instances in the training data set reaches or exceeds the preset number threshold, a fine-tuning training set is constructed based on the training data set. The preset number threshold is set based on actual business needs and model training results, and is usually adjusted by the technical team based on historical data and experimental results. For example, if the threshold is set to 1,000 training instances, it means that when 1,000 or more training instances are accumulated in the training data set, the construction of the fine-tuning training set begins.
[0125] The fine-tuning training set is a dataset used to fine-tune the optimized text generation model, which contains high-quality training instances selected from the training dataset. According to the preset screening rules, a part of the training instances are selected from the training dataset to form the fine-tuning training set. In this way, the training data can be accumulated and utilized efficiently, providing strong support for the continuous improvement of the optimized text generation model. The construction of the fine-tuning training set not only ensures the diversity and high quality of the training data, but also lays a solid foundation for the fine-tuning training of the model.
[0126] Step S6300: fine-tune the optimized text generation model using a fine-tuning training set to obtain an optimized text generation model trained to a convergence state, which is used to input the text to be sent, the conversation context, and the optimization requirement description into the optimized text generation model to obtain multiple candidate optimized texts.
[0127] After constructing the fine-tuning training set, the pre-trained optimized text generation model is fine-tuned using the fine-tuning training set. Fine-tuning training is a further optimization method based on an existing model, which aims to fine-tune the model through a small amount of high-quality data to make it better suited to actual business scenarios.
[0128] Specifically, the training instances in the fine-tuning training set are input into the optimized text generation model for supervised training. Each training instance contains the original text to be sent, the conversation context, the optimization requirement description, and the target reply text, providing clear input and output labels for the optimized text generation model. During the training process, the optimized text generation model generates alternative optimized texts based on the input content, compares them with the target reply text, and calculates the loss function (such as cross entropy loss). Through the back-propagation algorithm, the optimized text generation model continuously adjusts its parameters to minimize the loss function, thereby improving the accuracy and quality of the generated text.
[0129] The goal of fine-tuning training is to enable the optimization text generation model to better understand the optimization requirement description and generate alternative optimization texts that meet business specifications and user needs. Through continuous iterative training, the optimization text generation model will gradually optimize its generation ability until the performance of the optimization text generation model is no longer significantly improved, that is, it reaches a convergence state. In this way, the performance of the optimization text generation model can be continuously improved, so that it can generate higher quality alternative optimization texts in practical applications. Fine-tuning training can not only enable the model to better adapt to business needs, but also significantly improve the efficiency of customer service replies and user satisfaction. It should be noted that the model trained by fine-tuning is used to execute the corresponding steps in step S5500: the text to be sent, the conversation context and the optimization requirement description are input into the optimization text generation model to obtain multiple alternative optimization texts. To generate alternative optimization texts that meet business specifications and user needs.
[0130] In this embodiment, not only can high-quality training data be accumulated efficiently, but also the generation ability and adaptability of the model can be continuously improved through fine-tuning training, so that the generated alternative optimized texts are more in line with business specifications and user needs. Specifically, by integrating the target reply text actually selected by the customer service and its corresponding to-be-sent text, conversation context and optimization requirement description into training instances, it is possible to provide the model with real and diverse training data, significantly improving the generalization ability and generation quality of the optimized text generation model. At the same time, by continuously collecting training instances and constructing fine-tuning training sets, the optimized text generation model can continuously learn from practical applications to form a dynamic closed-loop optimization mechanism. This mechanism enables the optimized text generation model to quickly adapt to changes in business needs and continuously improve according to actual feedback, thereby improving the accuracy of the generated text and user satisfaction. Finally, by continuously optimizing the optimized text generation model, the generated alternative optimized texts are more in line with user needs and business specifications, thereby significantly improving the efficiency and user satisfaction of customer service replies.
[0131] In a further embodiment, the text to be sent, the conversation context and the optimization requirement description are input into an optimization text generation model to obtain a plurality of candidate optimization texts, so that the customer service can determine the target reply text according to the plurality of candidate optimization texts and the text to be sent and send it to the user, including:
[0132] Step S7100: When the user's satisfaction score for the target reply text is less than a preset score threshold, collect the user's feedback content to determine the corresponding optimization requirement description;
[0133] After the customer service sends the target reply text to the user, the user's satisfaction score for the reply is monitored in real time. The satisfaction score is usually collected through the feedback button or rating system provided by the user in the dialogue window. For example, the user can choose "very satisfied", "satisfied", "average", "unsatisfied" or "very unsatisfied" and other options. The preset scoring threshold is a critical value used to determine whether the user satisfaction reaches the expected standard. For example, the scoring threshold can be set to "satisfied" or "average". It can also be a specific scoring value, which does not affect the embodiment of the creative spirit of this application.
[0134] When the user's satisfaction score for the target reply text is less than the preset score threshold, the reply is judged to fail to meet the user's needs and the user feedback collection process is triggered. Specifically, the e-commerce platform prompts the user to provide specific feedback content, such as "Are you satisfied with this reply? If you have any suggestions or opinions, please let us know." Users can provide feedback content by text input or selecting preset options, such as "The reply content is not detailed enough", "The tone is too blunt" or "It failed to solve my problem". The user's feedback content is obtained to determine the corresponding optimization requirement description. For example, if the user feedback "The reply content is not detailed enough", the optimization requirement description "Add more background information or solution details" is generated; if the user feedback "The tone is too blunt", the optimization requirement description "Adjust the tone to make it more friendly and professional" is generated. In this way, a clear optimization requirement description can be generated based on the actual feedback of the user, providing guidance for subsequent text optimization.
[0135] This optimized demand description generation mechanism based on user feedback can not only help to better understand user needs, but also provide high-quality training data for optimizing text generation models, thereby improving the model's generation capabilities and user satisfaction.
[0136] Step S7200: Obtain a manual reply text version corresponding to the optimization requirement description fed back by the user, and form a text generation instance with the optimization requirement description and its corresponding manual reply text version, the text to be sent, and the conversation context;
[0137] After collecting user feedback and generating an optimization requirement description, a manual reply text version corresponding to the optimization requirement description is further obtained. The manual reply text version is usually manually written or adjusted by a human customer service or operation team based on user feedback and optimization requirement description to generate high-quality reply content.
[0138] Specifically, the user's feedback content and optimization requirement description are sent to the manual customer service or operation team, prompting them to generate a manual reply text version that better meets the user's needs based on the feedback content. For example, if the user's feedback content is "the reply content is not detailed enough", the manual customer service may add more background information or solution details to generate a more detailed manual reply text version. The manual reply text version is integrated with the optimization requirement description, the original text to be sent, and the conversation context into a text generation instance. In this way, the user's feedback content and the optimization process of the manual customer service can be recorded as high-quality text generation instances, providing strong support for the training of the optimization text generation model.
[0139] Step S7300, calling multiple text generation instances to fine-tune the optimized text generation model, obtaining an optimized text generation model trained to a convergence state, which is used to input the text to be sent, the conversation context and the optimization requirement description into the optimized text generation model to obtain multiple candidate optimized texts.
[0140] After obtaining multiple text generation instances, these text generation instances are used to fine-tune the optimized text generation model. Specifically, the input information in the text generation instance (such as the original text to be sent, the conversation context and the optimization requirement description) is input into the optimized text generation model to generate alternative optimized texts. Then the generated alternative optimized text is compared with the output label (such as the manual reply text version) in the text generation instance, and the loss function (such as the cross entropy loss) is calculated. Through the back propagation algorithm, the model will continuously adjust its parameters to minimize the loss function, thereby improving the accuracy and quality of the generated text. In this way, the performance of the optimized text generation model is continuously improved, so that it can generate higher quality alternative optimized texts in practical applications. It should be noted that the model trained by fine-tuning is used to execute the corresponding steps in step S5500: the text to be sent, the conversation context and the optimization requirement description are input into the optimized text generation model to obtain multiple alternative optimized texts. To generate alternative optimized texts that meet business specifications and user needs.
[0141] In this embodiment, a dynamic optimization mechanism based on user feedback is used. By monitoring the user's satisfaction score for the target reply text in real time and collecting the user's specific feedback content, the optimization demand description can be dynamically generated. This mechanism can directly reflect the user's real needs, avoid the limitations of relying only on preset rules or model generation in traditional methods, and thus significantly improve the accuracy and pertinence of the optimization demand description. At the same time, the manual reply text version corresponding to the optimization demand description fed back by the user is obtained, and the optimization demand description and its corresponding manual reply text version, the text to be sent, and the dialogue context constitute a text generation instance, which further enhances the training data quality of the optimization text generation model. The manual reply text version is usually manually written or adjusted by the manual customer service or operation team according to the user's feedback content and the optimization demand description, which has higher professionalism and user orientation, and can provide high-quality reference samples for the model. Finally, multiple text generation instances are called to fine-tune the optimization text generation model, and the loss function is calculated and the model parameters are adjusted by comparing the generated alternative optimization text with the manual reply text version, so that the model is continuously optimized to generate alternative optimization texts that are more in line with user needs and business specifications. This closed-loop optimization mechanism based on user feedback not only improves the model's generation capabilities and user satisfaction, but also provides reliable data support for the continuous improvement of the model, enabling it to better adapt to complex business scenarios and diverse user needs in practical applications.
[0142] See also Figure 3, a customer service reply interception device provided to adapt to one of the purposes of the present application is a functional embodiment of the customer service reply interception method of the present application. On the other hand, the device is a customer service reply interception device provided to adapt to one of the purposes of the present application, including a text acquisition module 5100, a violation detection module 5200, a reply text sending module 5300, an optimization requirement description determination module 5400 and an alternative text generation module 5500, wherein the text acquisition module 5100 is used to respond to the customer service reply event, obtain the text to be sent of the event and the dialogue context generated by the dialogue between the customer service and the user; the violation detection module 5200 is used to call the large language model for further detection when the text to be sent does not hit the preset violation behavior rule The method comprises the following steps: testing whether the text to be sent has preset potential problems; a reply text sending module 5300 is used to send the text to be sent as a target reply text to the user when the text to be sent does not have preset potential problems; an optimization requirement description determination module 5400 is used to determine the optimization requirement description of the text to be sent when the text to be sent hits the preset violation rules or has preset potential problems; an alternative text generation module 5500 is used to input the text to be sent, the conversation context and the optimization requirement description into an optimization text generation model to obtain multiple alternative optimization texts, so that the customer service can determine the target reply text and send it to the user based on the multiple alternative optimization texts and the text to be sent.
[0143] In a further embodiment, the violation detection module 5200 includes: a violation rule acquisition submodule, used to obtain the preset violation rules, the violation rules including multiple violation determination rules; a text matching submodule, used to input the text to be sent into a rule engine, and the rule engine performs a matching operation on the text to be sent according to the preset violation rules; a violation determination submodule, used to determine that the text to be sent does not hit the preset violation rules if the text to be sent does not match the violation determination rules in the violation rules, and call the large language model to further detect whether the text to be sent has preset potential problems.
[0144] In a further embodiment, the text matching submodule includes: a text vectorization submodule, which is used to segment and vectorize the text to be sent to obtain multiple text fragment feature vectors; a similarity calculation submodule, which is used to calculate the similarity between the multiple text fragment feature vectors and each keyword vector in the keyword set corresponding to the violation rule to obtain a corresponding similarity value; a similarity comparison submodule, which is used to compare the calculated similarity value with a preset similarity threshold to determine whether the text to be sent hits the preset violation rule.
[0145] In a further embodiment, the violation detection module 5200 includes: a prompt instruction generation submodule, which is used to input the text to be sent and the preset potential problem detection rules into the problem detection prompt text when the text to be sent does not hit the preset violation behavior rules, so as to obtain a problem detection prompt instruction; a problem detection submodule, which is used to input the problem detection prompt instruction into the large language model, and control the large language model to determine whether the text to be sent has corresponding potential problems according to the potential problem detection rules.
[0146] In a further embodiment, the optimization requirement description determination module 5400 includes: a violation determination submodule, which is used to respond to the determination result that the text to be sent hits the violation behavior rule or the potential problem exists, and determine the corresponding target violation determination rule or target potential problem; an instruction generation submodule, which is used to input the target violation determination rule or the target potential problem into the optimization requirement generation prompt text to obtain the optimization requirement generation instruction; and an optimization requirement generation submodule, which is used to input the optimization requirement generation instruction into the large language model, and control the large language model to generate the corresponding optimization requirement description according to the target violation determination rule or the target potential problem.
[0147] In a further embodiment, the alternative text generation module 5500 includes: a training instance construction submodule, which is used to obtain the target reply text determined by the customer service, and to form a training instance with the target reply text and its corresponding text to be sent, the conversation context and the optimization requirement description; a fine-tuning training set construction submodule, which is used to collect multiple training instances to form a training data set, and when the total number of training instances in the training data set is greater than a preset number threshold, a fine-tuning training set is constructed based on the training data set; a first model training submodule, which is used to use the fine-tuning training set to perform fine-tuning training on the optimized text generation model to obtain an optimized text generation model trained to a convergence state, and to execute the input of the text to be sent, the conversation context and the optimization requirement description into the optimized text generation model to obtain multiple alternative optimized texts.
[0148] In a further embodiment, the alternative text generation module 5500 includes: a user feedback content collection submodule, which is used to collect user feedback content when the user's satisfaction score for the target reply text is less than a preset score threshold to determine the corresponding optimization requirement description; a manual reply version acquisition submodule, which is used to obtain the manual reply text version corresponding to the optimization requirement description of the user's feedback, and the optimization requirement description and its corresponding manual reply text version, the text to be sent, and the dialogue context constitute a text generation instance; a second model training submodule, which is used to call multiple text generation instances to fine-tune the optimization text generation model to obtain an optimization text generation model trained to a convergence state, and to execute the input of the text to be sent, the dialogue context and the optimization requirement description into the optimization text generation model to obtain multiple alternative optimization texts.
[0149] In order to solve the above technical problems, the present application also provides a computer device. Figure 4 As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor may implement a customer service reply interception method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor may execute the customer service reply interception method of the present application. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0150] In this embodiment, the processor is used to execute Figure 3 The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all modules / submodules in the customer service reply interception device of this application, and the server can call the program code and data of the server to execute the functions of all submodules.
[0151] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the customer service reply interception method of any embodiment of the present application.
[0152] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0153] In summary, this application can provide users with timely and accurate responses.
[0154] It will be understood by those skilled in the art that the various operations, methods, steps, measures, and schemes in the processes discussed in this application may be alternated, changed, combined, or deleted. Furthermore, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be alternated, changed, rearranged, decomposed, combined, or deleted. Furthermore, the steps, measures, and schemes in the various operations, methods, and processes in the prior art that are open source and in this application may also be alternated, changed, rearranged, decomposed, combined, or deleted.
[0155] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A customer service reply interception method, characterized in that: The steps include: Respond to the customer service reply event, obtain the text to be sent for the event and the conversation context generated by the conversation between the customer service and the user; When the text to be sent does not hit the preset violation rule, calling the large language model to further detect whether the text to be sent has a preset potential problem; When the text to be sent does not have any preset potential problem, sending the text to be sent as a target reply text to the user; When the text to be sent hits a preset rule of illegal behavior or has a preset potential problem, determining an optimization requirement description of the text to be sent; The text to be sent, the conversation context and the optimization requirement description are input into the optimization text generation model to obtain multiple candidate optimization texts, so that the customer service can determine the target reply text to send to the user based on the multiple candidate optimization texts and the text to be sent.
2. The customer service reply interception method according to claim 1, characterized in that: When the text to be sent does not hit the preset violation rule, the large language model is called to further detect whether the text to be sent has a preset potential problem, including: Acquire the preset violation rules, wherein the violation rules include a plurality of violation determination rules; Inputting the text to be sent into a rule engine, and the rule engine performs a matching operation on the text to be sent according to a preset violation rule; If the text to be sent does not match any of the violation determination rules in the violation rules, it is determined that the text to be sent does not hit the preset violation rules, and the large language model is called to further detect whether the text to be sent has a preset potential problem.
3. The customer service reply interception method according to claim 2, characterized in that: The text to be sent is input into a rule engine, and the rule engine performs a matching operation on the text to be sent according to a preset violation rule, including: Segmenting and vectorizing the text to be sent to obtain multiple text segment feature vectors; Calculate similarity between the plurality of text segment feature vectors and each keyword vector in the keyword set corresponding to the violation rule to obtain a corresponding similarity value; The calculated similarity value is compared with a preset similarity threshold to determine whether the text to be sent hits the preset violation rule.
4. The customer service reply interception method according to claim 1, characterized in that: When the text to be sent does not hit the preset violation rule, the large language model is called to further detect whether the text to be sent has a preset potential problem, including: When the text to be sent does not hit the preset violation rule, the text to be sent and the preset potential problem detection rule are input into the problem detection prompt text to obtain a problem detection prompt instruction; The problem detection prompt instruction is input into the large language model, and the large language model is controlled to determine whether the text to be sent has corresponding potential problems according to the potential problem detection rule.
5. The customer service reply interception method according to claim 1, characterized in that: When the text to be sent hits a preset rule of illegal behavior or has a preset potential problem, determining an optimization requirement description of the text to be sent includes: In response to the determination result that the text to be sent hits the rule of illegal behavior or has the potential problem, determining the corresponding target illegal behavior determination rule or target potential problem; Inputting the target violation determination rule or the target potential problem into the optimization demand generation prompt text to obtain the optimization demand generation instruction; The optimization requirement generation instruction is input into the large language model, and the large language model is controlled to generate a corresponding optimization requirement description according to the target violation determination rule or target potential problem.
6. The customer service reply interception method according to any one of claims 1 to 5, characterized in that: The text to be sent, the conversation context and the optimization requirement description are input into the optimization text generation model to obtain multiple candidate optimization texts, so that the customer service can determine the target reply text according to the multiple candidate optimization texts and the text to be sent and send it to the user, including: Obtain the target reply text determined by the customer service, and use the target reply text and its corresponding text to be sent, conversation context, and optimization requirement description as a training instance; Collecting multiple training instances to form a training data set, and when the total number of training instances in the training data set is greater than a preset number threshold, constructing a fine-tuning training set based on the training data set; The optimized text generation model is fine-tuned using a fine-tuning training set to obtain an optimized text generation model that has been trained to a convergence state, and is used to input the text to be sent, the conversation context, and the optimization requirement description into the optimized text generation model to obtain multiple candidate optimized texts.
7. The customer service reply interception method according to any one of claims 1 to 5, characterized in that: The text to be sent, the conversation context and the optimization requirement description are input into the optimization text generation model to obtain multiple candidate optimization texts, so that the customer service can determine the target reply text according to the multiple candidate optimization texts and the text to be sent and send it to the user, including: When the user's satisfaction score for the target reply text is less than the preset score threshold, the user's feedback content is collected to determine the corresponding optimization demand description; Obtain a manual reply text version corresponding to the optimization requirement description fed back by the user, and use the optimization requirement description and its corresponding manual reply text version, the text to be sent, and the conversation context to form a text generation instance; Call multiple text generation instances to fine-tune the optimized text generation model to obtain an optimized text generation model trained to a convergence state, which is used to input the text to be sent, the conversation context and the optimization requirement description into the optimized text generation model to obtain multiple candidate optimized texts.
8. A customer service reply interception device, characterized in that: include: The text acquisition module is used to respond to the customer service reply event, obtain the text to be sent for the event and the conversation context generated by the conversation between the customer service and the user; A violation detection module, used for calling a large language model to further detect whether the text to be sent has a preset potential problem when the text to be sent does not hit a preset violation rule; A reply text sending module, used for sending the text to be sent as a target reply text to the user when the text to be sent does not have a preset potential problem; An optimization requirement description determination module, used to determine the optimization requirement description of the text to be sent when the text to be sent hits a preset violation rule or has a preset potential problem; The alternative text generation module is used to input the text to be sent, the conversation context and the optimization requirement description into the optimization text generation model to obtain multiple alternative optimization texts, so that the customer service can determine the target reply text and send it to the user based on the multiple alternative optimization texts and the text to be sent.
9. A computer device comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: It stores a computer program implemented according to the method described in any one of claims 1 to 7 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.