Text processing method and device

By obtaining and filtering the target reply text in the communication text in the customer service scenario, and combining the satisfaction evaluation information, the problem of poor quality of high-quality speech collections in the existing technology is solved, and customer service satisfaction is improved.

CN114996418BActive Publication Date: 2025-01-14ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210462924.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2025-01-14
Estimated Expiration
2042-04-28

AI Technical Summary

Technical Problem

In customer service scenarios, it is difficult for the existing technology to accurately obtain high-quality speech collections, resulting in low customer service satisfaction. The existing methods are prone to paying attention to noise information during training, resulting in poor quality of the obtained high-quality speech collections.

Method used

By obtaining the communication text set, determine the target reply text between the user's expression text and the reply text, calculate the correlation between the target reply text and the satisfaction evaluation information, filter the target reply text set that meets the preset satisfaction criteria, and ensure reply The correctness and quality of the text.

Benefits of technology

It improves the accuracy and quality of the target reply text, improves the overall customer service satisfaction, and ensures that the reply can effectively solve customer demands.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114996418B_ABST
    Figure CN114996418B_ABST
Patent Text Reader

Abstract

The embodiments of the present specification provide a text processing method and device, wherein the text processing method comprises: obtaining a communication text set, wherein the communication text set comprises a plurality of communication texts, and the communication texts comprise a plurality of user expression texts and a reply text corresponding to each user expression text; determining a target reply text corresponding to each communication text according to the plurality of user expression texts and the reply text corresponding to each user expression text, ensuring the correctness of the target reply text so that the target reply text can address the demands of the user expression text; respectively obtaining satisfaction evaluation information corresponding to the target reply text; calculating the correlation between the target reply text and the satisfaction evaluation information; and determining a target reply text set that meets a preset satisfaction condition according to the correlation, thereby improving the quality of each target reply text in the target reply text set and further improving the satisfaction of the overall communication service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to a text processing method. Background Art

[0002] With the continuous development of computer technology, more and more computer technologies are applied in the field of text processing. Taking customer service as an example, large and medium-sized enterprises have hundreds or even thousands of telephone customer service personnel, generating more than hundreds of thousands of call records every month. When facing diverse customer demands, different telephone customer service personnel adopt different speech strategies.

[0003] Currently, the next round of customer service speech immediately after the customer speech is directly extracted from the communication text between the customer and the customer service as the customer service staff's speech, and the speech of multiple customer service staff is integrated to obtain a collection of high-quality speech. However, in the customer service scenario, the customer service staff often does not answer immediately, but first confirms the problem about the customer's request and then solves the customer's request. The quality of the high-quality speech collection obtained by the above method is poor, so an accurate text processing solution is urgently needed. Summary of the invention

[0004] In view of this, an embodiment of this specification provides a text processing method. One or more embodiments of this specification also relate to a text processing device, a computing device, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, a text processing method is provided, including:

[0006] Acquire a communication text set, wherein the communication text set includes a plurality of communication texts, and the communication texts include a plurality of user expression texts and a reply text corresponding to each user expression text;

[0007] Determine a target reply text corresponding to each communication text according to multiple user expression texts and reply texts corresponding to each user expression text;

[0008] Obtain satisfaction evaluation information corresponding to the target reply text respectively;

[0009] Calculate the correlation between the target response text and the satisfaction evaluation information;

[0010] Based on the relevance, determine the target response text set that meets the preset satisfaction conditions.

[0011] Optionally, the step of determining a target reply text corresponding to each communication text according to a plurality of user expression texts and a reply text corresponding to each user expression text includes:

[0012] Performing intent recognition on multiple user expression texts to obtain target expression texts from the multiple user expression texts;

[0013] Classify the reply texts corresponding to the expression texts of each user to obtain classification results corresponding to the multiple reply texts;

[0014] According to the target expression text and the classification result, the target response text corresponding to the target expression text is determined.

[0015] Optionally, the step of performing intent recognition on multiple user expression texts to obtain a target expression text from the multiple user expression texts includes:

[0016] Input multiple user expression texts into the pre-trained intent recognition model to obtain the target expression text;

[0017] The step of classifying the reply texts corresponding to the expression texts of each user to obtain classification results corresponding to the multiple reply texts includes:

[0018] The reply text corresponding to each user's statement text is input into the pre-trained text classification model to obtain the classification result.

[0019] Optionally, the step of determining a target response text corresponding to the target expression text according to the target expression text and the classification result includes:

[0020] In the communication text, find the target position of the target statement text;

[0021] Determine whether the classification result of the reply text after the target position is a general reply text;

[0022] If not, the response text corresponding to the classification result is used as the target response text corresponding to the target expression text.

[0023] Optionally, the intent recognition model is trained in the following ways:

[0024] Obtaining a statement sample set, wherein the statement sample set includes a plurality of statement samples, each statement sample carrying an intent label;

[0025] Extracting a first expression sample from the expression sample set, wherein the first expression sample is any expression sample in the expression sample set;

[0026] Inputting the first expression sample into a preset model to obtain a first predicted intention of the first expression sample;

[0027] Calculate a first loss value according to the first predicted intent and the first intent label carried by the first expression sample;

[0028] If the first loss value is greater than the first preset threshold, the model parameters of the preset model are adjusted, and the step of extracting the first representation sample from the representation sample set is returned to be executed;

[0029] If the first loss value is less than or equal to the first preset threshold, the training is stopped to obtain the trained intent recognition model.

[0030] Optionally, the step of obtaining a representation sample set includes:

[0031] Acquire a plurality of preset intention expression sample sets, wherein the plurality of intention expression sample sets correspond to different expression intentions respectively;

[0032] Determining whether the number of intent expression samples in the plurality of intent expression sample sets is greater than a preset number of samples;

[0033] If not, obtain the communication sample set, and calculate the sample similarity between each intention expression sample in the intention expression sample set and each communication sample in the communication sample set;

[0034] According to the sample similarity, the intent expression sample set is expanded to obtain an updated intent expression sample set;

[0035] According to multiple intention expression sample sets, an expression sample set is obtained.

[0036] Optionally, the training method of the text classification model includes:

[0037] Obtain a response sample set, wherein the response sample set includes a plurality of response samples, and each response sample carries a sample label representing whether the response sample is a general response text;

[0038] Extracting a first response sample from the response sample set, wherein the first response sample is any response sample in the response sample set;

[0039] Inputting the first response sample into the preset model to obtain a first prediction result of the first response sample;

[0040] Calculate a second loss value according to the first prediction result and the first sample label carried by the first response sample;

[0041] If the second loss value is greater than the second preset threshold, adjusting the model parameters of the preset model, and returning to the step of extracting the first response sample;

[0042] If the second loss value is less than or equal to the second preset threshold, the training is stopped to obtain the trained text classification model.

[0043] Optionally, the step of calculating the correlation between the target reply text and the satisfaction evaluation information includes:

[0044] Segment the target reply text to obtain a target word sequence of the target reply text;

[0045] Calculate the word correlation between each word in the target word sequence and the satisfaction evaluation information;

[0046] The word relevances are sorted, and a preset number of word relevances are added together to obtain the relevance of the target reply text.

[0047] Optionally, the step of determining a target response text set that meets a preset satisfaction condition according to the relevance includes:

[0048] Sort the target response texts by relevance;

[0049] Based on the order of the target reply text, calculating the text similarity between the target reply text and each text in the target reply text set;

[0050] The target response text that meets the preset satisfaction condition is added to the target response text set, and when the preset stop condition is reached, the updated target response text set is obtained.

[0051] According to a second aspect of the embodiments of this specification, there is provided a text processing device, including:

