Customer service question and answer method and device
Through deep text semantic retrieval and large-scale language model question and answer prediction technology, it solves the problems of low keyword matching coverage and fixed vocabulary responses in the existing technology, improves the accuracy and naturalness of customer service questions and answers, and reduces labor costs. Improved user experience.
Patent Information
- Application Number
- CN202410881386.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-20
AI Technical Summary
In the existing technology, the keyword matching coverage of customer service manuals based on computer keyword retrieval technology is low, fixed vocabulary replies lack novelty, and manual review consumes high labor costs, resulting in customer service Q&A responses that are not accurate and natural enough.
It uses deep text semantic retrieval technology to predict questions and answers through semantic feature extraction models and large language models to generate more accurate and natural customer service response sentences to improve user experience.
This improves the accuracy and naturalness of customer service Q&A results, reduces labor costs, and improves user experience.
Smart Images

Figure CN118673122A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a customer service question and answer method and device. Background Art
[0002] E-commerce platforms encounter a lot of customer inquiries every day. Customer service personnel rely solely on manual responses, which is slow and labor-intensive, so they need to use computer technology. Currently, most of them are based on computer keyword retrieval technology, which uses search tools to quickly find customer service response statements from the customer service script manual, and provide them to manual review to make fixed script replies.
[0003] In the process of realizing the present invention, the inventors found that there are at least the following problems in the prior art: the customer service script manual is searched based on computer keyword retrieval technology, and then manually reviewed and replied to users, and the keyword matching coverage is low; the fixed script replies are stereotyped and lack novelty, which can easily make users feel disrespected; the manual review method is more labor-intensive. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a method and device for customer service question and answer, which can retrieve customer service response sentences based on deep text semantic retrieval, and predict questions and answers for the retrieved customer service response sentences based on a large model. This makes the customer service question and answer results of the e-commerce platform more accurate, the response language more natural and closer to humans, and improves the user experience.
[0005] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, a customer service question and answer method is provided, including: obtaining a user consultation statement, and using a semantic feature extraction model to extract a feature vector from the user consultation statement to obtain a query embedding vector corresponding to the user consultation statement; performing embedding vector matching on the query embedding vector and a set of retrieval embedding vectors corresponding to historical customer service question and answer data to obtain a matching result; obtaining a customer service response statement corresponding to the matching result; based on the user consultation statement and the customer service response statement, using a large model to perform question and answer prediction to obtain a question and answer result, and returning the question and answer result to the user.
[0006] Optionally, the semantic feature extraction model is trained in the following manner: obtaining historical customer service question and answer data and user search and click logs as training data sets; constructing a sample set based on the training data sets; and training a neural network model based on a self-attention mechanism using the sample set to obtain a semantic feature extraction model.
[0007] Optionally, constructing a sample set based on the training data set includes: for historical customer service question and answer data, extracting consultation keywords from user consultation statements in the historical customer service question and answer data, extracting response keywords from customer service response statements in the historical customer service question and answer data, and constructing a sample set based on the association between the consultation keywords and the response keywords; for user search click logs, extracting product identifiers from product information in the user search click logs, extracting search keywords from search term information in the user search click logs, and constructing a sample set based on the association between product identifiers and search keywords.
[0008] Optionally, a neural network model based on a self-attention mechanism uses the sample set for model training to obtain a semantic feature extraction model, including: using a deep learning algorithm to generate a feature representation of the sample set using the neural network model based on the self-attention mechanism, and inputting the feature representation of the sample set into a binary classification model for model training to obtain a semantic feature extraction model.
[0009] Optionally, the retrieval embedding vector set is obtained by inputting user consultation sentences in the historical customer service question and answer data into the semantic feature extraction model; and, through vector retrieval technology, a retrieval embedding vector index is generated according to the retrieval embedding vector set; the query embedding vector is embedded in the retrieval embedding vector set corresponding to the historical customer service question and answer data, including: according to the query embedding vector, an embedded vector is retrieved from the retrieval embedding vector index to perform embedding vector matching.
[0010] Optionally, before using the large model for question-answer prediction, the method further includes: using the collected question-answer feedback data to adjust parameters of the large language model to generate an aligned large model.
[0011] Optionally, the collected question-and-answer feedback data is used to adjust parameters of a large language model, including: using a reinforcement learning algorithm to adjust parameters of the large language model by learning a reward model so that the deviation between the output of the adjusted large language model and the question-and-answer feedback data meets a set threshold.
[0012] According to another aspect of an embodiment of the present invention, a customer service question and answer device is provided, including: a vector processing module, used to obtain user consultation statements, and use a semantic feature extraction model to extract feature vectors from the user consultation statements to obtain a query embedding vector corresponding to the user consultation statements; a vector matching module, used to perform embedding vector matching on the query embedding vector and a set of retrieval embedding vectors corresponding to historical customer service question and answer data to obtain a matching result; an answer speech acquisition module, used to obtain a customer service answer statement corresponding to the matching result; a question and answer prediction module, used to perform question and answer prediction based on the user consultation statements and the customer service answer statements using a large model to obtain a question and answer result, and return the question and answer result to the user.
[0013] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the customer service question and answer method provided by an embodiment of the present invention.
[0014] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the customer service question and answer method provided by an embodiment of the present invention is implemented.
[0015] An embodiment of the above invention has the following advantages or beneficial effects: by obtaining user consultation sentences, and using a semantic feature extraction model to extract feature vectors from the user consultation sentences, obtaining a query embedding vector corresponding to the user consultation sentences; performing embedding vector matching on the query embedding vector and the set of retrieval embedding vectors corresponding to historical customer service question and answer data to obtain a matching result; obtaining a customer service response sentence corresponding to the matching result; based on the user consultation sentences and the customer service response sentences, using a large model to perform question and answer predictions to obtain question and answer results, and returning the question and answer results to the user, a technical solution is implemented, which realizes intelligent customer service question and answer based on deep text semantic retrieval to retrieve customer service response sentences and based on a large model to perform question and answer predictions on the retrieved customer service response sentences, so that the customer service question and answer results of the e-commerce platform are more accurate, the response language is more natural and closer to humans, and the user experience is improved.
[0016] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Figure 1 Schematic diagram of main steps of a customer service question and answer method according to an embodiment of the present invention; Figure 2This is a schematic diagram of the implementation principle of a customer service question and answer system according to an embodiment of the present invention; Figure 3 This is a schematic diagram of main modules of a customer service question and answer device according to an embodiment of the present invention; Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied; Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0018] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0019] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution disclosed in the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0020] At present, there are three pain points in searching the customer service script manual based on computer keyword retrieval technology and then manually reviewing and replying to users: (1) The keyword matching coverage is low. For example, if a user asks "how to return the product", the return policy can be searched based on the keyword "return", but if the user asks "I don't want it anymore, how to go through the process", the return process cannot be retrieved; (2) The fixed script replies in the customer service script manual are stereotyped and lack novelty, which can easily make users feel disrespected; (3) The manual review method consumes more manpower costs. Among them, the customer service script manual records the quick reply scripts commonly used by customer service, covering various scenarios and problems before, during and after sales, such as product problems, logistics problems, return and exchange problems, etc.
[0021] In response to the above defects, the present invention proposes an intelligent customer service question and answer method that retrieves customer service response statements based on deep text semantic retrieval, and predicts questions and answers for the retrieved customer service response statements based on a large model, so that the customer service question and answer response of the e-commerce platform is more accurate, the answer words are more natural and closer to humans, and the user experience is improved. In an embodiment of the present invention, deep text embedding retrieval is used to implement deep text semantic retrieval, and by using the private domain data of the e-commerce platform for model training in advance, the deep text semantic retrieval model can more intelligently match the customer service response statements, thereby improving the accuracy and generalization of the retrieval. At the same time, a large model is used for question and answer prediction to achieve reasoning polishing, and solve the problems of rigid and unnatural customer service response statements. Among them, the customer service response statement is the customer service's response statement to the user's inquiry statement.
[0022] In the introduction to the embodiments of the present invention, the professional technical terms and their definitions are as follows: Embedding: In the field of deep learning, embedding can be understood as representing the input feature data as a mathematical vector, namely the embedding vector; Big models: In the field of artificial intelligence, big models refer to deep neural networks with more than 1 billion parameters. They can process massive amounts of data and complete various complex tasks, such as natural language processing, computer vision, and speech recognition. Transformer: The Transformer model is a neural network model based on the self-attention mechanism for processing sequence data.
[0023] Figure 1 Schematic diagram of the main steps of the customer service question and answer method according to an embodiment of the present invention. Figure 1 As shown, the customer service question and answer method of the embodiment of the present invention mainly includes the following steps S101 to S104.
[0024] Step S101: Obtain a user consultation statement, and use a semantic feature extraction model to extract a feature vector from the user consultation statement to obtain a query embedding vector corresponding to the user consultation statement. When a user consults a question through the customer service question-and-answer system, the customer service question-and-answer system will first obtain the consultation statement input by the user, which describes the question the user needs to consult. The query embedding vector is the embedding vector corresponding to the user consultation statement for querying the customer service response statement.
[0025] In an embodiment of the present invention, after obtaining the user consultation sentence, a semantic feature extraction model is used to extract a feature vector of the user consultation sentence to obtain a query embedding vector, wherein the semantic feature extraction model is, for example, a neural network model Transformer model based on a self-attention mechanism, a natural language processing model NLP (Natural Language Processing) model, and the like.
[0026] According to one embodiment of the present invention, the semantic feature extraction model is trained in the following manner: historical customer service question and answer data and user search and click logs are obtained as training data sets; a sample set is constructed based on the training data sets; a neural network model based on the self-attention mechanism is used to perform model training using the sample set to obtain a semantic feature extraction model. Since the amount of historical customer service question and answer data is usually small, the effect of the trained model will not be good enough when the model is trained based on the historical customer service question and answer data. In order to solve this problem, the present invention can be combined with the private domain data of the corresponding field to perform model training, so that the trained model can better understand the customer service questions and answers in the relevant field, and the final question and answer results are more accurate. In an embodiment of the present invention, for an e-commerce platform, a training data set can be generated together with the user's search and click logs for training a semantic feature extraction module. When performing model training, historical customer service question and answer data and user search and click logs within a specified period of time can be obtained as training data sets, and then a sample set can be constructed based on the training data set. For the acquired historical customer service question and answer data and user search and click logs, data cleaning must be performed first. Taking the user search click log as an example, based on the user search click logs of hundreds of millions, data cleaning is performed to obtain three parts of results, namely, the high-frequency click product library, the high-frequency search keyword library, and the sample raw material library. The input user search click log includes three pieces of information, namely user information, product information, and search keyword information. User information is useless for the technical solution of the present invention; product information needs to extract the product identifier (such as product title); search keyword information needs to undergo a series of data cleaning, such as deleting stop words, deleting words with a length greater than 7, deleting words with a length less than 2, filtering low-frequency words, etc., and the search keyword library is obtained after cleaning. The format of the generated sample raw material library is a pairing combination of (search keyword, product identifier).
[0027] In one embodiment of the present invention, constructing a sample set according to the training data set may specifically include: for historical customer service Q&A data, extracting consulting keywords from user consulting statements in the historical customer service Q&A data, extracting answer keywords from customer service answer statements in the historical customer service Q&A data, and constructing a sample set according to the association between the consulting keywords and the answer keywords; for user search and click logs, extracting product identifiers from product information in the user search and click logs, extracting search keywords from search word information in the user search and click logs, and constructing a sample set according to the association between product identifiers and search keywords. In an embodiment of the present invention, the generated sample set includes positive samples and negative samples. Taking historical customer service Q&A data as an example, the positive sample is the historical customer service Q&A data in which the consulting keywords in the user consulting statements and the answer keywords in the customer service answer statements are strongly correlated, and the negative sample is the historical customer service Q&A data in which the consulting keywords in the user consulting statements and the answer keywords in the customer service answer statements are unrelated; taking user search and click logs as an example, the positive sample is the user search and click log data in which the product and the search keywords are strongly correlated, and the negative sample is the user search and click log data in which the product and the search keywords are unrelated.
[0028] Taking the user search click log as an example, when generating positive samples, it is necessary to combine the sample raw material library obtained after data cleaning, that is, the pairing combination of (search keywords, product identifiers) for screening. The specific implementation is to filter according to statistical frequency. For each clicked product identifier, only the three search keywords with the highest corresponding pairing frequency are retained to obtain three positive samples. When generating negative samples, two data sources are required, namely the search keyword library obtained after data cleaning and the positive samples generated above. For each product identifier in the positive sample, 5 search keywords other than the search keyword corresponding to the positive sample are randomly sampled from the full search keyword library, and together with the product identifier, they constitute a negative sample. In this way, the positive and negative sample ratio can be controlled to be approximately 1:5.
[0029] After generating a sample set based on the training data set, the neural network model based on the self-attention mechanism can be used to perform model training using the sample set to obtain a semantic feature extraction model. Specifically, the feature representation of the sample set can be generated by a deep learning algorithm using the neural network model based on the self-attention mechanism, and the feature representation of the sample set can be input into a binary classification model for model training to obtain a semantic feature extraction model. Among them, the neural network model based on the self-attention mechanism is, for example, a Transformer model. When training the semantic feature extraction model, Transformer is used for feature representation, and a binary classification model is added later. Using the sample set as input, feature processing and model training are performed, and a trained model will eventually be produced for use in predicting embedding vectors.
[0030] In an embodiment of the present invention, a query embedding vector corresponding to the user consultation sentence can be obtained by inputting the user consultation sentence into a semantic feature extraction model.
[0031] Step S102: Perform embedding vector matching on the query embedding vector and the retrieval embedding vector set corresponding to the historical customer service question and answer data to obtain a matching result. The retrieval embedding vector set corresponding to the historical customer service question and answer data may be pre-generated. When performing embedding vector matching, for example, matching may be performed by calculating the similarity of two embedding vectors.
[0032] According to one embodiment of the present invention, the retrieval embedding vector set is obtained by inputting the user consultation sentences in the historical customer service question and answer data into the semantic feature extraction model; and, through the vector retrieval technology, a retrieval embedding vector index is generated according to the retrieval embedding vector set. By inputting the user consultation sentences in the historical customer service question and answer data into the semantic feature extraction model, an embedding vector (Embedding vector) of the middle layer of the neural network is generated, and the Embedding vector file is saved to the disk to form an Embedding file. Afterwards, the Embedding file is pushed to the vector index library of the online server to generate an embedded vector index. Specifically, an open source vector index library (for example, using open source tools such as faiss, milvus, annoy, etc.) can be used to generate an embedded vector index.
[0033] According to one embodiment of the present invention, embedding vector matching is performed between the query embedding vector and the set of retrieval embedding vectors corresponding to the historical customer service question and answer data, which may specifically include: based on the query embedding vector, embedding vector retrieval is performed from the retrieval embedding vector index to perform embedding vector matching. When performing embedded vector matching, for example, the similarity of two embedded vectors can be calculated through vector retrieval to determine whether the two embedded vectors match. In general, a specified number of retrieval embedding vectors with the highest similarity will be taken as the matching result of the query embedding vector, and the specified number can be flexibly set according to business needs. Among them, when calculating the similarity of two embedded vectors, for example, cosine similarity, Euclidean distance, Manhattan distance, etc. can be used for calculation.
[0034] Step S103: Obtain the customer service response statement corresponding to the matching result. Specifically, in an embodiment of the present invention, when generating a set of retrieval embedding vectors corresponding to historical customer service question and answer data, each retrieval embedding vector and the corresponding customer response speech can be associated and stored. Here, the customer service response statement corresponding to each matching result can be obtained according to the associated storage.
[0035] Step S104: Based on the user inquiry statement and the customer service response statement, a large model is used to perform question and answer prediction, obtain a question and answer result, and return the question and answer result to the user. In an embodiment of the present invention, the large model refers to a large language model LLM (Large Language Model), and a commonly used large language model can be used to perform question and answer prediction processing to obtain a question and answer result. Finally, the question and answer result is returned to the user to complete the customer service question and answer.
[0036] According to one embodiment of the present invention, when performing question and answer prediction, an aligned large model is used. The aligned large model can greatly facilitate the customization of the question and answer style for the business, which is more like the tone and attitude of the customer service staff.
[0037] In an embodiment of the present invention, before using the large model for question-answer prediction, the method further includes: using the collected question-answer feedback data to adjust parameters of the large language model to generate an aligned large model.
[0038] In one embodiment, the collected question-and-answer feedback data is used to adjust the parameters of a large language model, which may specifically include: using a reinforcement learning algorithm to adjust the parameters of the large language model by learning a reward model so that the deviation between the output of the adjusted large language model and the question-and-answer feedback data meets a set threshold.
[0039] When aligning large models, it is common practice to align the large language model LLM (Large LanguageModel) with human values. RLHF (Reinforcement Learning from Human Feedback) is proposed, which uses the collected question-answer feedback data to fine-tune the parameters of the LLM, which helps to improve the alignment indicators (e.g., usefulness, honesty, and harmlessness). RLHF uses reinforcement learning (RL) algorithms (such as the proximal policy optimization algorithm PPO, where PPO is the abbreviation of Proximal Policy Optimization) to adapt the LLM to human feedback by learning a reward model. This method involves humans in the training loop to develop well-aligned LLMs, such as InstructGPT. Those skilled in the art should know that the human feedback in the present invention is not limited to human feedback, but can also be program feedback during model training and use, and so on.
[0040] Reinforcement Learning from Human Feedback: RLHF systems mainly consist of three key components: the PLM (pre-train language model) to be aligned, the reward model learned from human feedback, and the RL algorithm used to train the LM (language model). In particular, the PLM is usually a generative model initialized with the parameters of an existing PLM. For example, OpenAI used GPT-3 with 175 billion parameters in its first mainstream RLHF model InstructGPT, while DeepMind used Gopher with 280 billion parameters in its GopherCite model. In addition, the reward model (RM) provides a (learned) guidance signal that reflects human preferences for text generated by the LM, usually expressed in scalar form. The reward model usually comes in two forms: a fine-tuned LM or a LM retrained with human preference data. Existing works usually use a reward model with a different parameter scale from the LM to be aligned. For example, OpenAI uses GPT-3 with 6 billion parameters as the reward model, and DeepMind uses Gopher with 7 billion parameters as the reward model. Finally, in order to optimize PLM using the signal from the reward model, we designed an RL algorithm specifically for fine-tuning large-scale models. Specifically, PPO is a widely used RL alignment algorithm in existing work.
[0041] The key steps of reinforcement learning from question-answering feedback are as follows: (1) Supervised fine-tuning: In order to enable the LM to initially perform the desired behavior, it is usually necessary to collect a supervised dataset consisting of input prompts (instructions) and expected outputs to fine-tune the LM. These prompts and outputs can be written by human annotators for specific tasks to ensure task diversity. For example, InstructGPT requires human annotators or automatic annotation models to write prompts (e.g., "List five ideas for how I can regain my passion for work") and expected outputs for generative tasks such as open-domain question answering, brainstorming, chatting, and rewriting. Note that this step is optional in specific scenarios; (2) Training the Reward Model: The second step is to train the RM using data from human feedback. Specifically, we input extracted prompts (either from a supervised dataset or human-generated prompts) into the LM, generate a certain number of output texts, and then invite human annotators to annotate preferences for these input-output pairs. Annotations can take many forms, and a common approach is to rank the generated candidate texts, which can reduce the differences introduced by different annotators. Finally, the RM is trained to predict the outputs preferred by humans. In InstructGPT, annotators rank the outputs generated by the model from best to worst, and then train the RM (i.e., GPT-3 with 6 billion parameters) to predict the ranking; (3) Reinforcement Learning Fine-tuning: In this step, the alignment fine-tuning of the LM can be formalized as an RL problem. In this case, the policy of the RL problem is given by the PLM (taking a prompt as input and returning output text), the action space is the vocabulary of the LM, the state is the current generated token sequence, and the reward is provided by the RM. To avoid the LM from significantly deviating from the initial (pre-fine-tuned) model, the reward function usually contains a penalty term. For example, when InstructGPT uses the PPO algorithm to optimize the LM against the RM, it calculates the KL divergence of the current LM with the initial LM as the penalty term for each input prompt. It is worth noting that by iterating the second and last steps multiple times, better alignment of the LLM can be achieved.
[0042] Figure 2 Schematic diagram of the implementation principle of the customer service question and answer system according to an embodiment of the present invention. Figure 2 As shown, in an embodiment of the present invention, the customer service question and answer system mainly includes three parts: offline model training, deep text semantic retrieval, and large model question and answer prediction. In the offline model training part, the semantic feature extraction model is mainly trained based on the sample set, and then the historical customer service question and answer data is feature processed offline based on the semantic feature extraction model to generate a retrieval embedding vector set and construct a retrieval embedding vector index. In the deep text semantic retrieval part, the query embedding vector is generated online based on the user consultation statement (user query) and the semantic feature extraction model, and an online search is performed. The embedded vector is matched in combination with the retrieval embedding vector index to obtain the matching result, and the customer service response statement corresponding to the matching result is obtained. The large model question and answer prediction part uses the aligned large model to perform question and answer prediction based on the user consultation statement and the customer service response statement, obtains the question and answer result, and returns the question and answer result to the user.
[0043] Figure 3 Schematic diagram of the main modules of the customer service question and answer device according to an embodiment of the present invention. Figure 3As shown, the customer service question and answer device 300 of the embodiment of the present invention mainly includes a vector processing module 301, a vector matching module 302, a response speech acquisition module 303 and a question and answer prediction module 304.
[0044] The vector processing module 301 is used to obtain a user consultation sentence, and use a semantic feature extraction model to extract a feature vector from the user consultation sentence to obtain a query embedding vector corresponding to the user consultation sentence; A vector matching module 302 is used to perform embedding vector matching between the query embedding vector and a set of retrieval embedding vectors corresponding to the historical customer service question and answer data to obtain a matching result; A response speech acquisition module 303 is used to acquire the customer service response statement corresponding to the matching result; The question and answer prediction module 304 is used to use a large model to perform question and answer prediction based on the user inquiry statement and the customer service response statement, obtain the question and answer result, and return the question and answer result to the user.
[0045] According to one embodiment of the present invention, the customer service question and answer device 300 also includes a model training module (not shown in the figure), which is used to train the semantic feature extraction model. Specifically, the semantic feature extraction model is trained in the following manner: obtaining historical customer service question and answer data and user search and click logs as training data sets; constructing a sample set based on the training data set; and using the sample set to perform model training on a neural network model based on a self-attention mechanism to obtain a semantic feature extraction model.
[0046] According to another embodiment of the present invention, when constructing a sample set based on the training data set, the model training module (not shown in the figure) can be specifically used for: for historical customer service question and answer data, extracting consultation keywords from user consultation sentences in the historical customer service question and answer data, extracting response keywords from customer service response sentences in the historical customer service question and answer data, and constructing a sample set based on the association between the consultation keywords and the response keywords; for user search and click logs, extracting product identifiers from product information in the user search and click logs, extracting search keywords from search term information in the user search and click logs, and constructing a sample set based on the association between product identifiers and search keywords.
[0047] According to another embodiment of the present invention, when a model training module (not shown in the figure) uses the sample set to perform model training in a neural network model based on a self-attention mechanism to obtain a semantic feature extraction model, it can be specifically used to: generate a feature representation of the sample set using the neural network model based on the self-attention mechanism through a deep learning algorithm, and input the feature representation of the sample set into a binary classification model for model training to obtain a semantic feature extraction model.
[0048] According to another embodiment of the present invention, the retrieval embedding vector set is obtained by inputting the user consultation sentences in the historical customer service question and answer data into the semantic feature extraction model; and, through the vector retrieval technology, a retrieval embedding vector index is generated according to the retrieval embedding vector set; the vector matching module 302 can also be used to: according to the query embedding vector, perform embedded vector retrieval from the retrieval embedding vector index to perform embedded vector matching.
[0049] According to another embodiment of the present invention, the customer service question and answer device 300 also includes a large model alignment module (not shown in the figure), which is used to: before using the large model for question and answer prediction, use the collected question and answer feedback data to adjust the parameters of the large language model to generate an aligned large model.
[0050] According to another embodiment of the present invention, when the large model alignment module (not shown in the figure) uses the collected question and answer feedback data to adjust the parameters of the large language model, it can be specifically used to: use a reinforcement learning algorithm to adjust the parameters of the large language model by learning a reward model, so that the deviation between the output of the adjusted large language model and the question and answer feedback data meets a set threshold.
[0051] According to the technical solution of the embodiment of the present invention, the query embedding vector corresponding to the user consultation sentence is obtained by obtaining the user consultation sentence and using the semantic feature extraction model to extract the feature vector of the user consultation sentence; the query embedding vector is embedded in the set of retrieval embedding vectors corresponding to the historical customer service question and answer data to obtain a matching result; the customer service response sentence corresponding to the matching result is obtained; based on the user consultation sentence and the customer service response sentence, a large model is used to perform question and answer prediction to obtain a question and answer result, and the question and answer result is returned to the user. The technical solution realizes intelligent customer service question and answer based on deep text semantic retrieval to retrieve customer service response sentences and based on the large model to perform question and answer prediction on the retrieved customer service response sentences, so that the customer service question and answer results of the e-commerce platform are more accurate, the response language is more natural and closer to human, and the user experience is improved.
[0052] Figure 4 An exemplary system architecture 400 is shown to which the customer service question and answer method or the customer service question and answer apparatus according to the embodiments of the present invention may be applied.
[0053] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0054] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0055] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0056] Server 405 may be a server that provides various services, such as a backend management server that provides support for websites browsed by users using terminal devices 401, 402, and 403 (for example only). The backend management server may obtain user consultation statements from received customer service question and answer requests and other data, and use a semantic feature extraction model to extract feature vectors from the user consultation statements to obtain a query embedding vector corresponding to the user consultation statement; perform embedding vector matching on the query embedding vector and the set of retrieval embedding vectors corresponding to historical customer service question and answer data to obtain a matching result; obtain a customer service response statement corresponding to the matching result; use a large model to perform question and answer prediction based on the user consultation statement and the customer service response statement to obtain a question and answer result, and return the question and answer result to the user, etc., and feed back the processing result (for example, the question and answer result - for example only) to the terminal device.
[0057] It should be noted that the customer service question and answer method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the customer service question and answer device is generally set in the server 405 .
[0058] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0059] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 5 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0060] like Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0061] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0062] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0063] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0064] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0065] The units or modules involved in the embodiments of the present invention may be implemented in software or in hardware. The units or modules described may also be provided in a processor. For example, they may be described as: a processor including a vector processing module, a vector matching module, a response speech acquisition module, and a question and answer prediction module. Among them, the names of these units or modules do not constitute a limitation on the units or modules themselves under certain circumstances. For example, the question and answer prediction module may also be described as "a module for performing question and answer prediction based on the user inquiry statement and the customer service response statement using a large model, obtaining question and answer results, and returning the question and answer results to the user".
[0066] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: obtaining a user consultation statement, and using a semantic feature extraction model to extract a feature vector of the user consultation statement to obtain a query embedding vector corresponding to the user consultation statement; performing embedding vector matching on the query embedding vector and the retrieval embedding vector set corresponding to the historical customer service question and answer data to obtain a matching result; obtaining a customer service response statement corresponding to the matching result; based on the user consultation statement and the customer service response statement, using a large model to perform question and answer prediction to obtain a question and answer result, and returning the question and answer result to the user.
[0067] According to the technical solution of the embodiment of the present invention, the query embedding vector corresponding to the user consultation sentence is obtained by obtaining the user consultation sentence and using the semantic feature extraction model to extract the feature vector of the user consultation sentence; the query embedding vector is embedded in the set of retrieval embedding vectors corresponding to the historical customer service question and answer data to obtain a matching result; the customer service response sentence corresponding to the matching result is obtained; based on the user consultation sentence and the customer service response sentence, a large model is used to perform question and answer prediction to obtain a question and answer result, and the question and answer result is returned to the user. The technical solution realizes intelligent customer service question and answer based on deep text semantic retrieval to retrieve customer service response sentences and based on the large model to perform question and answer prediction on the retrieved customer service response sentences, so that the customer service question and answer results of the e-commerce platform are more accurate, the response language is more natural and closer to human, and the user experience is improved.
[0068] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for customer service question and answer, It is characterized in that include: Obtain a user consultation sentence, and use a semantic feature extraction model to extract a feature vector from the user consultation sentence to obtain a query embedding vector corresponding to the user consultation sentence; Performing embedding vector matching between the query embedding vector and the set of retrieval embedding vectors corresponding to the historical customer service question and answer data to obtain a matching result; Obtain the customer service response statement corresponding to the matching result; Based on the user inquiry statement and the customer service response statement, a large model is used to perform question and answer prediction, obtain question and answer results, and return the question and answer results to the user.
2. The method according to claim 1, It is characterized in that The semantic feature extraction model is trained in the following way: Obtain historical customer service question and answer data and user search and click logs as training data sets; Constructing a sample set according to the training data set; A neural network model based on a self-attention mechanism is trained using the sample set to obtain a semantic feature extraction model.
3. The method according to claim 2, It is characterized in that Constructing a sample set according to the training data set includes: For the historical customer service question and answer data, extract consultation keywords from the user consultation sentences in the historical customer service question and answer data, extract response keywords from the customer service response sentences in the historical customer service question and answer data, and construct a sample set based on the association relationship between the consultation keywords and the response keywords; For user search click logs, product identifiers are extracted from product information in the user search click logs, search keywords are extracted from search word information in the user search click logs, and a sample set is constructed based on the association between product identifiers and search keywords.
4. The method according to claim 2, It is characterized in that A neural network model based on a self-attention mechanism is trained using the sample set to obtain a semantic feature extraction model, including: Through a deep learning algorithm, the neural network model based on the self-attention mechanism is used to generate a feature representation of the sample set, and the feature representation of the sample set is input into a binary classification model for model training to obtain a semantic feature extraction model.
5. The method according to claim 1, It is characterized in that The retrieval embedding vector set is obtained by inputting user inquiry sentences in the historical customer service question and answer data into the semantic feature extraction model; And, generating a retrieval embedding vector index according to the retrieval embedding vector set by using a vector retrieval technology; Performing embedding vector matching between the query embedding vector and a set of retrieval embedding vectors corresponding to historical customer service question and answer data includes: According to the query embedding vector, an embedding vector is retrieved from the retrieval embedding vector index to perform embedding vector matching.
6. The method according to claim 1, It is characterized in that Before using a large model for question-answering prediction, it also includes: Use the collected question-answering feedback data to adjust the parameters of the large language model to produce an aligned large model.
7. The method according to claim 6, It is characterized in that Use the collected Q&A feedback data to tune the parameters of a large language model, including: A reinforcement learning algorithm is used to adjust the parameters of the large language model through a learning reward model so that the deviation between the output of the adjusted large language model and the question-answer feedback data meets a set threshold.
8. A device for customer service question and answer, It is characterized in that include: A vector processing module, used to obtain a user consultation statement, and use a semantic feature extraction model to extract a feature vector from the user consultation statement to obtain a query embedding vector corresponding to the user consultation statement; A vector matching module, used to perform embedding vector matching between the query embedding vector and a set of retrieval embedding vectors corresponding to historical customer service question and answer data to obtain a matching result; A response speech acquisition module is used to obtain the customer service response statement corresponding to the matching result; The question and answer prediction module is used to use a large model to perform question and answer prediction based on the user inquiry statement and the customer service response statement, obtain the question and answer result, and return the question and answer result to the user.
9. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Question and answer model training method and device, computer equipment and storage medium
CN119513253A
Customer service information processing method, customer service system, electronic equipment and storage medium
CN119719264A
Dynamic retrieval decision scheme determination method and system based on Monte Carlo tree search
CN120011413A
Method and system for dynamic search decision scheme determination based on monte carlo tree search
CN120011413B
Apparatus and method for searching interactive data through semantic index
US12596695B2
