Intelligent customer service response method and device, electronic equipment and storage medium
By matching the reference context from the corpus and generating target response text, the problem of the accuracy of answering existing intelligent customer service applications when facing diverse business and professional knowledge fields is solved, and higher quality customer service and user experience is achieved.
Patent Information
- Application Number
- CN202310991075.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-07
- Publication Date
- 2025-02-28
AI Technical Summary
Existing smart customer service applications are difficult to generate accurate reply texts, especially when facing diverse business and highly professional knowledge areas, which affect customer service quality and user experience.
By obtaining the question text of the question to be answered, a reference context matching the question text is determined from the corpus, and a target response text is generated based on the question text and the reference context, and finally a response to the answered question is answered.
By combining the reference context of the corpus to match the question text, the generated target response text can more accurately match specific business knowledge and improve customer service quality and user experience.
Smart Images

Figure CN119537514A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and specifically to an intelligent customer service response method, device, electronic device and storage medium, wherein the storage medium includes a computer-readable storage medium. Background Art
[0002] At present, intelligent customer service applications mainly analyze and understand customer issues, and then automatically generate reply texts to the customer issues, thereby replacing manual customer service response processing.
[0003] However, since customer questions target a variety of business types and involve highly professional knowledge areas, it is difficult to generate a relatively accurate response text simply by analyzing and understanding customer questions, which will affect the quality of customer service and user experience. Summary of the invention
[0004] The embodiments of the present application provide an intelligent customer service response method, device, electronic device and computer-readable storage medium, which can improve customer service quality and enhance user experience.
[0005] The present application embodiment provides an intelligent customer service response method, including:
[0006] Get the question text of the question to be answered;
[0007] Determining a reference context matching the question text from a corpus, wherein the corpus is constructed based on business knowledge documents;
[0008] Generate a target answer text according to the question text and the reference context;
[0009] The question to be answered is answered according to the target answer text.
[0010] Accordingly, the embodiment of the present application also provides an intelligent customer service response device, including:
[0011] An acquisition module is used to obtain the question text of the question to be answered;
[0012] A determination module, used to determine a reference context matching the question text from a corpus, wherein the corpus is constructed based on business knowledge documents;
[0013] A generating module, used for generating a target answering text according to the questioning text and the reference context;
[0014] A reply module is used to reply to the question to be answered according to the target answer text.
[0015] Optionally, in some embodiments of the present application, the business knowledge document includes a business dialogue text, and the determination module includes:
[0016] A first acquisition unit is used to acquire a pre-coding result of a business conversation text in a corpus, wherein the pre-coding result is obtained by encoding the business conversation text in advance;
[0017] An encoding unit, used for encoding the question text to obtain a question text encoding result;
[0018] The first determination unit is used to determine a reference context matching the question text from the business dialogue text according to the similarity between the question text encoding result and the pre-encoding result.
[0019] In some embodiments of the present application, the first determining unit includes:
[0020] A calculation subunit, used for calculating the similarity between the pre-coding result and the encoding result of the question text, and obtaining an encoding similarity value;
[0021] A sorting subunit, used to sort the business conversation texts according to the encoding similarity values from large to small to obtain a conversation text sorting result;
[0022] The screening subunit is used to screen a preset proportion of business dialogue texts ranked high from the dialogue text sorting results as reference contexts.
[0023] In some embodiments of the present application, the reference context includes at least two, and the generation module includes:
[0024] A second determining unit, configured to determine a target context from at least two reference contexts according to the question text by using a language dialogue model;
[0025] A third determining unit, configured to use the dialogue response text included in the target context as a reference response text;
[0026] A generating unit, configured to generate a target response text for the reference response text according to a generating strategy;
[0027] The generation strategy includes at least one of adding a greeting, adding a response format, or filtering sensitive words.
[0028] In some embodiments of the present application, the business knowledge document includes business dialogue texts of at least two business lines, and the determination module includes:
[0029] A fourth determining unit, configured to determine a target business line from the business lines according to a business identifier of the business system that receives the question text;
[0030] The fifth determining unit is used to determine a reference context matching the question text from the business dialogue text corresponding to the target business line.
[0031] Among them, in some embodiments of the present application, the reply module includes:
[0032] A reply unit, configured to output the target reply text according to a reply strategy;
[0033] The response strategy includes establishing a reference to the question text, or displaying the target response text using the same text bubble, text font type or text font size as the question text.
[0034] In some embodiments of the present application, the device further includes a feedback module, and the feedback module includes:
[0035] A second acquisition unit is used to acquire a response satisfaction level for the target response text;
[0036] An updating unit is used to update the corpus according to the manual reply text for the question text if the reply satisfaction is lower than a satisfaction threshold.
[0037] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps in the above-mentioned intelligent customer service response method when executed by the processor.
[0038] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned intelligent customer service response method are implemented.
[0039] In a fifth aspect, the embodiments of the present application further provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations described in the embodiments of the present application.
[0040] After obtaining the question text of the question to be answered, the embodiment of the present application determines the reference context that matches the question text from the corpus constructed by the business knowledge document, generates the target answer text according to the question text and the reference context, and answers the question to be answered according to the target answer text. Among them, by matching the reference context of the question text with the corpus, and assisting in generating the target answer text for the question text according to the reference context, the accuracy of the target answer text is improved. Compared with the answer text obtained by simply analyzing the question text, the embodiment of the present application can combine the corpus to make the target answer text match the specific business knowledge, thereby improving the quality of customer service and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 It is a scenario diagram of the intelligent customer service response method provided in an embodiment of the present application;
[0043] Figure 2 It is a flowchart of the intelligent customer service response method provided in an embodiment of the present application;
[0044] Figure 3 This is another flowchart of the intelligent customer service response method provided in an embodiment of the present application;
[0045] Figure 4 It is a structural diagram of an intelligent customer service response device provided in an embodiment of the present application;
[0046] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0048] The embodiments of the present application provide an intelligent customer service response method, device, electronic device, and computer-readable storage medium. Specifically, the embodiments of the present application provide an intelligent customer service response device suitable for electronic devices, wherein the electronic devices include terminal devices and servers, and the terminal devices include but are not limited to mobile phones, laptops, tablet computers, desktop computers, or touch screens; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms, etc. The server can be directly or indirectly connected via wired or wireless communication.
[0049] The intelligent customer service response method of the embodiment of the present application can be executed by the terminal device alone, or by the server alone, or by the terminal device and the server together. The embodiment of the present application takes the terminal device and the server together to execute the intelligent customer service response method as an example. For example, refer to Figure 1 , Figure 1 : is a schematic diagram of a scenario in which a terminal device and a server jointly execute the intelligent customer service response method provided in an embodiment of the present application, wherein the specific execution process of the terminal device executing the intelligent customer service response method is as follows:
[0050] The terminal device 10 obtains the question to be answered and converts the question to be answered into a question text. Subsequently, the question text is sent to the server 11, and the server 11 analyzes and processes the question text to generate a target answer text for the question text. Specifically:
[0051] After receiving the question text, the server 11 determines a reference context that matches the question text from the corpus, and then assists in generating a target response text for the question text based on the reference context. Subsequently, the server 11 returns the target response text to the terminal device 10.
[0052] When receiving the target response text returned by the server 11, the terminal device 10 outputs the target response text as a response to the question to be answered.
[0053] In the embodiment of the present application, the corpus is constructed based on a business knowledge document, which includes dialogue texts corresponding to multiple groups of question-and-answer dialogues.
[0054] It is understandable that in the embodiment of the present application, a target response text for the question text can be generated by combining the language dialogue model in machine learning with the reference context, wherein the language dialogue model can be deployed in the server. Accordingly, the intelligent customer service response method provided in the embodiment of the present application involves machine learning in the field of artificial intelligence, and the embodiment of the present application can achieve: combining the business knowledge to which the question text belongs to generate a target response text for the question to be answered, improving the accuracy of the target response text, improving the customer service quality, and improving the user experience.
[0055] Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. Among them, artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0056] Among them, machine learning (ML) is a multi-disciplinary interdisciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by teaching.
[0057] For example, in an embodiment of the present application, the question text and its corresponding reference context are input into the language dialogue model together, so as to output a target response text for the question text through the language dialogue model in combination with the reference context.
[0058] It can be understood that the embodiment of the present application improves the accuracy of the target response text by combining the corpus to match the reference context of the question text, and assists in generating the target response text for the question text based on the reference context. Compared with the reply text obtained simply by analyzing the question text, the embodiment of the present application can combine the corpus to enable the target response text to match the specific business knowledge, thereby improving the quality of customer service and improving the user experience.
[0059] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0060] See also Figure 2 , Figure 2 This is a flow chart of the intelligent customer service response method provided in the embodiment of the present application. The specific process of the intelligent customer service response method is as follows:
[0061] 101. Obtain the question text of the question to be answered.
[0062] Among them, in an embodiment of the present application, the question to be answered is a question that requires an answer and feedback. The question may be a question that needs to be answered, or it may be a pre-configured wake-up word. For example, the question to be answered may be an inquiry about product quality, product parameters, after-sales service and other related content. For example, the question to be answered may include questions such as the quality of the product, when to ship, and how long the warranty period is. For another example, the question to be answered may also include a wake-up word set for the system. For example, the question to be answered may be hello, a product details link, order information, and other information with a wake-up function.
[0063] In the embodiments of the present application, the question to be answered is usually issued by a questioner and received by a client, wherein the questioner may be a real user, a virtual character, or a smart device. For example, a real user asks questions or gives feedback on corresponding questions through a client to obtain the question to be answered; or in a game scenario, the dialogue between virtual characters generates the question to be answered; or the question is generated by asking questions when a smart device is performing human-computer interaction or when smart devices are interacting with each other.
[0064] Among them, the client includes customer service applications, social applications, office applications or entertainment applications, etc. Correspondingly, the questions to be answered can be raised through voice, text, video or image, for example, by inputting specific questions to be answered through voice, or directly inputting questions to be answered through text, or generating questions to be answered by recording videos or inputting images.
[0065] Correspondingly, the question text is the text for the question to be answered, and the text can be obtained directly by receiving text input from the client, or by extracting the text of the question to be answered in the form of voice, video or image.
[0066] 102. Determine a reference context matching the question text from a corpus, where the corpus is constructed based on business knowledge documents.
[0067] It is understandable that in the embodiment of the present application, the corpus is constructed by business knowledge documents, for example, the corpus is generated by storing the content of business knowledge documents. The business knowledge documents contain relevant knowledge for the business, for example, the business knowledge documents can be supply chain finance knowledge documents, business system operation manual documents, or financial product details introduction documents.
[0068] Among them, since the reference context is matched in the corpus, the reference context corresponds to the corresponding business knowledge, and since the reference context is matched with the question text, the reference context also satisfies the correlation with the question text, wherein the correlation refers to the question text and the reference context having the same or similar characteristics in content. For example, if the question text is how is the product quality, then the reference context can be text such as good product quality, how is the shoe quality, or average shoe quality; for another example, if the question text is how many days it will take to arrive, then the reference context can be text such as 3 days for arrival within the province, 7 days for arrival outside the province, or when to ship.
[0069] 103. Generate a target response text according to the question text and the reference context.
[0070] It can be understood that since the reference context belongs to the business knowledge corresponding to the question text, when the target answer text corresponding to the question text is generated based on the reference context, the generated target answer text can also meet the corresponding business knowledge requirements and help improve the accuracy of the target answer text.
[0071] For example, when the question text is "how is the product quality?" and the reference context is "how is the shoe product quality?", the target answer text generated is information about the shoe product quality, not about the product quality of clothes or hats. For another example, when the question text is "how is the financial product's return?", the target answer text generated is not other information except for the financial product business.
[0072] Among them, by matching with the corresponding corpus information, the generated target response text can meet the knowledge information of the corpus, thereby improving the accuracy of the generated target response text.
[0073] 104. Respond to the question to be answered according to the target response text.
[0074] It is understandable that the reply may be implemented through text output or voice output.
[0075] It can be understood that the embodiment of the present application improves the accuracy of the target response text by combining the corpus to match the reference context of the question text, and assists in generating the target response text for the question text based on the reference context. Compared with the reply text obtained simply by analyzing the question text, the embodiment of the present application can combine the corpus to enable the target response text to match the specific business knowledge, thereby improving the quality of customer service and improving the user experience.
[0076] Optionally, in an embodiment of the present application, the business knowledge document includes business conversation text, which is recorded in the form of a conversation, wherein the conversation includes questions and answers (or responses). Accordingly, the reference context is one or more groups of business conversation texts, that is, it includes one or more groups of conversations.
[0077] Correspondingly, if a reference context corresponding to the question text is matched, the target response text can be quickly generated based on the questions and answers in the reference context. Since the reference context matches the question text and the reference context belongs to the business knowledge field to which the question text belongs, the accuracy of the generated target response text can be guaranteed.
[0078] Optionally, the reference context matching the question text may be determined by the similarity between the feature vectors of the text, that is, optionally, in some embodiments of the present application, the business knowledge document includes a business dialogue text, and the step of "determining the reference context matching the question text from the corpus" includes:
[0079] Obtaining a pre-coding result of a business conversation text in a corpus, wherein the pre-coding result is obtained by pre-coding the business conversation text;
[0080] Encoding the question text to obtain a question text encoding result;
[0081] A reference context matching the question text is determined from the business conversation text according to the similarity between the question text encoding result and the pre-encoding result.
[0082] The pre-coding result is the code obtained by encoding the business conversation text in advance, which is also called the feature vector corresponding to the business conversation text. The feature vector can be obtained by encoding the encoding unit of machine learning, for example, the business conversation text is input into the encoding interface of machine learning, and the corresponding encoding result is output. In the embodiment of the present application, the encoding process is also called feature extraction process, and the feature extraction of the text is completed by using the network model to obtain the corresponding feature vector.
[0083] Accordingly, in the embodiment of the present application, an index database may be configured to store the precoding results. Accordingly, after obtaining the question text corresponding to the question to be answered and extracting the question text encoding result corresponding to the question text, the target precoding result may be matched directly from the precoding results of the index database according to the question text encoding result, and then the business conversation text corresponding to the target precoding result is used as the reference context.
[0084] Among them, the similarity between the encoding results reflects the closeness of the text content. Therefore, the reference context that matches the question text can be screened according to the similarity.
[0085] In the embodiment of the present application, the business conversation text can be obtained by dividing the business knowledge document into blocks, for example, dividing the question text and the answer text into groups to obtain the business conversation text in which the question and the answer belong to one group. Accordingly, in the embodiment of the present application, the TokenTextSplitter library can be used to divide the business knowledge document into blocks.
[0086] In an embodiment of the present application, when encoding a text, the text is also segmented in advance, and encoding is performed based on the text after the segmentation process to improve the accuracy of the encoding result, wherein the segmentation can be performed by the jieba library based on the hidden Markov model (HMM).
[0087] Accordingly, in an embodiment of the present application, when determining the reference context corresponding to the question text based on similarity, the business dialogue texts may be sorted by similarity, and then a business dialogue text with a higher similarity to a certain data is selected as the reference context of the question text, that is, optionally, in some embodiments of the present application, the step of "determining a reference context matching the question text from the business dialogue text according to the similarity between the question text encoding result and the pre-encoding result" includes:
[0088] Calculating the similarity between the pre-encoding result and the encoding result of the question text to obtain an encoding similarity value;
[0089] Sorting the business conversation texts according to the encoding similarity values from large to small to obtain a conversation text sorting result;
[0090] A preset proportion of business conversation texts ranked top are selected from the conversation text ranking results as reference contexts.
[0091] Among them, by sorting the business conversation texts according to similarity and filtering the top-ranked business conversation texts according to the sorting results, a certain number of reference contexts with greater relevance to the question text are selected, thereby improving the accuracy of reference context selection.
[0092] Optionally, since the reference context in the embodiment of the present application is a dialogue text containing questions and answers, a target answer text for the question text can be generated according to the reference context, that is, optionally, in some embodiments of the present application, the reference context includes at least two steps, "generating a target answer text according to the question text and the reference context", including:
[0093] Determining a target context from at least two reference contexts according to the question text by using a language dialogue model;
[0094] Using the dialogue response text included in the target context as a reference response text;
[0095] Generate a target response text for the reference response text according to a generation strategy;
[0096] The generation strategy includes at least one of adding a greeting, adding a response format, or filtering sensitive words.
[0097] It is understandable that the language dialogue model is a trained machine learning model that can filter out the target context closest to the question text from multiple reference contexts. For example, the language dialogue model is gpt-3.5-turbor, and the question text and multiple reference contexts are input into the interface of the gpt-3.5-turbor to output the target context. Accordingly, when inputting the language dialogue model, an operation indicator can also be input together to instruct the language dialogue model to complete the corresponding operation. For example, the operation indicator can be: filter out the target context closest to and most matching the question text from these reference contexts, etc.
[0098] Subsequently, the answer text in the target context can be used to generate a target response text for the question text, wherein the generation strategy represents the generation format or requirements of the target response text, for example, the reference response text is combined with a greeting to obtain the target response text, or sensitive words in the reference response text are filtered and the target response text is reorganized based on the filtering results.
[0099] Optionally, since the corpus may contain business dialogue texts of multiple business lines, in an embodiment of the present application, after obtaining the question text, the target business line targeted by the question text is identified, and a reference context matching the question text is determined from the business dialogue text corresponding to the target business line. That is, optionally, in some embodiments of the present application, the business knowledge document includes business dialogue texts of at least two business lines, and the step of "determining a reference context matching the question text from the corpus" includes:
[0100] Determining a target business line from the business lines according to a business identifier of a business system that receives the question text;
[0101] A reference context matching the question text is determined from the business conversation text corresponding to the target business line.
[0102] Among them, determining the data basis for filtering business conversation texts based on the target business line corresponding to the question text helps to improve the accuracy of reference context matching.
[0103] Among them, since the business dialogue texts of each business line are stored in the prediction library in the embodiment of the present application, when any business system (based on different business lines) receives the question text, it can match and identify the reference context from the corpus to achieve the sharing of business dialogue texts of multiple business lines. For example, after obtaining the question text, the target business line is directly determined according to the business identifier corresponding to the business system, and the business dialogue text is selected from the business dialogue text corresponding to the target business line as the reference context. Compared with the corpus built for a single business line, the corpus of the embodiment of the present application can meet the response processing for different business problems, and reduces the number of corpus construction, reducing the operating costs of intelligent customer service.
[0104] Optionally, when answering the question to be answered according to the target answer text, the answer can be given according to a pre-configured answer strategy to improve the answer effect of the intelligent customer service. That is, optionally, in some embodiments of the present application, the step of "answering the question to be answered according to the target answer text" includes:
[0105] Outputting the target response text according to the response strategy;
[0106] The response strategy includes establishing a reference to the question text, or displaying the target response text using the same text bubble, text font type or text font size as the question text.
[0107] Among them, a reference is a reply mark, which is used to indicate the question text that the target reply text is replying to. For example, in the embodiment of the present application, when the target reply text is output, the question text is used as the reference basis and pasted on the side of the target reply text to indicate that the target reply text is a reply to the question text. Accordingly, after the pasted question text is clicked, it can directly jump to the initial generation position of the question text.
[0108] It can be understood that text bubbles, text font types and consistent text font sizes are also a kind of reply mark. It is expected that the question text that the target reply text is replying to can be marked by text bubbles, text font types or consistent text font sizes to remind which question text the output target reply text is replying to.
[0109] Among them, the above-mentioned reply strategy is applicable to the scenario of answering multiple questions, avoiding the problems that questions and answers are difficult to correspond, the conversation content is difficult to understand, and the user experience is poor.
[0110] It can be understood that, in the embodiment of the present application, after the question text is answered according to the target answer text, the answer satisfaction for the target answer text is also collected, and the corpus is updated according to the answer satisfaction to improve the accuracy of the subsequent intelligent customer service answering process, that is, optionally, in some embodiments of the present application, after the step of "answering the question to be answered according to the target answer text", the method further includes:
[0111] Obtaining a response satisfaction score for the target response text;
[0112] If the answer satisfaction is lower than the satisfaction threshold, the corpus is updated according to the manual answer text for the question text.
[0113] Among them, updating the corpus when the response satisfaction is low can help improve the accuracy of subsequent target response text generation for new question texts.
[0114] It can be understood that the embodiment of the present application determines the reference context that matches the question text from the expectation library through the similarity of the encoding results, and uses the reference context to assist in generating the target response text for the question text, thereby utilizing the business knowledge or business dialogue text to which the reference context belongs to improve the accuracy of the generated target response text.
[0115] Among them, the target context is screened from the reference context through the language dialogue model to improve the accuracy of the target context. The target response text is generated using the answer text in the target context to improve the matching of the target response text with the question text and improve the accuracy of the target response text.
[0116] It can be understood that in the embodiment of the present application, the corpus for each business line is constructed first, and the matching based on the reference context at the time of response is performed later. The intelligent customer service response method of the embodiment of the present application will be described below in chronological order to fully understand the intelligent customer service response method of the embodiment of the present application, specifically:
[0117] See also Figure 3 As shown, Figure 3 : is another flow chart of the intelligent customer service response method provided in an embodiment of the present application, wherein the flow of the intelligent customer service response method specifically includes:
[0118] 201. Obtain a business knowledge document, where the business knowledge document includes a plurality of business dialogue texts, and the business dialogue texts include dialogue question texts and dialogue answer texts;
[0119] 202. Import business knowledge documents into the corpus according to business line classification;
[0120] 203. Segment the business knowledge documents in the corpus based on the word segmentation library of the hidden Markov model;
[0121] In the embodiment of the present application, the word segmentation library includes the jieba library, wherein the word segmentation principle of the jieba library is: using a Chinese word library, determining the association probability between Chinese characters, and forming phrases with high probability between Chinese characters to form a word segmentation result. In addition to word segmentation, users can also add custom phrases.
[0122] 204. Divide the business knowledge document after word segmentation into blocks by a text separator;
[0123] Among them, in the embodiment of the present application, the text separator includes TokenTextSplitter.
[0124] 205. Encode the divided business knowledge document through the encoding interface of the language dialogue model to obtain the pre-encoding result of each business dialogue text in the business knowledge document;
[0125] For example, the pre-coding results of business conversation text are calculated through OpenAI's embedding interface.
[0126] 206. Receive a question text corresponding to the question to be answered inputted through the client;
[0127] The question text is real-time text input by the client, and can be obtained through text conversion of voice, video or image.
[0128] 207. Encode the question text to obtain a question text encoding result;
[0129] 208. Calculate the cosine similarity between the question text encoding result and the pre-encoding result;
[0130] 209. Using the business conversation texts corresponding to a certain number of precoding results with the highest cosine similarity as reference contexts;
[0131] Among them, in an embodiment of the present application, if the cosine similarity corresponding to the reference context is still low, a prompt that the question text does not match the reference context can be output. The prompt can be used as a weight factor affecting the subsequent generation of the language dialogue model, or directly canceling the target context in the reference context output by the language dialogue model.
[0132] 210. Input the question text and the reference context into the language dialogue model, and output the target context;
[0133] 211. Generate a target response text based on the dialogue response text in the target context according to the generation strategy;
[0134] 212. Output the target response text according to the response strategy.
[0135] Among them, by configuring and combining the reference context of the question text with the corpus, and assisting in generating the target response text for the question text based on the reference context, the accuracy of the target response text is improved. Compared with the reply text obtained simply by analyzing the question text, the embodiment of the present application can combine the corpus to enable the target response text to match the specific business knowledge, thereby improving the quality of customer service and improving the user experience.
[0136] Correspondingly, in an embodiment of the present application, after the target response text is output, the response effect is also collected to obtain the response satisfaction, and the response satisfaction is used to update the corpus for feedback to improve the accuracy of the corpus configuration.
[0137] In order to better implement the intelligent customer service response method of the present application, the present application also provides an intelligent customer service response device based on the above intelligent customer service response method. The meanings of the terms are the same as those in the above intelligent customer service response method, and the specific implementation details can refer to the description in the method embodiment.
[0138] See also Figure 4 , Figure 4 : is a schematic diagram of the structure of the intelligent customer service response device provided in an embodiment of the present application, wherein the intelligent customer service response device can be specifically as follows:
[0139] An acquisition module 301 is used to acquire a question text of a question to be answered;
[0140] A determination module 302 is used to determine a reference context matching the question text from a corpus, wherein the corpus is constructed based on business knowledge documents;
[0141] A generating module 303, configured to generate a target answering text according to the questioning text and the reference context;
[0142] The answering module 304 is used to answer the question to be answered according to the target answer text.
[0143] Optionally, in some embodiments of the present application, the business knowledge document includes a business dialogue text, and the determination module 302 includes:
[0144] A first acquisition unit is used to acquire a pre-coding result of a business conversation text in a corpus, wherein the pre-coding result is obtained by encoding the business conversation text in advance;
[0145] An encoding unit, used for encoding the question text to obtain a question text encoding result;
[0146] The first determination unit is used to determine a reference context matching the question text from the business dialogue text according to the similarity between the question text encoding result and the pre-encoding result.
[0147] In some embodiments of the present application, the first determining unit includes:
[0148] A calculation subunit, used for calculating the similarity between the pre-coding result and the encoding result of the question text, and obtaining an encoding similarity value;
[0149] A sorting subunit, used to sort the business conversation texts according to the encoding similarity values from large to small to obtain a conversation text sorting result;
[0150] The screening subunit is used to screen a preset proportion of business dialogue texts ranked high from the dialogue text sorting results as reference contexts.
[0151] In some embodiments of the present application, the reference context includes at least two, and the generating module 303 includes:
[0152] A second determining unit, configured to determine a target context from at least two reference contexts according to the question text by using a language dialogue model;
[0153] A third determining unit, configured to use the dialogue response text included in the target context as a reference response text;
[0154] A generating unit, configured to generate a target response text for the reference response text according to a generating strategy;
[0155] The generation strategy includes at least one of adding a greeting, adding a response format, or filtering sensitive words.
[0156] In some embodiments of the present application, the business knowledge document includes business dialogue texts of at least two business lines, and the determination module 302 includes:
[0157] A fourth determining unit, configured to determine a target business line from the business lines according to a business identifier of the business system that receives the question text;
[0158] The fifth determining unit is used to determine a reference context matching the question text from the business dialogue text corresponding to the target business line.
[0159] In some embodiments of the present application, the reply module 304 includes:
[0160] A reply unit, configured to output the target reply text according to a reply strategy;
[0161] The response strategy includes establishing a reference to the question text, or displaying the target response text using the same text bubble, text font type or text font size as the question text.
[0162] In some embodiments of the present application, the device further includes a feedback module, and the feedback module includes:
[0163] A second acquisition unit is used to acquire a response satisfaction level for the target response text;
[0164] An updating unit is used to update the corpus according to the manual reply text for the question text if the reply satisfaction is lower than a satisfaction threshold.
[0165] In the embodiment of the present application, the acquisition module 301 first acquires the question text of the question to be answered, and then the determination module 302 determines the reference context matching the question text from the corpus, and the corpus is constructed according to the business knowledge document. Subsequently, the generation module 303 generates the target answer text according to the question text and the reference context, and then the answer module 304 answers the question to be answered according to the target answer text.
[0166] Among them, the reference context of the question text is matched with the corpus, and the target response text for the question text is assisted in generating according to the reference context, thereby improving the accuracy of the target response text. Compared with the reply text obtained simply by analyzing the question text, the embodiment of the present application can combine the corpus so that the target response text can be matched with specific business knowledge, thereby improving the quality of customer service and improving user experience.
[0167] In addition, the present application also provides an electronic device, such as Figure 5 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:
[0168] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0169] The processor 401 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, the processor 401 performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
[0170] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0171] The electronic device also includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 403 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0172] The electronic device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0173] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 will run the application stored in the memory 402, thereby implementing the steps in any one of the intelligent customer service response methods provided in the embodiments of the present application.
[0174] After obtaining the question text of the question to be answered, the embodiment of the present application determines a reference context that matches the question text from a corpus constructed from business knowledge documents, generates a target answer text based on the question text and the reference context, and answers the question to be answered based on the target answer text.
[0175] Among them, the reference context of the question text is matched with the corpus, and the target response text for the question text is assisted in generating according to the reference context, thereby improving the accuracy of the target response text. Compared with the reply text obtained simply by analyzing the question text, the embodiment of the present application can combine the corpus so that the target response text can be matched with specific business knowledge, thereby improving the quality of customer service and improving user experience.
[0176] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0177] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0178] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any intelligent customer service response method provided in the present application.
[0179] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0180] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0181] Since the instructions stored in the computer-readable storage medium can execute the steps in any one of the intelligent customer service response methods provided in the present application, the beneficial effects that can be achieved by any one of the intelligent customer service response methods provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0182] The above is a detailed introduction to an intelligent customer service response method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0183] Among them, it should be noted that in the specific implementation of the present application, it involves the questions to be answered input by the customer (input based on voice, text, video or image, etc.) and the corresponding question text, as well as the customer questions and corresponding answer results collected in advance in the corpus, and the text bubble type, text font type and text font size corresponding to the input question text and other related data. When the above embodiments of the present application are applied to specific products or technologies, the user's permission or consent is required, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
Claims
1. An intelligent customer service response method, characterized in that: include: Get the question text of the question to be answered; Determining a reference context matching the question text from a corpus, wherein the corpus is constructed based on business knowledge documents; Generate a target answer text according to the question text and the reference context; The question to be answered is answered according to the target answer text.
2. The method according to claim 1, characterized in that The business knowledge document includes a business dialogue text, and the step of determining a reference context matching the question text from a corpus includes: Obtaining a pre-coding result of a business conversation text in a corpus, wherein the pre-coding result is obtained by pre-coding the business conversation text; Encoding the question text to obtain a question text encoding result; A reference context matching the question text is determined from the business conversation text according to the similarity between the question text encoding result and the pre-encoding result.
3. The method according to claim 2, characterized in that The determining, from the business dialogue text, a reference context matching the question text according to the similarity between the question text encoding result and the pre-encoding result includes: Calculating the similarity between the pre-encoding result and the encoding result of the question text to obtain an encoding similarity value; Sorting the business conversation texts according to the encoding similarity values from large to small to obtain a conversation text sorting result; A preset proportion of business conversation texts ranked top are selected from the conversation text ranking results as reference contexts.
4. The method according to claim 1, characterized in that: The reference contexts include at least two, and the step of generating a target answer text according to the question text and the reference contexts includes: Determining a target context from at least two reference contexts according to the question text by using a language dialogue model; Using the dialogue response text included in the target context as a reference response text; Generate a target response text for the reference response text according to a generation strategy; The generation strategy includes at least one of adding a greeting, adding a response format, or filtering sensitive words.
5. The method according to claim 1, characterized in that The business knowledge document includes business dialogue texts of at least two business lines, and determining a reference context matching the question text from a corpus includes: Determining a target business line from the business lines according to a business identifier of a business system that receives the question text; A reference context matching the question text is determined from the business conversation text corresponding to the target business line.
6. The method according to claim 1, characterized in that The step of answering the question to be answered according to the target answer text includes: Outputting the target response text according to the response strategy; The response strategy includes establishing a reference to the question text, or displaying the target response text using the same text bubble, text font type or text font size as the question text.
7. The method according to claim 1, characterized in that After answering the question to be answered according to the target answer text, the method further includes: Obtaining a response satisfaction score for the target response text; If the answer satisfaction is lower than the satisfaction threshold, the corpus is updated according to the manual answer text for the question text.
8. An intelligent customer service response device, characterized in that: include: An acquisition module is used to obtain the question text of the question to be answered; A determination module, used to determine a reference context matching the question text from a corpus, wherein the corpus is constructed based on business knowledge documents; A generating module, used for generating a target answering text according to the questioning text and the reference context; A reply module is used to reply to the question to be answered according to the target answer text.
9. An electronic device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the intelligent customer service response method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps in the intelligent customer service response method as described in any one of claims 1 to 7 are implemented.