[0052] A first acquisition module is configured to acquire a communication text set, wherein the communication text set includes a plurality of communication texts, and the communication texts include a plurality of user expression texts and a reply text corresponding to each user expression text;

[0053] A first determination module is configured to determine a target reply text corresponding to each communication text according to a plurality of user expression texts and a reply text corresponding to each user expression text;

[0054] The second acquisition module is configured to respectively acquire satisfaction evaluation information corresponding to the target reply text;

[0055] A calculation module is configured to calculate the correlation between the target reply text and the satisfaction evaluation information;

[0056] The second determination module is configured to determine a target reply text set that meets a preset satisfaction condition based on the relevance.

[0057] Optionally, the first determination module is further configured to perform intent recognition on multiple user expression texts to obtain a target expression text from the multiple user expression texts; classify the reply texts corresponding to each user expression text to obtain classification results corresponding to multiple reply texts; and determine a target reply text corresponding to the target expression text based on the target expression text and the classification results.

[0058] Optionally, the first determination module is further configured to input a plurality of user expression texts into a pre-trained intention recognition model to obtain a target expression text;

[0059] The first determination module is further configured to input the reply text corresponding to each user's expression text into a pre-trained text classification model to obtain a classification result.

[0060] Optionally, the first determination module is further configured to search for a target position of the target expression text in the communication text; determine whether the classification result of the reply text after the target position is a general reply text; if not, use the reply text corresponding to the classification result as the target reply text corresponding to the target expression text.

[0061] Optionally, the device further comprises:

[0062] The first training module is further configured to obtain a statement sample set, wherein the statement sample set includes multiple statement samples, each statement sample carries an intent label; extract a first statement sample from the statement sample set, wherein the first statement sample is any statement sample in the statement sample set; input the first statement sample into a preset model to obtain a first predicted intent of the first statement sample; calculate a first loss value based on the first predicted intent and the first intent label carried by the first statement sample; if the first loss value is greater than a first preset threshold, adjust the model parameters of the preset model, and return to execute the step of extracting the first statement sample from the statement sample set; if the first loss value is less than or equal to the first preset threshold, stop training to obtain a trained intent recognition model.

[0063] Optionally, the first training module is further configured to obtain multiple pre-set intention expression sample sets, wherein the multiple intention expression sample sets correspond to different expression intentions respectively; determine whether the number of intention expression samples in the multiple intention expression sample sets is greater than the preset sample number; if not, obtain the communication sample set, calculate the sample similarity between each intention expression sample in the intention expression sample set and each communication sample in the communication sample set; expand the intention expression sample set according to the sample similarity to obtain an updated intention expression sample set; and obtain an expression sample set based on the multiple intention expression sample sets.

[0064] Optionally, the device further comprises:

[0065] The second training module is further configured to obtain a reply sample set, wherein the reply sample set includes multiple reply samples, and each reply sample carries a sample label representing whether the reply sample is a general reply text; extract a first reply sample from the reply sample set, wherein the first reply sample is any reply sample in the reply sample set; input the first reply sample into a preset model to obtain a first prediction result of the first reply sample; calculate a second loss value based on the first prediction result and the first sample label carried by the first reply sample; if the second loss value is greater than a second preset threshold, adjust the model parameters of the preset model, and return to execute the step of extracting the first reply sample; if the second loss value is less than or equal to the second preset threshold, stop training to obtain a trained text classification model.

[0066] Optionally, the calculation module is further configured to segment the target reply text to obtain a target word sequence of the target reply text; calculate the word relevance between each word in the target word sequence and the satisfaction evaluation information; sort the word relevance, add a preset number of word relevances, and obtain the relevance of the target reply text.

[0067] Optionally, the second determination module is further configured to sort the target reply texts according to relevance; calculate the text similarity between the target reply texts and each text in the target reply text set based on the order of the target reply texts; add the target reply texts that meet the preset satisfaction conditions to the target reply text set, and obtain an updated target reply text set when the preset stop condition is met.

[0068] According to a third aspect of an embodiment of this specification, a computing device is provided, including:

[0069] Memory and processor;

[0070] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above-mentioned text processing method are implemented.

[0071] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned text processing method are implemented.

[0072] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned text processing method.

[0073] A text processing method provided by an embodiment of the present specification obtains a communication text set, wherein the communication text set includes multiple communication texts, and the communication texts include multiple user expression texts and reply texts corresponding to each user expression text; determines a target reply text corresponding to each communication text according to the multiple user expression texts and the reply texts corresponding to each user expression text, ensures the correctness of the target reply text, so that the target reply text can solve the demands of the user expression text; obtains satisfaction evaluation information corresponding to the target reply text respectively; calculates the correlation between the target reply text and the satisfaction evaluation information; and determines a target reply text set that meets the preset satisfaction conditions according to the correlation, thereby improving the quality of each target reply text in the target reply text set and further improving the satisfaction of the overall communication service. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 is a flowchart of a text processing method provided by an embodiment of this specification;

[0075] Figure 2 is a flow chart of a method for training an intent recognition model in a text processing method provided in one embodiment of this specification;

[0076] Figure 3 is a processing flow chart of a text processing method provided by an embodiment of this specification;

[0077] Figure 4 is a structural schematic diagram of a text processing device provided by an embodiment of this specification;

[0078] Figure 5 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0079] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0080] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0081] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0082] First, the terms involved in one or more embodiments of this specification are explained.

[0083] Customer service satisfaction: The satisfaction or dissatisfaction feedback given by customers based on their service experience after calling the telephone customer service.

[0084] Leading Intent: A specific intention expressed by a customer when describing his or her demands. For example, whether a refund is available, on what basis the fee is deducted, etc. When this intention is used to mine customer service speech, it is called “leading intent”.

[0085] Response language: In response to the customer's leading intention, what kind of language content and strategy the customer service staff uses.

[0086] In this specification, a text processing method is provided. This specification also relates to a text processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0087] With the continuous development of computer technology, more and more computer technologies are applied in the field of text processing. Taking customer service as an example, customer service satisfaction is one of the most important goals of the customer service department of an enterprise. Large and medium-sized enterprises have hundreds or even thousands of telephone customer service personnel, generating more than hundreds of thousands of call records every month. When facing diverse customer demands, different telephone customer service personnel adopt different speech strategies. High-quality customer service speech strategies can better solve customer demands and help improve service satisfaction. Therefore, an accurate text processing solution is urgently needed.

[0088] In actual applications, the next round of customer service speech immediately after the customer speech can be directly extracted from the communication text between the customer and the customer service as the customer service staff's speech, and a classification model based on deep neural networks can be trained according to satisfaction / dissatisfaction. The classification model is used to score the customer service staff's speech and obtain a collection of high-quality speech. However, in the customer service scenario, the customer service staff often does not answer immediately, but first confirms the problem about the customer's request and then solves the customer's request. The accuracy of the customer service staff's speech obtained by the above method is poor. During the training process, the neural network model will pay attention to the noise information in the data in order to pursue a low loss function value during training, resulting in poor quality of the obtained high-quality speech collection, which affects the customer's satisfaction with the overall communication service.

[0089] In order to improve the quality of high-quality collections of speech scripts, guide novice customer service staff, and improve overall customer service satisfaction, this manual provides a text processing method, which obtains a communication text set, wherein the communication text set includes multiple communication texts, and the communication texts include multiple user expression texts and reply texts corresponding to each user expression text; determines a target reply text corresponding to each communication text according to the multiple user expression texts and the reply texts corresponding to each user expression text, ensures the correctness of the target reply text, so that the target reply text can address the demands of the user expression text; obtains satisfaction evaluation information corresponding to the target reply text respectively; calculates the correlation between the target reply text and the satisfaction evaluation information; and determines a target reply text set that meets the preset satisfaction conditions according to the correlation, thereby improving the quality of each target reply text in the target reply text set and further improving the overall communication service satisfaction.

