E-commerce customer service reply method and device, equipment and medium
By extracting the keyword sets in the user's question text and generating pseudo-reply texts, and combining with the knowledge base for matching, the problem that traditional e-commerce customer service response methods are difficult to accurately match user intentions is solved, efficient and accurate customer service responses are achieved, and operating costs are reduced.
Patent Information
- Application Number
- CN202411615310.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-07
AI Technical Summary
Traditional e-commerce customer service response methods are difficult to accurately match users' consultation intentions, resulting in the need of manual intervention and increase operational costs and service time.
By obtaining the question text in the conversation between the user and the e-commerce customer service, extracting the keyword set and generating pseudo-reply replies text, combining the document paragraphs in the preset knowledge base to generate the most relevant replies text.
It realizes accurate understanding and response to user consultation intentions, reduces the workload of manual customer service, reduces operating costs, and provides 24/7 uninterrupted services.
Smart Images

Figure CN119579181A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of e-commerce technology, and in particular to an e-commerce customer service reply method and its corresponding device, computer equipment, and computer-readable storage medium. Background Art
[0002] E-commerce customer service is a key component in the e-commerce ecosystem. It not only improves customers' shopping experience and ensures that user problems and concerns are resolved in a timely manner, but also plays a vital role in maintaining brand image, maintaining customer satisfaction and loyalty, and promoting sales conversions.
[0003] In traditional technology, the question texts that most users frequently consult are usually collected in advance, and the reply texts of these question texts are prepared. Therefore, when users consult e-commerce customer service, these question texts can be recommended to users for selection, and then the reply text corresponding to the question text selected by the user can be quickly pushed to the user. However, the number of question texts recommended to users is always limited, because users cannot spend a long time searching for question texts that match their consultation intentions. In addition, the consultation intentions of different users may be different, and even the consultation intentions of the same user at different times may be different. In other words, it is difficult to hit a variety of consultation intentions with limited recommended question texts, resulting in the frequent need for manual intervention to provide customer service.
[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 to provide an e-commerce customer service response method and its corresponding device, computer equipment, and computer program product.
[0006] In order to meet the various objectives of this application, this application adopts the following technical solutions:
[0007] An e-commerce customer service reply method provided to meet one of the purposes of this application includes the following steps:
[0008] Obtain the question text provided in the conversation between the user and the e-commerce customer service;
[0009] Extracting a keyword set corresponding to the question text, and determining a corresponding pseudo-reply text according to the question text;
[0010] Matching the question text, keyword set and pseudo-response text with each document paragraph and each document sentence therein in a preset knowledge base, and determining a question matching score, a keyword matching score and a reply matching score corresponding to each document paragraph;
[0011] Based on the question matching score, key matching score and reply matching score of each document paragraph, the comprehensive matching score of each document paragraph is determined, and a target document paragraph set whose comprehensive matching score meets preset conditions is recalled. A reply text of the question text is generated based on the target document paragraph set and sent to the user.
[0012] On the other hand, an e-commerce customer service reply device provided to meet one of the purposes of the present application includes a question acquisition module, an extraction generation module, a score determination module and a user reply module, wherein the question acquisition module is used to obtain the question text provided in the conversation between the user and the e-commerce customer service; the extraction generation module is used to extract the keyword set corresponding to the question text, and determine the corresponding pseudo reply text based on the question text; the score determination module is used to match the question text, keyword set and pseudo reply text with each document paragraph and each document sentence in a preset knowledge base, respectively, to determine the question matching score, key matching score and reply matching score corresponding to each document paragraph; the user reply module is used to determine the comprehensive matching score of each document paragraph based on the question matching score, key matching score and reply matching score of each document paragraph, recall the target document paragraph set whose comprehensive matching score meets the preset conditions, generate a reply text for the question text based on the target document paragraph set, and send it to the user.
[0013] 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, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the e-commerce customer service response method described in the present application.
[0014] 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.
[0015] The technical solution of this application has many advantages, including but not limited to the following aspects:
[0016] This application first obtains the question text in the conversation between the user and the e-commerce customer service, and then extracts the corresponding keyword set from the question text, which helps to reduce the interference of irrelevant information on the subsequent retrieval and matching process. Then, a pseudo-reply text is generated based on the question text. As another form of expression of the question text, the pseudo-reply text helps to narrow the natural gap between the question and the answer and enhance the similarity between the search content and the retrieved content.
[0017] On this basis, the user's question text, keyword set and pseudo-reply text are matched with the document paragraphs and their sentences in the preset knowledge base. By calculating the question matching score, key matching score and reply matching score, the relevance of each document paragraph to the user's question is comprehensively evaluated, and the document paragraph most relevant to the user's question is recalled, and the reply text is generated and sent to the user. It can be seen that the respective advantages of the three retrieval matching methods are organically combined, matching with the keyword set corresponding to the accurate description of the user's consulting intention, matching with the pseudo-reply text corresponding to the elimination of the gap as much as possible, and matching with the question text corresponding to the user's original consulting intention. Furthermore, through the weighted fusion method, the contribution of different recall results to the final reply result can be adjusted according to the needs of actual applications to achieve the optimal reply solution.
[0018] In summary, providing users with accurate responses can improve the user experience of e-commerce customer service. At the same time, it can also reduce the workload of manual customer service, reduce the operating costs of enterprises, provide 24 / 7 uninterrupted services, and enhance the practicality and flexibility of e-commerce customer service. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] 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:
[0020] Figure 1 The network architecture of the e-commerce platform exemplified in this application;
[0021] Figure 2 A flowchart of a typical embodiment of the e-commerce customer service reply method of the present application;
[0022] Figure 3 This is a functional block diagram of the e-commerce customer service reply device of this application;
[0023] Figure 4 A schematic diagram of the structure of a computer device used in this application. DETAILED DESCRIPTION
[0024] 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.
[0025] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0026] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0027] 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.
[0028] 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.
[0029] 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.
[0030] 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.
[0031] 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.
[0032] The e-commerce platform 82 can be implemented as an online service such as cloud computing service, 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.
[0033] 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.
[0034] 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.
[0035] 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.
[0036] 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.
[0037] 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.
[0038] 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 the commodity data. The mining and utilization of commodity data is the basis for realizing various technical services, including the use of 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.
[0039] An e-commerce customer service reply 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 the server of the e-commerce customer service platform, thereby accessing the interface opened after the computer program product is run, and performing human-computer interaction with the process of the computer program product through a graphical user interface to execute the method.
[0040] See also Figure 2 The e-commerce customer service reply method of the present application, in its typical embodiment, includes the following steps:
[0041] Step S1100: obtaining the question text provided in the conversation between the user and the e-commerce customer service;
[0042] E-commerce platforms and / or online stores can provide e-commerce customer service services, and usually provide multiple entrances for users to use e-commerce customer service services, such as: real-time chat windows, customer service links, customer service icons, customer service buttons, etc. integrated in the websites or mobile applications that carry the e-commerce platforms and / or online stores. Users can use the e-commerce customer service services through any of the above entrances to consult the corresponding e-commerce customer service. When the user uses the e-commerce customer service service, it triggers the creation of a session between the user and the corresponding e-commerce customer service, and provides a real-time chat window corresponding to the session to facilitate conversation between the user and the e-commerce customer service.
[0043] The user can select a text from a preset text set in the conversation, manually edit and input text, or input text by voice, etc., to provide a corresponding question text for consulting e-commerce customer service. The preset text set includes multiple texts, each of which is usually pre-edited by the operator of the e-commerce platform and / or online store that provides e-commerce customer service. It is usually a text edited accordingly based on guesses of questions that users may ask, so that users can directly select it as needed without the need for users to edit it themselves, which saves users time in editing, lowers the threshold for users to edit, and improves conversation efficiency.
[0044] Step S1200, extracting a keyword set corresponding to the question text, and determining a corresponding pseudo-reply text according to the question text;
[0045] In order to extract all the keywords in the question text to form a keyword set and reduce the interference of the corresponding redundant text content on subsequent matching, in one embodiment, a preset keyword extraction model is used to identify the entity type corresponding to each word in the question text, and determine the word of the keyword representing the entity type, that is, the keyword in the question text, and these keywords are collected to form a keyword set.
[0046] The keyword extraction model is pre-trained to a convergence state and acquires the ability to identify keywords in the question text. The keyword extraction model can be a model suitable for named entity recognition in the NLP field, for example, RoBERTa+CRF, BiLSTM+CRF, IDCNN+CRF, Bert+BiLSTM+CRF, FLAT, etc., and those skilled in the art can select and implement it as needed.
[0047] For training the key extraction model, specifically, first, multiple question texts provided in the conversations between different users and e-commerce customer service can be collected as individual training samples, and then the supervisory labels corresponding to each training sample are manually annotated. Taking a single training sample as an example, the entity type of each word in the training sample is manually determined. When the word is a keyword, the entity type of the word is annotated as representing the keyword; when the word is not a keyword, the entity type of the word is annotated as not belonging to any entity type. Thus, the entity types annotated by each word constitute an actual entity type sequence as the supervisory label of the training sample. All training samples and their supervisory labels are collected to form a training set.
[0048] Further, a single training sample in the training set and its supervisory label are called, and the keyword extraction model determines the entity type corresponding to each word in the training sample to form a predicted entity type sequence. The cross entropy loss function is used to calculate the cross entropy loss value of the predicted entity type sequence based on the supervisory label of the training sample. When the cross entropy loss value is lower than or equal to a preset threshold, it indicates that the keyword extraction model has been trained to a convergence state, thereby terminating the training of the keyword extraction model; when the cross entropy loss value exceeds the preset threshold, it indicates that the keyword extraction model has not converged, and then the keyword extraction model is gradient updated according to the cross entropy loss value, usually back-propagating to correct the weight parameters of each link in the keyword extraction model, so that the keyword extraction model is further close to convergence, and then, other training samples in the training set and their supervisory labels are continued to be called to perform iterative training on the keyword extraction model until the keyword extraction model is trained to a convergence state.
[0049] In order to alleviate the inherent gap between questions and replies, a pseudo-reply text of the question text is constructed to interpret the question text on the other hand. In one embodiment, the question text is embedded in a preset prompt template, and the prompt text is obtained and input into a large language model, so as to guide the model to act as an e-commerce customer service to reply to the question text provided by the user and output the corresponding text. Thus, the text of the model's reply to the question text is obtained as the pseudo-reply text.
[0050] The prompt template includes a task description and a question text to be embedded. Those skilled in the art can refer to the following disclosure to flexibly set the prompt template. The prompt template is exemplified as follows: The task description in the prompt template: "Please simulate the role of e-commerce customer service and give a professional and helpful answer based on the question text provided by the following user. Note: 1. Ensure that the answer remains professional and objective, and avoid using any words that may cause misunderstanding or controversy; 2. The answer should be concise and clear, directly targeting the user's question; 3. Maintain the coherence and logic of the answer to ensure that the user can easily understand it." The question text to be embedded in the prompt template: "Question text: ${user question}$".
[0051] The large language model is suitable for text processing in the field of NLP. It is pre-trained with an extremely large corpus until convergence, acquires the ability to generate human language, and has a certain degree of accurate text semantic understanding and logical reasoning ability. The selection of the large language model includes OPT, Chinchilla, PaLM, LLaMA, Alpaca, Vicuna, GPT3, GPT3.5, GPT4, etc.
[0052] Step S1300: Match the question text, keyword set and pseudo reply text with each document paragraph and each document sentence therein in a preset knowledge base, and determine the question matching score, keyword matching score and reply matching score corresponding to each document paragraph;
[0053] The preset knowledge base includes each document paragraph in a plurality of customer service knowledge documents and each document sentence therein, wherein the document paragraph is a paragraph obtained by segmenting the corresponding customer service knowledge document, and the document sentence is a sentence obtained by segmenting the corresponding customer service knowledge document. Those skilled in the art may disclose here flexibly and adaptably to realize the pre-construction of the knowledge base.
[0054] A text encoding model that has been pre-trained to convergence is used, and its learned ability to encode the semantic representation of the input text is utilized. The question text, keyword set, and pseudo-response text are used as inputs to obtain the corresponding vectorized semantic representations. The text encoding model can use an open source pre-trained Bert model, or other open source models such as the pre-trained GPT series. The pre-training tasks of these models are aimed at acquiring the above capabilities.
[0055] In addition, in order to improve the matching efficiency, the text encoding model is pre-adopted, and each document paragraph in the knowledge base and each document sentence therein are respectively used as input to obtain the corresponding vectorized semantic representation.
[0056] The cosine similarity algorithm is used to calculate the vector similarity between the vectorized semantic representation of the question text and the vectorized semantic representation of each document paragraph, as well as the vectorized semantic representation of each document sentence in each document paragraph. Then, for each document paragraph, the maximum vector similarity is selected from the vector similarities corresponding to the document paragraph and each document sentence therein and the question text as the question matching score of the document paragraph.
[0057] The cosine similarity algorithm is used to calculate the vector similarity between the vectorized semantic representation of the keyword set and the vectorized semantic representation of each document paragraph, as well as the vectorized semantic representation of each document sentence in each document paragraph. Then, for each document paragraph, the maximum vector similarity is screened out from the vector similarities corresponding to the keyword set of the document paragraph and each document sentence therein as the key matching score of the document paragraph.
[0058] The cosine similarity algorithm is used to calculate the vector similarity between the vectorized semantic representation of the pseudo-reply text and the vectorized semantic representation of each document paragraph, as well as the vectorized semantic representation of each document sentence in each document paragraph. Then, for each document paragraph, the largest vector similarity is selected from the vector similarities corresponding to the document paragraph and each document sentence therein and the pseudo-reply text as the reply matching score of the document paragraph.
[0059] Step S1400: Determine the comprehensive matching score of each document paragraph based on the question matching score, key matching score, and reply matching score of each document paragraph, recall the target document paragraph set whose comprehensive matching score meets the preset conditions, generate a reply text for the question text based on the target document paragraph set, and send it to the user.
[0060] For each document paragraph, the question matching score, key matching score, and reply matching score of the document paragraph are multiplied by their respective preset weights, and then added together to obtain a comprehensive matching score. The preset weights can be pre-set by a person skilled in the art as needed based on the disclosure herein, for example, the preset weights corresponding to the question matching score, key matching score, and reply matching score are: 0.4, 0.35, and 0.25. Further, the document paragraphs whose comprehensive matching scores exceed the preset threshold are recalled as target document paragraphs, and these target document paragraphs are collected to form a target document paragraph set.
[0061] In one embodiment, the target document paragraph set and the question text are embedded in a preset prompt template, and the prompt text is obtained and input into a large language model, so as to guide the model to extract the reply text corresponding to the question text from the target document paragraph set, thereby obtaining the reply text obtained by the model and sending it to the user.
[0062] The prompt template includes a task description, a question text to be embedded and a target document paragraph set. A person skilled in the art may refer to the following explanation to flexibly set the prompt template. An exemplary prompt template is given as follows: The task description in the prompt template: "Please reply to the question text provided by the user based on the customer service knowledge provided below. Notes: 1. Please use the content in the customer service knowledge to reply to the question text, and do not make up! 2. The reply should be as detailed and step-by-step as possible to solve the user's doubts. 3. If the question text is not clearly stated, or you cannot understand the question text, or you cannot find relevant content to reply to the question text from the customer service knowledge, reply "Unable to reply.". The target document paragraph set to be embedded in the prompt template: "Customer Service Knowledge: ${customer service knowledge}$". The question text to be embedded in the prompt template: "Question text: ${user question}$".
[0063] 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:
[0064] This application first obtains the question text in the conversation between the user and the e-commerce customer service, and then extracts the corresponding keyword set from the question text, which helps to reduce the interference of irrelevant information on the subsequent retrieval and matching process. Then, a pseudo-reply text is generated based on the question text. As another form of expression of the question text, the pseudo-reply text helps to narrow the natural gap between the question and the answer and enhance the similarity between the search content and the retrieved content.
[0065] On this basis, the user's question text, keyword set and pseudo-reply text are matched with the document paragraphs and their sentences in the preset knowledge base. By calculating the question matching score, key matching score and reply matching score, the relevance of each document paragraph to the user's question is comprehensively evaluated, and the document paragraph most relevant to the user's question is recalled, and the reply text is generated and sent to the user. It can be seen that the respective advantages of the three retrieval matching methods are organically combined, matching with the keyword set corresponding to the accurate description of the user's consulting intention, matching with the pseudo-reply text corresponding to the elimination of the gap as much as possible, and matching with the question text corresponding to the user's original consulting intention. Furthermore, through the weighted fusion method, the contribution of different recall results to the final reply result can be adjusted according to the needs of actual applications to achieve the optimal reply solution.
[0066] In summary, providing users with accurate responses can improve the user experience of e-commerce customer service. At the same time, it can also reduce the workload of manual customer service, reduce the operating costs of enterprises, provide 24 / 7 uninterrupted services, and enhance the practicality and flexibility of e-commerce customer service.
[0067] In a further embodiment, before step S1100, obtaining the question text provided in the conversation between the user and the e-commerce customer service, the following steps are included:
[0068] Step S1000: Obtain a customer service knowledge document and determine each document paragraph and each document sentence therein;
[0069] The customer service knowledge document may be edited and provided by relevant operating personnel of the e-commerce platform and / or online store that provides e-commerce customer service services.
[0070] According to any one or any combination of symbols indicating the end of a sentence such as a period, an exclamation mark, a question mark, a line break, etc. in the customer service knowledge document, all sentences in the document are divided, and according to the sequence of each sentence in the document, every two adjacent sentences are formed into sentence pairs.
[0071] The semantic association model includes a first branch representation layer, a second branch representation layer and a matching layer. The first branch representation layer is used to learn to extract deep semantic features from sentences and represent them. The selection can be any one or any combination of MLP, RNN, Transformer encoder, BERT, etc., which can be set as needed by technicians in the field. The second branch representation layer is used to learn to extract deep semantic features from sentences and represent them. The selection can be any one or any combination of MLP, RNN, Transformer encoder, BERT, etc., which can be set as needed by technicians in the field. The first branch representation layer and the second branch representation layer share parameters, and the representation results of the two are mapped to the same semantic space. The matching layer can be any one of dot product, cosine, Gaussian distance, MLP, and similarity matrix, which can be set as needed by technicians in the field. The semantic association model is pre-trained to a convergence state and acquires the ability to determine whether there is a connection between the two input sentences.
[0072] For each sentence pair, the semantic association model is used as input to take the sentence pair. The first branch representation layer in the semantic association model determines the deep semantic features of a single sentence in the sentence pair to obtain a vectorized representation of the sentence semantic representation corresponding to the feature. At the same time, the second branch representation layer in the semantic association model determines the deep semantic features of another sentence in the sentence pair to obtain a vectorized representation of the sentence semantic representation corresponding to the feature. Then, the matching layer in the semantic association model determines the vector similarity between the sentence semantic representations of the two sentences in the sentence pair as the confidence that there is a connection between the two sentences in the sentence pair. It can be obtained that the confidence corresponding to each sentence pair is obtained, and then the sentence pairs whose confidence is lower than the preset threshold are screened out. These sentence pairs are the two sentences in which there is no connection between the upper and lower sentences, so these sentence pairs are respectively used as the single target sentence pairs. The preset threshold can be set as needed by those skilled in the art.
[0073] Those skilled in the art can flexibly and adapt the reasoning process and structure of the above-mentioned semantic association model to pre-train the semantic association model to a convergent state.
[0074] It is not difficult to understand that by screening out those sentence pairs that do not have a contextual connection, i.e., the target sentence pairs, we are actually identifying paragraph boundaries in the customer service knowledge document. Because a paragraph is composed of a series of semantically coherent sentences, when the contextual connection between the sentence pairs is lower than the preset threshold, they are no longer part of a paragraph. In this way, by splitting up these sentence pairs, the document can be split into paragraphs composed of semantically coherent sentences, thereby obtaining each paragraph in the document as a document paragraph, and each document sentence in the document as a document sentence.
[0075] Step S1010: associate each document paragraph with the customer service knowledge document, and associate each document sentence with the document paragraph in which it is located, and store them in the knowledge base.
[0076] In order to quickly retrieve the customer service knowledge document where the document sentence is located and the document paragraphs therein, an association is established between each document paragraph and the customer service knowledge document, as well as an association between each document sentence and the document paragraph where it is located. Then, each document paragraph under the association and each document sentence therein are stored in the knowledge base.
[0077] In this embodiment, by dividing the customer service knowledge document to obtain each document paragraph and each document sentence therein, each part of the text is then associated with the document content in which it is located and stored in the knowledge base. On the one hand, the paragraph structure of the document is determined based on the adjacent sentences in the document that are not closely related as the boundaries between the paragraphs of the document, so as to ensure the reliability and integrity of the paragraphs. On the other hand, the semantic association between paragraphs and sentences is ensured to be accurate and reliable.
[0078] In a further embodiment, step S1400, generating a reply text of the question text according to the target document paragraph set, comprises the following steps:
[0079] Step S1410, obtaining the conversation context before the question text in the conversation;
[0080] The conversation context between the user and the e-commerce customer service in the session before the user provides the question text can be obtained, including each historical question text previously provided by the user and each historical reply text corresponding to the previous reply of the e-commerce customer service to these question texts.
[0081] Step S1420: embed the question text, the previous conversation, and the target document paragraph set into a preset first prompt template, obtain the first prompt text and input it into the large language model to guide the model to continue the conversation, and extract the reply text corresponding to the question text from the target document paragraph set.
[0082] The target document paragraph set and the question text are embedded in a preset first prompt template, and the first prompt text is obtained and input into a large language model, so as to guide the model to extract a reply text corresponding to the question text from the target document paragraph set, thereby obtaining the reply text obtained by the model and sending it to the user.
[0083] The first prompt template includes a task description, a question text to be embedded, a target document paragraph set and a conversation context. A person skilled in the art can refer to the following explanation to flexibly set the first prompt template. The first prompt template is exemplified as follows: The task description in the first prompt template: "Please play the role of an e-commerce customer service, and reply to the latest question text provided by the user according to the customer service knowledge provided below, immediately following the conversation context. Notes: 1. Please use the content in the customer service knowledge to reply to the question text, and do not make up! 2. By reviewing the conversation context, clarify the doubts and premise background of the latest question text provided by the user, as well as the user's preferred reply expression style; 3. The reply should be as detailed and step-by-step as possible, which can solve the user's doubts and conform to the user's preferred reply expression style, and do not repeat the content already mentioned in the conversation context; 4. If the question text is not clearly expressed, or you cannot understand the question text, or you cannot find relevant content to reply to the question text from the customer service knowledge, reply "Cannot reply". ". The target document paragraph set to be embedded in the first prompt template: "Customer service knowledge: ${customer service knowledge}$". The latest question text to be embedded in the first prompt template: "Question text: ${user question}$". The dialogue context to be embedded in the first prompt template: “Dialogue context: ${dialogue above}$”.
[0084] In this embodiment, on the one hand, by considering the context of the conversation before the latest question, the model can generate a reply based on the question and premise of the latest question, which can be immediately connected to the context of the conversation, without appearing abrupt or repeating the content already mentioned in the preface, thus ensuring the user's communication experience. On the other hand, by considering the reply expression style preferred by the user before the latest question, the reply expressed in this way can bring a better communication experience to the user.
[0085] In a further embodiment, step S1300, matching the question text, keyword set and pseudo reply text with each document paragraph and each document sentence therein in a preset knowledge base, and determining the question matching score, keyword matching score and reply matching score corresponding to each document paragraph, comprises the following steps:
[0086] Step S1310, obtaining a historical question text set corresponding to each document paragraph, wherein the document paragraph contains relevant content in replying to each historical question text in the corresponding historical question text set;
[0087] It can be understood that the large language model can be guided to generate historical reply texts for historical question texts based on the target document paragraph set, and at the same time output the document paragraph on which the historical reply texts are generated, and then append the historical question texts to the historical question text set corresponding to the document paragraph. The historical question text set is initially created as empty, and a corresponding historical question text set can be created for each document paragraph in the knowledge base, which is used to store each historical question text that the document paragraph is used to reply to by the large language model.
[0088] Step S1320: when the acquisition of the historical question text set fails, determining the semantic relevance between the question text and the document paragraph corresponding to the historical question text set and each document sentence therein, and taking the highest semantic relevance as the question matching score of the document paragraph;
[0089] At this time, it means that there is no historical question text in the historical question text set, and the document paragraph corresponding to the historical question text set has not been used by the large language model to reply to any historical question text. In this regard, the cosine similarity algorithm is used to calculate the vectorized semantic representation of the question text and the vectorized semantic representation of the document paragraph, as well as the vector similarity between the vectorized semantic representations of each document sentence in the document paragraph, which corresponds to the semantic relevance between the question text and the document paragraph and each document sentence therein. The highest semantic relevance among these semantic relevances is screened out as the question matching score of the document paragraph.
[0090] Step S1330: When the historical question text set is successfully obtained, the semantic similarity between the question text and each historical question text in the historical text set is determined. When the highest semantic similarity exceeds a first preset threshold, the semantic similarity is used as the question matching score of the document paragraph corresponding to the historical question text set.
[0091] At this time, it means that there is at least one historical question text in the historical question text set, and the document paragraph corresponding to the historical question text set is used by the large language model to reply to each historical question text in the set. The cosine similarity algorithm is used to calculate the vector similarity between the question text and each historical question text, which corresponds to the semantic similarity between the question text and the document paragraph and each document sentence therein. Further, the highest semantic similarity among these semantic similarities is screened out. When the semantic similarity exceeds the first preset threshold, it means that the historical question text corresponding to the semantic similarity is highly similar to the question text with sufficient confidence. In this regard, based on the fact that the document paragraph can be used by the large language model to reply to the historical question text, that is, it can also be used by the large language model to reply to the question text, therefore, the semantic similarity is used as the question matching score of the document paragraph.
[0092] In addition, when the semantic similarity is lower than or equal to the first preset threshold, it means that the historical question text corresponding to the semantic similarity is not similar enough to the question text. In this regard, in order to ensure the accuracy and reliability of the question matching score, the semantic relevance between the question text and the document paragraph and each document sentence therein is also calculated, and the highest semantic relevance among these semantic relevances is used as the question matching score of the document paragraph.
[0093] Those skilled in the art may further set the first preset threshold as needed according to the disclosure herein, for example, 0.85.
[0094] In this embodiment, we first try to obtain a historical question text set associated with a document paragraph, which contains questions previously asked by users, and these questions have been effectively answered by the document paragraph. If these historical question text sets can be successfully obtained, the semantic similarity between the current user question and these historical questions is calculated, and then the similarity between the current question and the historical questions is compared. When the similarity is sufficient to indicate that the current question and the historical questions are highly similar, the question matching score is determined to be a quantitative value of the similarity, that is, the corresponding semantic similarity, so as to accurately indicate the possibility that the corresponding document paragraph can accurately answer the current question.
[0095] If the historical question text set does not exist or the similarity is not enough to prove a nearly identical question, the system will fall back to the matching score confirmation method based on semantic relevance, calculating the semantic relevance between the current question and the document paragraph and each document sentence in it. This method ensures the accuracy and reliability of the question matching score even in the absence of historical data.
[0096] In summary, since existing successful answer cases can be fully and explainably utilized, the accuracy of question matching scores can be improved and the time required to determine scores can be greatly reduced. At the same time, accurate and reliable question matching scores can be determined through semantic relevance analysis when there is not enough historical data support.
[0097] In a further embodiment, step S1200, determining the corresponding pseudo-reply text according to the question text, includes the following steps:
[0098] Step S1210: obtaining a preset response generation model, and determining a pending response text corresponding to the question text and its confidence level;
[0099] The reply generation model is pre-trained to a convergence state, and acquires the ability to generate corresponding reply text and its confidence according to the input question text. The specific training process is further disclosed by the subsequent embodiments, and this step is not discussed for the time being.
[0100] Thus, the question text provided by the user is input into the reply generation model to obtain the reply text generated by the model and its confidence, and the reply text is used as the pending reply text. The confidence represents the reliability of the reply text in accurately replying to the question text.
[0101] Step S1220: when the confidence level exceeds a second preset threshold, confirming the pending reply text as a reply text to the question text, and sending it to the user;
[0102] At this point, it means that the confidence level is high enough, and thus it is confirmed that the pending reply text can accurately reply to the question text, so the pending reply text is sent to the user as the reply text of the question text.
[0103] Those skilled in the art may further set the second preset threshold as needed according to the disclosure herein, for example, 0.9.
[0104] Step S1230: When the confidence level exceeds a third preset threshold, the pending reply text is confirmed as a pseudo reply text of the question text.
[0105] At this time, it means that the confidence reaches the minimum standard, and thus it is confirmed that the pending reply text can reply to the question text to a limited extent, so the pending reply text is used as a pseudo reply text of the question text.
[0106] Those skilled in the art may further set the second preset threshold as needed according to the disclosure herein, for example, 0.65.
[0107] In this embodiment, by adopting a reply generation model pre-trained to convergence, a pending reply text is generated according to the user's question text, and its corresponding confidence value is determined, which reflects the reliability of the pending reply text in accurately responding to the question text. If the confidence exceeds a higher preset threshold, the reply text is considered to be sufficiently reliable and can be directly sent to the user as a final reply. If the confidence exceeds a lower preset threshold, it is considered that the reply text is not optimal, but still has a certain relevance and can be used as a pseudo-reply text. It can be seen that the use of the reply text can be determined according to different levels of confidence, thereby ensuring the quality of the reply while also improving the flexibility and efficiency of the reply. Therefore, this method can effectively balance the accuracy and response speed of the reply, improve the user experience, and avoid the sending of invalid or irrelevant replies, ensuring that users obtain the highest quality service possible.
[0108] In a further embodiment, before step S1210, obtaining a preset response generation model, the following steps are included:
[0109] Step S2210, obtaining a prepared training set, wherein the training set includes a plurality of training samples and supervisory labels thereof, wherein the training samples are historical question texts, and the supervisory labels represent historical reply texts corresponding to the corresponding training samples and the accuracy of the replies;
[0110] Collect in advance various historical question texts previously provided by multiple different users, and various historical reply texts corresponding to the previous reply texts of the e-commerce customer service to these question texts. The e-commerce customer service can be a customer service provided by humans and / or a customer service provided by machines.
[0111] Furthermore, for each historical question text, the historical question text is used as a single training sample. The accuracy of the response corresponding to the historical response text that responds to the historical question text can be manually determined, and the historical response text and its response accuracy can be marked as the supervisory label of the training sample. For example, if the historical response text can accurately respond to the historical question text, the corresponding response accuracy is 1; if the historical response text cannot accurately respond to the historical question text, the corresponding response accuracy is 0. All training samples and their supervisory labels are collected to form a training set.
[0112] Step S2211: Use the training set to train the response generation model until it converges, and acquire the ability to generate corresponding response text and its confidence according to the input question text.
[0113] The recommended model for the reply generation model is the mBERT (Multilingual BERT) model, and any other model such as XLM (Cross-lingual Language Model), mT5 (multilingual T5), XLM-R (XLM-RoBERTa), etc. can also be used. It is not difficult to understand that the reply generation model generates a reply text by generating a word unit in the reply text at each time step. The generation process of each word unit is actually based on probability distribution. The model will assign a probability to each possible word unit. This probability is the confidence of the model, which indicates the degree of certainty that the model believes that the word unit is the most appropriate option. Multiple word units are combined together to form a complete output sequence, which is the reply text. Therefore, the confidence of the reply text can be expressed by the product or average of the probabilities of each word unit. Those skilled in the art can flexibly implement it according to the disclosure here.
[0114] A single training sample and its supervisory label in the training set are called, and the training sample is input into the reply generation model to obtain the predicted reply text and its confidence generated by the reply generation model according to the training sample. The cross entropy loss function is used to calculate the sum of the cross entropy loss values corresponding to the predicted reply text and its confidence based on the supervisory label of the training sample. When the sum of the cross entropy loss values is less than or equal to a preset threshold, it indicates that the reply generation model has been trained to a convergence state, thereby terminating the training of the reply generation model; when the sum of the cross entropy loss values exceeds the preset threshold, it indicates that the reply generation model has not converged, and then the reply generation model is gradient updated according to the sum of the cross entropy loss values. Usually, the weight parameters of each link in the reply generation model are corrected by back propagation to make the reply generation model further close to convergence. Then, other training samples in the training set and their supervisory labels are continued to be called to perform iterative training on the reply generation model until the reply generation model is trained to a convergence state.
[0115] In this embodiment, the training process of the response generation model is disclosed, which can ensure the accuracy and reliability of the output results of the model.
[0116] In a further embodiment, step S1200, extracting a keyword set corresponding to the question text, includes:
[0117] Step S1201: embed the question text into a preset second prompt template, obtain the second prompt text and input it into the large language model to guide the model to first clarify the consulting intent of the question text, and extract various keywords closely related to the consulting intent from the question text.
[0118] The question text is embedded in a preset second prompt template, and the second prompt text is obtained and input into the large language model, so as to guide the model to first clarify the consulting intention of the question text, and extract various keywords closely related to the consulting intention from the question text, thereby obtaining various keywords obtained by the model, and all the keywords are collected to form a keyword set.
[0119] The second prompt template includes a task description and a question text to be embedded. A person skilled in the art can flexibly set the second prompt template with reference to the following explanation. The second prompt template is exemplified as follows: The task description in the second prompt template: "Please play the role of an e-commerce customer service, clarify the consulting intent in the following question text provided by the user, and extract various keywords related to the consulting intent from the question text. Note: When describing the consulting intent, the user may first mention the background and / or premise corresponding to the consulting intent. These mentioned contents are related to the consulting intent and can help you understand the consulting intent clearly, but the consulting intent should not be mixed with these redundant information. In addition, the user may also mention some content that is not related to the consulting intent, and be careful not to mix it in the consulting intent. For your convenience, here is a reference example: the example question text: "I want to ask, now that my online store application is completed, how to decorate it?" The consulting intent of the question text is: "How to decorate the online store", and the keywords related to the consulting intent in the question text are: "Decoration, online store". The latest question text to be embedded in the second prompt template: "Question text: ${user question}$".
[0120] In this embodiment, by constructing a second prompt text including a question text, corresponding keywords can be extracted based on the consultation intention of the clear question text, thereby avoiding erroneous extraction of redundant keywords.
[0121] See also Figure 3 , an e-commerce customer service reply device provided to meet one of the purposes of the present application is a functional embodiment of the e-commerce customer service reply method of the present application. On the other hand, the device is an e-commerce customer service reply device provided to meet one of the purposes of the present application, including a question acquisition module 1100, an extraction generation module 1200, a score determination module 1300 and a user reply module 1400, wherein the question acquisition module 1100 is used to obtain the question text provided in the conversation between the user and the e-commerce customer service; the extraction generation module 1200 is used to extract the keyword set corresponding to the question text, and determine the corresponding pseudo reply according to the question text. The question text, keyword set and pseudo-reply text are matched with each document paragraph and each document sentence in the preset knowledge base, and the question matching score, keyword matching score and reply matching score corresponding to each document paragraph are determined; the user reply module 1400 is used to determine the comprehensive matching score of each document paragraph according to the question matching score, keyword matching score and reply matching score of each document paragraph, recall the target document paragraph set whose comprehensive matching score meets the preset conditions, generate the reply text of the question text according to the target document paragraph set, and send it to the user.
[0122] In a further embodiment, before the question acquisition module 1100, it includes: a document acquisition submodule, which is used to acquire the customer service knowledge document and determine each document paragraph and each document sentence therein; a knowledge storage submodule, which is used to associate each document paragraph with the customer service knowledge document and associate each document sentence with the document paragraph in which it is located, and store them in the knowledge base.
[0123] In a further embodiment, the user reply module 1400 includes: a context acquisition submodule, used to obtain the conversation context before the question text in the conversation; a reply generation submodule, used to embed the question text, the conversation context, and the target document paragraph set into a preset first prompt template, obtain the first prompt text and input it into the large language model to guide the model to continue the conversation, and extract the reply text corresponding to the question text from the target document paragraph set.
[0124] In a further embodiment, the score determination module 1300 includes: a set acquisition submodule, used to acquire the historical question text set corresponding to the each document paragraph, the document paragraph containing relevant content in response to each historical question text in the corresponding historical question text set; a first score confirmation submodule, used to determine the semantic relevance between the question text and the document paragraph and each document sentence therein corresponding to the historical question text set when the acquisition of the historical question text set fails, and use the highest semantic relevance as the question matching score of the document paragraph; a second score confirmation submodule, used to determine the semantic similarity between the question text and each historical question text in the historical text set when the acquisition of the historical question text set succeeds, and when the highest semantic similarity exceeds a first preset threshold, use the semantic similarity as the question matching score of the document paragraph corresponding to the historical question text set.
[0125] In a further embodiment, the extraction and generation module 1200 includes: a confidence determination submodule, which is used to obtain a preset reply generation model to determine the pending reply text corresponding to the question text and its confidence; a user reply submodule, which is used to confirm the pending reply text as the reply text of the question text and send it to the user when the confidence exceeds a second preset threshold; and a pseudo-reply submodule, which is used to confirm the pending reply text as a pseudo-reply text of the question text when the confidence exceeds a third preset threshold.
[0126] In a further embodiment, before obtaining a preset reply generation model, it includes: a training set acquisition submodule, used to obtain a prepared training set, the training set includes multiple training samples and their supervisory labels, the training samples are historical question texts, and the supervisory labels characterize the historical reply texts corresponding to the corresponding training samples and their reply accuracy; a model training submodule, used to use the training set to train the reply generation model to a convergence state, and learn the ability to generate corresponding reply texts and their confidence levels based on the input question texts.
[0127] In a further embodiment, the extraction generation module 1200 includes: a keyword determination submodule, which is used to embed the question text into a preset second prompt template, obtain the second prompt text and input it into the large language model to guide the model to first clarify the consulting intent of the question text, and extract various keywords closely related to the consulting intent from the question text.
[0128] 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 an e-commerce customer service reply 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 e-commerce customer service reply 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.
[0129] 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 e-commerce customer service reply device of this application, and the server can call the program code and data of the server to execute the functions of all submodules.
[0130] 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 e-commerce customer service reply method of any embodiment of the present application.
[0131] Those 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).
[0132] In summary, this application can provide users with timely and accurate responses.
[0133] 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.
[0134] The above 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. An e-commerce customer service reply method, characterized in that: The steps include: Obtain the question text provided in the conversation between the user and the e-commerce customer service; Extracting a keyword set corresponding to the question text, and determining a corresponding pseudo-reply text according to the question text; Matching the question text, keyword set and pseudo-response text with each document paragraph and each document sentence therein in a preset knowledge base, and determining a question matching score, a keyword matching score and a reply matching score corresponding to each document paragraph; Based on the question matching score, key matching score and reply matching score of each document paragraph, the comprehensive matching score of each document paragraph is determined, and a target document paragraph set whose comprehensive matching score meets preset conditions is recalled. A reply text of the question text is generated based on the target document paragraph set and sent to the user.
2. The e-commerce customer service reply method according to claim 1, characterized in that: Before obtaining the question text provided in the conversation between the user and the e-commerce customer service, the following steps are included: Obtain customer service knowledge documents and identify each document paragraph and each document sentence; Each document paragraph is associated with the customer service knowledge document, and each document sentence is associated with the document paragraph in which it is located, and stored in the knowledge base.
3. The e-commerce customer service reply method according to claim 1, characterized in that: Generating a reply text of the question text according to the target document paragraph set includes the following steps: Obtain the conversation context before the question text in the conversation; The question text, the previous conversation, and the target document paragraph set are embedded in a preset first prompt template, and the first prompt text is obtained and input into the large language model to guide the model to continue the conversation and extract the reply text corresponding to the question text from the target document paragraph set.
4. The e-commerce customer service reply method according to claim 1, characterized in that: Matching the question text, keyword set and pseudo-response text with each document paragraph and each document sentence therein in a preset knowledge base respectively, and determining the question matching score, keyword matching score and reply matching score corresponding to each document paragraph, including the following steps: Acquire a historical question text set corresponding to each document paragraph, wherein the document paragraph contains relevant content in reply to each historical question text in the historical question text set corresponding to the document paragraph; When the acquisition of the historical question text set fails, determining the semantic relevance between the question text and the document paragraph corresponding to the historical question text set and each document sentence therein, and taking the highest semantic relevance as the question matching score of the document paragraph; When the historical question text set is successfully obtained, the semantic similarity between the question text and each historical question text in the historical text set is determined. When the highest semantic similarity exceeds a first preset threshold, the semantic similarity is used as the question matching score of the document paragraph corresponding to the historical question text set.
5. The e-commerce customer service reply method according to claim 1, characterized in that: Determining the corresponding pseudo-reply text according to the question text includes the following steps: Obtaining a preset response generation model to determine the pending response text corresponding to the question text and its confidence level; When the confidence exceeds a second preset threshold, confirming the pending reply text as a reply text to the question text, and sending it to the user; When the confidence exceeds a third preset threshold, the pending reply text is confirmed as a pseudo reply text of the question text.
6. The e-commerce customer service reply method according to claim 5, characterized in that: Before obtaining the preset response generation model, the following steps are included: Obtaining a prepared training set, wherein the training set includes a plurality of training samples and their supervisory labels, wherein the training samples are historical question texts, and the supervisory labels represent the historical reply texts corresponding to the corresponding training samples and the accuracy of the replies; The training set is used to train the reply generation model until it converges, and the model acquires the ability to generate corresponding reply text and its confidence according to the input question text.
7. The e-commerce customer service reply method according to claim 1, characterized in that: Extracting a keyword set corresponding to the question text includes: The question text is embedded in a preset second prompt template, and the second prompt text is obtained and input into the large language model to guide the model to first clarify the consulting intent of the question text, and extract various keywords closely related to the consulting intent from the question text.
8. An e-commerce customer service reply device, characterized in that: include: A question acquisition module is used to obtain the question text provided in the conversation between the user and the e-commerce customer service; An extraction and generation module, used to extract a keyword set corresponding to the question text, and determine a corresponding pseudo-reply text according to the question text; A score determination module is used to match the question text, keyword set and pseudo-response text with each document paragraph and each document sentence therein in a preset knowledge base, and determine the question matching score, keyword matching score and reply matching score corresponding to each document paragraph; The user reply module is used to determine the comprehensive matching score of each document paragraph based on the question matching score, key matching score and reply matching score of each document paragraph, recall the target document paragraph set whose comprehensive matching score meets the preset conditions, generate the reply text of the question text based on the target document paragraph set, and send it to the user.
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.
Citation Information
Cited By
Processing method and device for intelligent short message generation task
CN122242472A