[0090] See also Figure 1 , Figure 1 A flowchart of a text processing method provided by an embodiment of the present specification is shown, which specifically includes the following steps:

[0091] Step 102: Acquire a communication text set, wherein the communication text set includes a plurality of communication texts, and the communication texts include a plurality of user expression texts and a reply text corresponding to each user expression text.

[0092] In the embodiments of the present specification, in order to obtain a target reply text set, multiple communication texts need to be processed. During the text processing, it is first necessary to obtain a communication text set including multiple communication texts, and then use the multiple communication texts in the communication text set for processing, so that the content of the target reply text set finally obtained is richer.

[0093] Specifically, the communication text refers to the text content of multiple users in the communication process. The identities of multiple users include customers and customer service, students and teachers, leaders and staff, etc., which are selected according to the actual situation. This specification embodiment does not make any limitation on this. The expression text refers to the text in which the user expresses his demands, and the reply text refers to the text that answers the user's demands included in the user's expression text.

[0094] It should be noted that there are many ways to obtain a communication text set. A large number of communication texts can be manually input to form a communication text set, or a large number of communication texts can be read from other data acquisition devices or databases to form a communication text set. The specific selection depends on the actual situation, and the embodiments of this specification do not impose any limitations on this.

[0095] For example, assume that the communication text set is D = {d1, d2, d3, ..., d i}, where di represents the i-th communication text in the communication text set, and any communication text d = {x1,y1,x2,y2,x3,y3,...,x i ,y i}, where x i represents the user's i-th round speech text in the communication text, y i Represents the i-th round of reply text in the communication text set.

[0096] Step 104: Determine a target reply text corresponding to each communication text according to a plurality of user expression texts and a reply text corresponding to each user expression text.

[0097] In the embodiment of this specification, after the communication text set is acquired, the target reply text corresponding to each communication text can be determined according to the multiple user expression texts included in the communication text set and the reply text corresponding to each user expression text.

[0098] Specifically, the target reply text refers to the reply text to the target expression text expressing the leading intention in the communication text.

[0099] In practical applications, the intention of the user expression text can be recognized to obtain the target expression text in the user expression text, the reply text corresponding to each user expression text can be classified to obtain the classification result of each reply text, and the target expression text and the classification result can be further used to determine the target reply text. That is, the above step of determining the target reply text corresponding to each communication text according to multiple user expression texts and the reply text corresponding to each user expression text can include the following steps:

[0100] Performing intent recognition on multiple user expression texts to obtain target expression texts from the multiple user expression texts;

[0101] Classify the reply texts corresponding to the expression texts of each user to obtain classification results corresponding to the multiple reply texts;

[0102] According to the target expression text and the classification result, the target response text corresponding to the target expression text is determined.

[0103] Specifically, the target expression text refers to the expression text that expresses the user's leading intention, and the target reply text refers to the reply text to the target expression text that expresses the leading intention.

[0104] Exemplarily, communication text d1={x1,y1,x2,y2,x3,y3} is obtained, intention recognition is performed on user expression text x1, user expression text x2 and user expression text x3, and the target expression text x2 is obtained, and reply text y1, reply text y2 and reply text y3 are classified to obtain the classification results a={a1,a2,a3} corresponding to the above three reply texts, and according to the target expression text x2 and the classification result a={a1,a2,a3}, it is determined that the target reply text corresponding to the target expression text is y3.

[0105] By applying the solution of the embodiments of this specification, the target expression text among the multiple user expression texts is obtained by performing intent recognition on multiple user expression texts, and the reply text corresponding to each user expression text is classified to obtain the classification results corresponding to the multiple reply texts. According to the target expression text and the classification results, the target reply text corresponding to the target expression text is determined to ensure the correctness of the target reply text, so that the target reply text can address the demands of the user expression text.

[0106] In actual applications, there are many ways to perform intent recognition on multiple user expression texts and obtain the target expression text from the multiple user expression texts. The specific method is selected according to the actual situation, and the embodiments of this specification do not impose any limitation on this.

[0107] In a possible implementation, multiple user expression texts may be matched with a target expression text library to obtain a target expression text from the multiple user expression texts.

[0108] Exemplarily, three user expression texts are obtained, which are: user expression text x1 "Are you there?", user expression text x2 "I need a refund for my order" and user expression text x3 "Order 001". User expression text x1, user expression text x2 and user expression text x3 are matched with a pre-set target expression text library, and the target expression text among the three user expression texts is obtained as "I need a refund for my order".

[0109] In another possible implementation, multiple user expression texts may be input into a pre-trained intent recognition model to obtain a target expression text, that is, the above step of performing intent recognition on multiple user expression texts to obtain a target expression text from the multiple user expression texts includes:

[0110] Multiple user expression texts are input into a pre-trained intent recognition model to obtain the target expression text.

[0111] Specifically, for each user statement, the intent category of each user statement can be obtained using the intent recognition model. The value of the intent category can be a specific leading intent or an "other" category, which means that the user's speech in this round does not meet any pre-defined leading intent.

[0112] Exemplarily, three user expression texts are obtained, which are: user expression text x1 "Are you there?", user expression text x2 "I need a refund for my order" and user expression text x3 "Order 001". User expression text x1, user expression text x2 and user expression text x3 are input into a pre-trained intention recognition model, and the recognition result of user expression text x1 is "other", the recognition result of user expression text x2 is "refund intention", and the recognition result of user expression text x3 is "other". Therefore, the target expression text is determined to be "I need a refund for my order".

[0113] Taking customer service as an example, after the customer expresses the leading intention, the customer service will often not answer immediately, but confirm several questions first. For example, when a customer asks "Why did you deduct my money?", the customer service will first ask for information such as the order number and the deduction time, and then give a specific reply. In the embodiments of this specification, such customer service replies are defined as "general replies", that is, these contents can appear in multiple communication texts. Therefore, the reply texts corresponding to each user's expression text can be classified, and the target reply text corresponding to the target expression text can be further determined.

[0114] In actual applications, there are many ways to classify the reply texts corresponding to each user's expression text and obtain classification results corresponding to multiple reply texts. The specific method is selected according to the actual situation, and the embodiments of this specification do not impose any limitation on this.

[0115] In a possible implementation, the reply text corresponding to each user's expression text may be matched with a preset category key sentence table to obtain classification results corresponding to multiple reply texts.

[0116] Specifically, the pre-set category key sentence table may include multiple categories, each category includes multiple key sentences. Taking customer service as an example, the general reply text may include the following four types: greeting sentences, such as "How may I help you?", wait sentences, such as "Please wait a moment", information collection sentences, such as "Is this the order you are inquiring about?", and follow-up sentences, such as "Uh-huh".

[0117] Exemplarily, the pre-set category key sentence table is shown in Table 1 below, where the user statement text x1 is "Are you there?", the reply text y1 is "How can I help you?", the user statement text x2 is "I need a refund for my order", the reply text y2 is "Which order is it?", the user statement text x3 is "Order 001", the reply text y3 is "Your refund has been successfully made, please check it." The reply text y1, reply text y2 and reply text y3 are matched with Table 1, and the categories of reply text y1 and reply text y2 are "general reply text", and the category of reply text y3 is "non-general reply text".

[0118] Table 1 Category key sentences

[0119]

[0120]

[0121] In another possible implementation, the reply text corresponding to each user's expression text may be input into a pre-trained text classification model to obtain classification results corresponding to multiple reply texts. That is, the above step of classifying the reply text corresponding to each user's expression text to obtain classification results corresponding to multiple reply texts may include the following steps:

[0122] The reply text corresponding to each user's statement text is input into the pre-trained text classification model to obtain the classification result.

[0123] Specifically, the reply text corresponding to each user's expression text is input into a pre-trained text classification model to obtain the classification result of each reply text, and each classification result is integrated to obtain a classification result sequence of the reply text.

[0124] Exemplarily, the user statement text x1 is obtained as "Are you there?", the reply text y1 is obtained as "How may I help you?", the user statement text x2 is obtained as "I need a refund for my order", the reply text y2 is obtained as "Which order is it?", the user statement text x3 is obtained as "Order 001", the reply text y3 is obtained as "Your refund has been successfully made, please check it." The reply text y1, reply text y2 and reply text y3 are input into a pre-trained text classification model to obtain the classification result a={a1,a2,a3}, where a1 is "general reply text", a2 is "general reply text", and a3 is "non-general reply text".

[0125] By applying the solution of the embodiments of this specification, a target expression text is obtained by inputting multiple user expression texts into a pre-trained intent recognition model, and the reply text corresponding to each user expression text is input into a pre-trained text classification model to obtain a classification result, thereby improving the efficiency of obtaining the target expression text and ensuring the accuracy of the classification result.

[0126] In one or more embodiments of this specification, the training method of the text classification model may include the following steps:

[0127] Obtain a response sample set, wherein the response sample set includes a plurality of response samples, and each response sample carries a sample label representing whether the response sample is a general response text;

[0128] Extracting a first response sample from the response sample set, wherein the first response sample is any response sample in the response sample set;

[0129] Inputting the first response sample into the preset model to obtain a first prediction result of the first response sample;

[0130] Calculate a second loss value according to the first prediction result and the first sample label carried by the first response sample;

[0131] If the second loss value is greater than the second preset threshold, adjusting the model parameters of the preset model, and returning to the step of extracting the first response sample;

[0132] If the second loss value is less than or equal to the second preset threshold, the training is stopped to obtain the trained text classification model.

[0133] It should be noted that when training a text classification model, it is necessary to obtain a reply sample set including multiple reply samples. The way to obtain the reply sample set can be to manually input a large number of reply samples to form a reply sample set, or to read a large number of reply samples from other data acquisition devices or databases to form a reply sample set. The way to obtain the reply sample set is selected according to the actual situation, and the embodiments of the present application do not impose any limitations on this.

[0134] Specifically, the preset model refers to a model that can recognize text, including but not limited to the Bert model, which is selected according to actual conditions, and the embodiments of this specification do not impose any limitation on this.

[0135] In an embodiment of the present specification, a first reply sample can be extracted from a reply sample set, wherein the first reply sample is any reply sample in the reply sample set, and the first reply sample is input into a preset model to obtain a first prediction result. After obtaining the first prediction result, the first prediction result and the first sample label carried by the first reply sample are compared to calculate a second loss value.

[0136] In a possible implementation, the second loss value may be compared with a second preset threshold.

[0137] Specifically, if the second loss value is greater than the second preset threshold, it means that the difference between the first prediction result and the first sample label carried by the first reply sample is large, and the trained text classification model has poor recognition ability for the first reply sample. At this time, the model parameters of the trained text classification model can be adjusted, and the step of extracting the first reply sample from the reply sample set can be returned to continue training the preset model until the first loss value is less than or equal to the first preset threshold, indicating that the difference between the first prediction result and the first sample label carried by the first reply sample is small, the training is completed, and the trained text classification model is obtained.

[0138] By applying the solution of the embodiments of the present specification, the second loss value of the first prediction result and the first sample label carried by the first response sample is calculated, and the second loss value is compared with the second preset threshold. When the loss value is greater than the second preset threshold, the preset model is continued to be trained until the training is completed when the loss value is less than or equal to the second preset threshold. By continuously adjusting the model parameters of the preset model, the trained text classification model can be made more accurate, thereby improving the accuracy of the text classification results.

[0139] In another possible implementation, in addition to comparing the second loss value and the second preset threshold, the number of iterations may be combined to determine whether the current preset model has been trained.

[0140] Specifically, if the second loss value is greater than the second preset threshold, the model parameters of the preset model are adjusted, and the step of extracting the first reply sample from the reply sample set is returned to continue training the preset model until the second preset number of iterations is reached, and the iteration is stopped to obtain the trained text classification model.

[0141] It should be noted that the second preset threshold and the second preset number of iterations are selected according to actual conditions, and the embodiments of this specification do not impose any limitation on this.

[0142] In practical applications, there are many functions for calculating the second loss value, such as cross entropy loss function, L1 norm loss function, maximum loss function, mean square error loss function, logarithmic loss function, etc. In the embodiments of this specification, the function for calculating the second loss value is not limited.

[0143] In actual applications, after obtaining the classification results corresponding to the target expression text and multiple reply texts in multiple user expression texts, there are multiple ways to determine the target reply text corresponding to the target expression text based on the target expression text and the classification results. The specific method is selected according to the actual situation, and the embodiments of this specification do not impose any limitations on this.

[0144] In a possible implementation, it is possible to determine in turn whether all reply texts corresponding to the user's expression text are universal reply texts, until non-universal text is found, and then use the non-universal reply text as the target reply text corresponding to the target expression text.

[0145] In another possible implementation, since a communication text may contain multiple leading intentions of the user, when judging whether all reply texts are common reply texts, the leading intention may be Figure 1 The corresponding reply text is used as the leading meaning Figure 2 Therefore, after obtaining the user's target expression text, the target position of the target expression text in the communication text can be obtained, and the target expression text can be located by traversing backward step by step from the position where the target expression text is located, skipping all common reply texts, that is, the above step of determining the target reply text corresponding to the target expression text according to the target expression text and the classification result can include the following steps:

[0146] In the communication text, find the target position of the target statement text;

[0147] Determine whether the classification result of the reply text after the target position is a general reply text;

[0148] If not, the response text corresponding to the classification result is used as the target response text corresponding to the target expression text.

[0149] Specifically, the process of determining whether the classification result of the reply text after the target position is a general reply text may be: input communication text d = {x1, y1, x2, y2, x3, y3, ..., x i ,y i}, the target position i of the target statement text and the classification result a of the reply text = {a1, a2, a3, ..., a i}. Set the position of the target reply text in the communication text to j, initialize j = i, and judge a j Is it a general reply text? jIf it is a general reply text, let j = i + 1 and return to judgment a j Is it a general reply text? j If it is a non-universal reply text, the reply text at position j is determined to be the target reply text corresponding to the target expression text.

[0150] For example, communication text d1 = {x1, y1, x2, y2, x3, y3} is obtained, where user expression text x1 is "Are you there?", reply text y1 is "How can I help you?", user expression text x2 is "My order needs to be refunded", reply text y2 is "Which order is it?", user expression text x3 is "Order 001", reply text y3 is "Your refund has been successfully made, please check it", and classification result a = {a1, a2, a3} is obtained, where a1 is "general reply text", a2 is "general reply text", and a3 is "non-general reply text". Further, the target expression text x2 is obtained, the target position of the target expression text x2 is found in the communication text d1, a2 is judged to be a general reply text, and then a3 is judged to be a "non-general reply text", and the reply text corresponding to a3 "Your refund has been successfully made, please check it" is used as the target reply text corresponding to the target expression text.

[0151] The solution of the embodiment of this specification is applied, by searching the target position of the target expression text in the communication text, determining whether the classification result of the reply text after the target position is a general reply text, and if not, using the reply text corresponding to the classification result as the target reply text corresponding to the target expression text, thereby improving the efficiency of determining the target reply text and improving the accuracy of the target reply text.

[0152] Step 106: Obtain satisfaction evaluation information corresponding to the target reply texts respectively.

[0153] In an embodiment of the present specification, after obtaining a communication text set and determining a target reply text corresponding to each communication text based on multiple user expression texts and reply texts corresponding to each user expression text, satisfaction evaluation information corresponding to the target reply text in each communication text in the communication text set can be obtained.

[0154] Specifically, the satisfaction evaluation information refers to the information on the user's satisfaction evaluation of the target reply text. The satisfaction evaluation information z can be "satisfied" or dissatisfied, or it can be a satisfaction evaluation score. The specific selection is based on actual conditions, and the embodiments of the present application do not impose any limitations on this.

[0155] Exemplarily, the communication text set D = {d1, d2, d3, d4}, the user's satisfaction evaluation information z1 for the target reply text 1 in the communication text d1 is "satisfied", the user's satisfaction evaluation information z2 for the target reply text 2 in the communication text d2 is "dissatisfied", the user's satisfaction evaluation information z3 for the target reply text 3 in the communication text d3 is "dissatisfied", and the user's satisfaction evaluation information z4 for the target reply text 4 in the communication text d4 is "satisfied".

[0156] Step 108: Calculate the correlation between the target reply text and the satisfaction evaluation information.

[0157] In an embodiment of the present specification, after obtaining a communication text set, determining a target reply text corresponding to each communication text based on multiple user expression texts and the reply text corresponding to each user expression text, and respectively obtaining satisfaction evaluation information corresponding to the target reply text, the correlation between the target reply text and the satisfaction evaluation information can be calculated.

[0158] It should be noted that the correlation between the target reply text and the satisfaction evaluation information can be "correlated" or uncorrelated, or it can be a correlation score, which is selected according to the actual situation. The embodiment of the present application does not impose any limitation on this.

[0159] In practical applications, the communication texts in the communication text set can be divided into two groups based on the satisfaction evaluation information. Furthermore, the target reply texts in the communication texts with z = "satisfied" constitute the target reply text set P, and the target reply texts in the communication texts with z = "unsatisfied" constitute the target reply text set N. For each target reply text y in the P set and the N set, it can be converted into a word sequence Segment(y) = {w1, w2, ..., w i}. i ={y|wi∈Segment(y)}, that is, the set W i are all the words containing the word w i The target reply text set. For each word w i , calculating the point mutual information between each word and the satisfaction, that is, the step of calculating the correlation between the target reply text and the satisfaction evaluation information, can include the following steps:

[0160] Segment the target reply text to obtain a target word sequence of the target reply text;

[0161] Calculate the word correlation between each word in the target word sequence and the satisfaction evaluation information;

[0162] The word relevances are sorted, and a preset number of word relevances are added together to obtain the relevance of the target reply text.

[0163] It should be noted that there are many ways to segment the target reply text, including but not limited to using a preset segmentation tool and a preset segmentation table. The specific selection is based on the actual situation, and the embodiment of the present application does not impose any limitation on this.

[0164] Specifically, the word w can be calculated using Formula 1 i The correlation score with "satisfaction" scoreP(w i ), use formula 2 to calculate word w i The correlation score with “unsatisfied” scoreN(w i ). Among them, scoreP(w i ) is larger, the more the word w i The higher the correlation with "satisfaction", the higher the scoreN(w i ) is larger, the more the word w i The higher the correlation with “dissatisfaction”.

[0165] After obtaining scoreP(w i ) and scoreN(w i ) and then scoreP(w i ) are sorted, and the preset number of word relevances are added to obtain the positive relevance of the target reply text. i ) are sorted, and a preset number of word relevances are added to obtain the negative relevance of the target reply text.

[0166]

[0167]

[0168] Among them, w i refers to the i-th word in the target response text.

[0169] By applying the scheme of the embodiments of this specification, the target reply text is segmented to obtain a target word sequence of the target reply text, the word relevance between each word in the target word sequence and the satisfaction evaluation information is calculated, the word relevance is sorted, a preset number of word relevances are added, and the relevance of the target reply text is obtained, thereby improving the accuracy of the target reply text.

[0170] Step 110: Determine a target response text set that meets a preset satisfaction condition based on the relevance.

[0171] In an embodiment of the present specification, after obtaining a communication text set, a target reply text corresponding to each communication text is determined based on multiple user expression texts and the reply text corresponding to each user expression text, and satisfaction evaluation information corresponding to the target reply text is obtained respectively. After calculating the correlation between the target reply text and the satisfaction evaluation information, a target reply text set that meets the preset satisfaction conditions can be determined based on the correlation.

[0172] Apply the scheme of the embodiments of this specification to obtain a communication text set, wherein the communication text set includes multiple communication texts, and the communication texts include multiple user expression texts and reply texts corresponding to each user expression text; determine the target reply text corresponding to each communication text based on the multiple user expression texts and the reply texts corresponding to each user expression text, ensure the correctness of the target reply text, so that the target reply text can solve the demands of the user expression text; obtain satisfaction evaluation information corresponding to the target reply text respectively; calculate the correlation between the target reply text and the satisfaction evaluation information; and determine the target reply text set that meets the preset satisfaction conditions based on the correlation, thereby improving the quality of each target reply text in the target reply text set and further improving the satisfaction of the overall communication service.

[0173] In practical applications, we get the positive score scoreP(y i ) and negative score scoreN(y i ) can be calculated according to the positive score scoreP(y i ) sorts each target reply text, constructs a positive target reply text set, and sorts it according to the negative score scoreN(y i ) sorting each target reply text to construct a negative target reply text set, that is, the step of determining the target reply text set that meets the preset satisfaction condition according to the correlation may include the following steps:

[0174] Sort the target response texts by relevance;

[0175] Based on the order of the target reply text, calculating the text similarity between the target reply text and each text in the target reply text set;

[0176] The target response text that meets the preset satisfaction condition is added to the target response text set, and when the preset stop condition is reached, the updated target response text set is obtained.

[0177] Specifically, obtain multiple target reply texts Y={y1,y2,y3,...,y i}, the target reply text set Y' is obtained. If Y' = empty set, the target reply text with the greatest correlation is added to the target reply text set Y' to obtain Y' = {yi '}, use formula 3 to calculate y i and the target response text y in the target response text set Y' i 'The similarity between sim(y i ,y i '), in the similarity sim(y i ,y i ') is greater than the preset output threshold, y i Add to the target reply text set Y', if the similarity sim(y i ,y i ') is less than or equal to the preset output threshold, returns to execute y i+1 and the target response text y in the target response text set Y' i 'The similarity between sim(y i ,y i '), when the size of the target reply text set Y' exceeds the output quantity, the text processing is terminated to obtain the updated target reply text set.

[0178]

[0179] Among them, dist(y i ,y i ') is y i and i 'Edit distance, |y i | and |y i '| is the length of the text.

[0180] By applying the scheme of the embodiments of this specification, the target reply texts are sorted according to relevance, and based on the order of the target reply texts, the text similarity between the target reply text and each text in the target reply text set is calculated, and the target reply text that meets the preset satisfaction conditions is added to the target reply text set. When the preset stop condition is reached, an updated target reply text set is obtained, thereby improving the accuracy of the target reply text set and further improving the overall communication service satisfaction.

[0181] See also Figure 2 , Figure 2 A flow chart of a method for training an intent recognition model in a text processing method provided in an embodiment of this specification is shown, which may specifically include the following steps:

[0182] Step 202: Obtain an expression sample set, wherein the expression sample set includes multiple expression samples, and each expression sample carries an intent label.

[0183] Step 204: extracting a first expression sample from the expression sample set, wherein the first expression sample is any expression sample in the expression sample set.

[0184] Step 206: Input the first expression sample into the preset model to obtain the first predicted intention of the first expression sample.

[0185] Step 208: Calculate a first loss value according to the first predicted intent and the first intent label carried by the first expression sample.

[0186] Step 210: If the first loss value is greater than the first preset threshold, the model parameters of the preset model are adjusted, and the process returns to the step of extracting the first description sample from the description sample set.

[0187] Step 212: If the first loss value is less than or equal to the first preset threshold, stop training and obtain a trained intent recognition model.

[0188] It should be noted that when training an intent recognition model, it is necessary to obtain a statement sample set including multiple statement samples. The method for obtaining the statement sample set can be a large number of statement samples manually input to form a statement sample set, or a large number of statement samples can be read from other data acquisition devices or databases to form a statement sample set. The method for obtaining the statement sample set is selected according to the actual situation, and the embodiments of the present application do not impose any limitations on this.

[0189] Specifically, the preset model refers to a model that can recognize text, including but not limited to the Bert model, which is selected according to actual conditions, and the embodiments of this specification do not impose any limitation on this.

[0190] In an embodiment of the present specification, a first expression sample can be extracted from a expression sample set, wherein the first expression sample is any expression sample in the expression sample set, and the first expression sample is input into a preset model to obtain a first predicted intent. After obtaining the first predicted intent, the first predicted intent and the first intent label carried by the first expression sample are compared to calculate a first loss value.

[0191] In a possible implementation, the first loss value may be compared with a first preset threshold.

[0192] Specifically, if the first loss value is greater than the first preset threshold, it means that the difference between the first predicted intention and the first intent label carried by the first expression sample is large, and the trained intent recognition model has poor recognition ability for the first expression sample. At this time, the model parameters of the trained intent recognition model can be adjusted, and the step of extracting the first expression sample from the expression sample set can be returned to continue training the preset model until the first loss value is less than or equal to the first preset threshold, indicating that the difference between the first predicted intention and the first intent label carried by the first expression sample is small, the training is completed, and the trained intent recognition model is obtained.

[0193] By applying the solution of the embodiments of the present specification, the first loss value of the first intent label carried by the first predicted intent and the first expression sample is calculated, and the first loss value is compared with the first preset threshold. When the loss value is greater than the first preset threshold, the preset model is continued to be trained until the training is completed when the loss value is less than or equal to the first preset threshold. By continuously adjusting the model parameters of the preset model, the trained intent recognition model can be made more accurate, thereby improving the accuracy of the intent recognition results.

[0194] In another possible implementation, in addition to comparing the first loss value and the first preset threshold, the number of iterations may be combined to determine whether the current preset model has been trained.

[0195] Specifically, if the first loss value is greater than the first preset threshold, the model parameters of the preset model are adjusted, and the step of extracting the first expression sample from the expression sample set is returned to continue training the preset model until the first preset number of iterations is reached, and the iteration is stopped to obtain the trained intent recognition model.

[0196] It should be noted that the first preset threshold and the first preset number of iterations are selected according to actual conditions, and the embodiments of this specification do not impose any limitation on this.

[0197] In practical applications, there are many functions for calculating the first loss value, such as cross entropy loss function, L1 norm loss function, maximum loss function, mean square error loss function, logarithmic loss function, etc. In the embodiments of this specification, the function for calculating the first loss value is not limited.

[0198] Preferably, a cross entropy loss function can be used to calculate the cross entropy between the first predicted intent and the first intent label carried by the first expression sample as the first loss value, wherein the cross entropy loss function is shown in Formula 4.

[0199]

[0200] Among them, C represents the number of categories, p i is the true probability value, q i is the predicted probability value, and i is the i-th character.

[0201] By applying the solution of the embodiment of this specification, the cross entropy loss function is used to calculate the cross entropy between the first predicted intent and the first intent label carried by the first expression sample as the first loss value, thereby improving the efficiency of calculating the first loss value and thus improving the efficiency of training the intent recognition model.

[0202] In practical applications, in order to improve the accuracy of the intent recognition model, it can be determined whether the number of user expression samples is greater than the preset number of samples. For example, for each leading intent, the number of user expression samples should be greater than 50. When the number of user expression samples is greater than 50, the user expression samples are directly integrated to form an expression sample set; when the number of user expression samples is less than 50, the user expression samples can be supplemented, that is, the above step of obtaining the expression sample set can include the following steps:

[0203] Acquire a plurality of preset intention expression sample sets, wherein the plurality of intention expression sample sets correspond to different expression intentions respectively;

[0204] Determining whether the number of intent expression samples in the plurality of intent expression sample sets is greater than a preset number of samples;

[0205] If not, obtain the communication sample set, and calculate the sample similarity between each intention expression sample in the intention expression sample set and each communication sample in the communication sample set;

[0206] According to the sample similarity, the intent expression sample set is expanded to obtain an updated intent expression sample set;

[0207] According to multiple intent expression sample sets, an expression sample set is obtained.

[0208] It should be noted that the intention expression sample set refers to a set of multiple samples that express user intentions, and the communication sample set refers to a set of multiple user expression samples.

[0209] In an embodiment of the present specification, after obtaining a plurality of pre-set intent expression sample sets, for any intent expression sample set in the plurality of intent expression sample sets, it is determined whether the number of intent expression samples in the intent expression sample set is greater than the preset number of samples. If so, the plurality of intent expression sample sets are integrated to obtain an expression sample set; if not, the intent expression sample sets are expanded until the number of intent expression samples in each intent expression sample set is greater than the preset number of samples, thereby obtaining an expression sample set.

[0210] Specifically, there are multiple ways to expand the intent expression sample set, which are selected according to actual conditions, and the embodiments of this specification do not impose any limitation on this.

[0211] In one possible implementation, samples may be randomly extracted directly from the communication text to expand the sample set of intent expressions.

[0212] In another possible implementation, in order to make the expanded intent expression sample set more accurate, the sample similarity between each intent expression sample in the intent expression sample set and each communication sample in the communication sample set may be calculated, and the intent expression sample set may be expanded based on the sample similarity.

[0213] Specifically, obtain the intention expression sample set S = {s1, s2, s3, ..., s i}, where s i is the i-th intention expression sample in the intention expression sample set; the communication sample set T = {t1, t2, t3, ..., t i}, where t i is the i-th communication sample in the communication sample set. After obtaining the intention expression sample set and the communication sample set, the sample sentences in the intention expression sample set are converted into sample semantic vectors to obtain the set V = {v1, v2, v3, ..., v i}, convert the sample sentences in the communication sample set into sample semantic vectors, and obtain the set U = {u1,u2,u3,...,u j}, for each intent expression sample in the intent expression sample set S, use Formula 5 to calculate its sample semantic vector v i With all sample semantic vectors u in set U j The cosine similarity between them is used as the sample similarity.

[0214]

[0215] Among them, v i refers to the semantic vector of the i-th sample in the set V, u j It refers to the jth sample semantic vector in the set U.

[0216] It should be noted that the sample sentences can be directly mapped to sample semantic vectors, or converted using a pre-trained vector model. The specific selection is made based on the actual situation, and the embodiments of this specification do not impose any limitation on this.

[0217] After obtaining the sample similarity, the samples can be sorted according to the sample similarity, and communication samples corresponding to a preset number of sample similarities can be added to the intention expression sample set to obtain an updated intention expression sample set, and then the intention expression sample sets corresponding to each expression intention can be integrated to obtain the expression sample set.

[0218] The scheme of the embodiment of the present specification is applied, by obtaining multiple pre-set intent expression sample sets, wherein the multiple intent expression sample sets respectively correspond to different expression intentions, and respectively judging whether the number of intent expression samples in the multiple intent expression sample sets is greater than the preset sample number; if not, obtaining a communication sample set, calculating the sample similarity between each intent expression sample in the intent expression sample set and each communication sample in the communication sample set, and based on the sample similarity, expanding the intent expression sample set to obtain an updated intent expression sample set; based on the multiple intent expression sample sets, obtaining an expression sample set, and the expanded expression sample set, so that the intent recognition model obtained by training with the expression sample set is more accurate.

[0219] The following combination Figure 3 , taking the application of the text processing method provided in this specification in the customer service scenario as an example, the text processing method is further explained. Figure 3 A flowchart of a text processing method provided by an embodiment of the present specification is shown, which specifically includes the following steps.

[0220] Step 302: Acquire a communication text set, wherein the communication text set includes a plurality of communication texts, and the communication texts include a plurality of customer expression texts and a customer service reply text corresponding to each customer expression text.

[0221] Step 304: perform intent recognition on multiple customer expression texts to obtain a target expression text from the multiple customer expression texts.

[0222] Step 306: Classify the customer service reply text corresponding to each customer statement text to obtain classification results corresponding to multiple customer service reply texts.

[0223] Step 308: Determine the target reply text corresponding to the target expression text according to the target expression text and the classification result.

[0224] Step 310: Obtain satisfaction evaluation information corresponding to the target reply text respectively.

[0225] Step 312: Segment the target reply text to obtain a target word sequence of the target reply text.

[0226] Step 314: Calculate the word correlation between each word in the target word sequence and the satisfaction evaluation information.

[0227] Step 316: Sort the word relevances, add a preset number of word relevances, and obtain the relevance of the target reply text.

[0228] Step 318: Sort the target reply texts according to relevance.

[0229] Step 320: Based on the order of the target reply text, calculate the text similarity between the target reply text and each text in the target reply text set.

[0230] Step 322: Add the target reply text that meets the preset satisfaction condition to the target reply text set, and when the preset stop condition is reached, obtain the updated target reply text set.

[0231] By applying the scheme of the embodiments of this specification, the target reply text corresponding to the target expression text is determined according to the target expression text and the classification result, the correctness of the target reply text is ensured so that the target reply text can address the demands of the user expression text, the target reply text is sorted according to relevance, and based on the order of the target reply text, the text similarity between the target reply text and each text in the target reply text set is calculated, and the target reply text that meets the preset satisfaction conditions is added to the target reply text set. When the preset stop condition is reached, an updated target reply text set is obtained, which improves the accuracy of the target reply text set and further improves the satisfaction of the overall communication service.

[0232] It should be noted that the technical solution of this text processing method is the same as the above Figure 1 The technical solutions of the text processing methods shown belong to the same concept. For details not described in detail in the technical solutions of the text processing methods, please refer to Figure 1 A description of the technical solution of the text processing method is shown.

[0233] Corresponding to the above method embodiment, this specification also provides a text processing device embodiment, Figure 4 FIG. 1 shows a schematic diagram of the structure of a text processing device provided by an embodiment of the present specification. Figure 4 As shown, the device comprises:

[0234] The first acquisition module 402 is configured to acquire a communication text set, wherein the communication text set includes a plurality of communication texts, and the communication texts include a plurality of user expression texts and a reply text corresponding to each user expression text;

[0235] The first determination module 404 is configured to determine a target reply text corresponding to each communication text according to a plurality of user expression texts and a reply text corresponding to each user expression text;

[0236] The second acquisition module 406 is configured to respectively acquire satisfaction evaluation information corresponding to the target reply text;

[0237] A calculation module 408 is configured to calculate the correlation between the target reply text and the satisfaction evaluation information;

[0238] The second determination module 410 is configured to determine a target reply text set that meets a preset satisfaction condition based on the relevance.

[0239] Optionally, the first determination module 404 is further configured to perform intent recognition on multiple user expression texts to obtain a target expression text from the multiple user expression texts; classify the reply texts corresponding to each user expression text to obtain classification results corresponding to the multiple reply texts; and determine the target reply text corresponding to the target expression text based on the target expression text and the classification results.

[0240] Optionally, the first determination module 404 is further configured to input multiple user expression texts into a pre-trained intention recognition model to obtain a target expression text;

[0241] The first determination module 404 is further configured to input the reply text corresponding to each user's expression text into a pre-trained text classification model to obtain a classification result.

[0242] Optionally, the first determination module 404 is further configured to search for a target position of the target expression text in the communication text; determine whether the classification result of the reply text after the target position is a general reply text; if not, use the reply text corresponding to the classification result as the target reply text corresponding to the target expression text.

[0243] Optionally, the device further comprises:

[0244] The first training module is further configured to obtain a statement sample set, wherein the statement sample set includes multiple statement samples, each statement sample carries an intent label; extract a first statement sample from the statement sample set, wherein the first statement sample is any statement sample in the statement sample set; input the first statement sample into a preset model to obtain a first predicted intent of the first statement sample; calculate a first loss value based on the first predicted intent and the first intent label carried by the first statement sample; if the first loss value is greater than a first preset threshold, adjust the model parameters of the preset model, and return to execute the step of extracting the first statement sample from the statement sample set; if the first loss value is less than or equal to the first preset threshold, stop training to obtain a trained intent recognition model.

[0245] Optionally, the first training module is further configured to obtain multiple pre-set intention expression sample sets, wherein the multiple intention expression sample sets correspond to different expression intentions respectively; determine whether the number of intention expression samples in the multiple intention expression sample sets is greater than the preset sample number; if not, obtain the communication sample set, calculate the sample similarity between each intention expression sample in the intention expression sample set and each communication sample in the communication sample set; expand the intention expression sample set according to the sample similarity to obtain an updated intention expression sample set; and obtain an expression sample set based on the multiple intention expression sample sets.

[0246] Optionally, the device further comprises:

[0247] The second training module is further configured to obtain a reply sample set, wherein the reply sample set includes multiple reply samples, and each reply sample carries a sample label representing whether the reply sample is a general reply text; extract a first reply sample from the reply sample set, wherein the first reply sample is any reply sample in the reply sample set; input the first reply sample into a preset model to obtain a first prediction result of the first reply sample; calculate a second loss value based on the first prediction result and the first sample label carried by the first reply sample; if the second loss value is greater than a second preset threshold, adjust the model parameters of the preset model, and return to execute the step of extracting the first reply sample; if the second loss value is less than or equal to the second preset threshold, stop training to obtain a trained text classification model.

[0248] Optionally, the calculation module 408 is further configured to segment the target reply text to obtain a target word sequence of the target reply text; calculate the word relevance between each word in the target word sequence and the satisfaction evaluation information; sort the word relevance, add a preset number of word relevances, and obtain the relevance of the target reply text.

[0249] Optionally, the second determination module 410 is further configured to sort the target reply texts according to relevance; calculate the text similarity between the target reply texts and each text in the target reply text set based on the order of the target reply texts; add the target reply texts that meet the preset satisfaction conditions to the target reply text set, and obtain an updated target reply text set when the preset stop condition is met.

[0250] Apply the scheme of the embodiments of this specification to obtain a communication text set, wherein the communication text set includes multiple communication texts, and the communication texts include multiple user expression texts and reply texts corresponding to each user expression text; determine the target reply text corresponding to each communication text based on the multiple user expression texts and the reply texts corresponding to each user expression text, ensure the correctness of the target reply text, so that the target reply text can solve the demands of the user expression text; obtain satisfaction evaluation information corresponding to the target reply text respectively; calculate the correlation between the target reply text and the satisfaction evaluation information; and determine the target reply text set that meets the preset satisfaction conditions based on the correlation, thereby improving the quality of each target reply text in the target reply text set and further improving the satisfaction of the overall communication service.

[0251] The above is a schematic scheme of a text processing device of this embodiment. It should be noted that the technical scheme of the text processing device and the technical scheme of the above text processing method belong to the same concept, and the details not described in detail in the technical scheme of the text processing device can be referred to the description of the technical scheme of the above text processing method.

[0252] Figure 5 The structure block diagram of a computing device 500 provided according to an embodiment of the present specification is shown. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.

[0253] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world microwave interconnection access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0254] In one embodiment of the present specification, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0255] Computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 400 may also be a mobile or stationary server.

[0256] The processor 520 is used to execute the following computer executable instructions, which implement the steps of the above-mentioned text processing method when executed by the processor.

[0257] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above text processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above text processing method.

[0258] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above-mentioned text processing method when executed by a processor.

[0259] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above text processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above text processing method.

[0260] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned text processing method.

[0261] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the above text processing method belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be referred to the description of the technical scheme of the above text processing method.

[0262] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0263] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0264] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0265] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0266] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A text processing method, comprising: Acquire a communication text set, wherein the communication text set includes a plurality of communication texts, and the communication texts include a plurality of user expression texts and a reply text corresponding to each user expression text; Determining a target reply text corresponding to each communication text according to the multiple user expression texts and the reply text corresponding to each user expression text, wherein the target reply text refers to the reply text of the target expression text expressing the leading intention in the communication text; Respectively obtain satisfaction evaluation information corresponding to the target reply text; Calculating the correlation between the target reply text and the satisfaction evaluation information, wherein the calculating the correlation between the target reply text and the satisfaction evaluation information comprises: segmenting the target reply text to obtain a target word sequence of the target reply text; calculating the word correlation between each word in the target word sequence and the satisfaction evaluation information, wherein the word correlation comprises a correlation score between each word and satisfaction and a correlation score between each word and dissatisfaction; determining the relevance of the target reply text according to the word correlation; Based on the relevance, a target response text set that meets preset satisfaction conditions is determined.

2. According to the method of claim 1, the step of determining the target reply text corresponding to each communication text according to the multiple user expression texts and the reply text corresponding to each user expression text comprises: Performing intent recognition on the multiple user expression texts to obtain a target expression text from the multiple user expression texts; Classifying the reply texts corresponding to the user expression texts to obtain classification results corresponding to the plurality of reply texts; According to the target expression text and the classification result, a target reply text corresponding to the target expression text is determined.

3. According to the method of claim 2, the step of performing intent recognition on the multiple user expression texts to obtain the target expression text from the multiple user expression texts comprises: Inputting the multiple user expression texts into a pre-trained intent recognition model to obtain the target expression text; The step of classifying the reply texts corresponding to the user expression texts to obtain classification results corresponding to the plurality of reply texts includes: The reply text corresponding to each user's expression text is input into a pre-trained text classification model to obtain the classification result.

4. According to the method of claim 2, the step of determining the target reply text corresponding to the target expression text according to the target expression text and the classification result comprises: In the communication text, searching for the target position of the target expression text; Determine whether the classification result of the reply text after the target position is a general reply text; If not, the reply text corresponding to the classification result is used as the target reply text corresponding to the target expression text.

5. According to the method of claim 3, the training method of the intent recognition model includes: Acquire a statement sample set, wherein the statement sample set includes a plurality of statement samples, each statement sample carries an intent label; Extracting a first expression sample from the expression sample set, wherein the first expression sample is any expression sample in the expression sample set; Inputting the first expression sample into a preset model to obtain a first predicted intention of the first expression sample; Calculating a first loss value according to the first predicted intent and a first intent label carried by the first expression sample; If the first loss value is greater than a first preset threshold, adjusting the model parameters of the preset model, and returning to execute the step of extracting the first description sample from the description sample set; If the first loss value is less than or equal to a first preset threshold, the training is stopped to obtain a trained intent recognition model.

6. The method according to claim 5, wherein the step of obtaining a sample set of representations comprises: Acquire a plurality of preset intention expression sample sets, wherein the plurality of intention expression sample sets correspond to different expression intentions respectively; Determining whether the number of intent expression samples in the plurality of intent expression sample sets is greater than a preset number of samples; If not, obtain a communication sample set, and calculate the sample similarity between each intention expression sample in the intention expression sample set and each communication sample in the communication sample set; Expanding the intention expression sample set according to the sample similarity to obtain an updated intention expression sample set; The expression sample set is obtained according to the multiple intention expression sample sets.

7. According to the method of claim 3, the training method of the text classification model comprises: Acquire a reply sample set, wherein the reply sample set includes a plurality of reply samples, and each reply sample carries a sample label indicating whether the reply sample is a general reply text; Extracting a first reply sample from the reply sample set, wherein the first reply sample is any reply sample in the reply sample set; Inputting the first response sample into a preset model to obtain a first prediction result of the first response sample; Calculating a second loss value according to the first prediction result and the first sample label carried by the first response sample; If the second loss value is greater than a second preset threshold, adjusting the model parameters of the preset model, and returning to execute the step of extracting the first response sample; If the second loss value is less than or equal to a second preset threshold, the training is stopped to obtain a trained text classification model.

8. The method according to claim 1, wherein determining the relevance of the target reply text according to the word relevance comprises: The word relevances are sorted, and a preset number of word relevances are added to obtain the relevance of the target reply text.

9. The method according to claim 1, wherein the step of determining a target reply text set that meets a preset satisfaction condition based on the correlation comprises: sorting the target reply texts according to the relevance; Based on the order of the target reply texts, calculating the text similarity between the target reply text and each text in the target reply text set; The target reply text that meets the preset satisfaction condition is added to the target reply text set, and when the preset stop condition is reached, an updated target reply text set is obtained.

10. A text processing device, comprising: A first acquisition module is configured to acquire a communication text set, wherein the communication text set includes a plurality of communication texts, and the communication texts include a plurality of user expression texts and a reply text corresponding to each user expression text; A first determination module is configured to determine a target reply text corresponding to each communication text according to the multiple user expression texts and the reply text corresponding to each user expression text, wherein the target reply text refers to the reply text of the target expression text expressing the leading intention in the communication text; A second acquisition module is configured to respectively acquire satisfaction evaluation information corresponding to the target reply text; A calculation module is configured to calculate the correlation between the target reply text and the satisfaction evaluation information, wherein the calculation of the correlation between the target reply text and the satisfaction evaluation information includes: segmenting the target reply text to obtain a target word sequence of the target reply text; calculating the word correlation between each word in the target word sequence and the satisfaction evaluation information, wherein the word correlation includes a correlation score between each word and satisfaction and a correlation score between each word and dissatisfaction; and determining the correlation of the target reply text according to the word correlation; The second determination module is configured to determine a target reply text set that meets a preset satisfaction condition based on the correlation.

11. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the text processing method according to any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the text processing method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Intelligent interaction method and device, computer equipment and storage medium

    CN110995569A

  • Personalized government affair man-machine natural interaction service system

    CN112527983A