Training method of dialogue behavior classification model, dialogue log processing method and device

By analyzing and filtering dialogue logs using a dialogue behavior classification model, the dialogue flow can be quickly extracted, solving the problem of high costs for merchants to create their own dialogue flows and enabling efficient configuration of customer service robot dialogue flows.

CN115147131BActive Publication Date: 2026-01-27ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210775659.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-01
Publication Date
2026-01-27
Estimated Expiration
2042-07-01

AI Technical Summary

Technical Problem

In existing technologies, merchants need to spend a lot of manpower and time to create their own conversational flow to train customer service robots, resulting in high costs and low efficiency.

Method used

By analyzing dialogue logs using a pre-trained dialogue behavior classification model, dialogue flows can be quickly extracted for configuring a customer service robot through dialogue behavior classification and filtering.

Benefits of technology

It improves the efficiency and effectiveness of dialogue stream extraction, reduces manpower and time costs, and enables rapid configuration and efficient utilization of dialogue streams.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115147131B_ABST
    Figure CN115147131B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a training method of a dialogue behavior classification model, a dialogue log processing method and device, wherein the dialogue log can be analyzed and processed by using a dialogue behavior classification model which is trained in advance to classify the dialogue behavior of the dialogue log, and the behavior sequence of the dialogue log is filtered based on the dialogue behavior of each dialogue sentence, so that the dialogue flow in the dialogue log can be quickly extracted based on the effective behavior sequence after the filtering, and the extraction efficiency of the dialogue flow is high, and the extraction effect is good.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a training method for a dialogue behavior classification model, a dialogue log processing method, and an apparatus. Background Technology

[0002] With the development of computer technology, it has become possible to apply customer service robots in the customer service industry.

[0003] To enable customer service robots to provide accurate responses like human customer service representatives, they need to be trained using a dialogue flow that reflects customer needs and customer service responses. This allows the robot to handle customer requests accordingly. The quality of the dialogue flow significantly impacts the accuracy of the robot's responses.

[0004] In the current scenario, the dialogue stream is created by the merchant. In order to obtain a high-quality dialogue stream, the merchant often needs to spend a lot of manpower and time to analyze the past dialogue logs to extract effective information as the dialogue stream, which is costly. Summary of the Invention

[0005] This application provides a training method for a dialogue behavior classification model, a dialogue log processing method and apparatus, which can quickly extract dialogue streams from dialogue logs, enabling customer service representatives to configure intelligent customer service functions for customer service robots using these dialogue streams.

[0006] In a first aspect, embodiments of this application provide a method for processing dialogue logs, including:

[0007] The process involves identifying dialogue logs to be processed, which include multiple dialogue statements generated during customer service conversations. A pre-trained dialogue behavior classification model is used to process the dialogue logs, resulting in a behavior sequence. This behavior sequence includes the dialogue behavior for each dialogue statement in the log. Each dialogue behavior in the behavior sequence is traversed and filtered to obtain a valid behavior sequence. Based on the valid behavior sequence, segments are extracted from the dialogue logs to obtain the dialogue flow.

[0008] As can be seen, in this embodiment, a pre-trained dialogue behavior classification model can be used to analyze and process the dialogue logs to classify the dialogue behavior of the dialogue logs. Then, the behavior sequence of the dialogue logs can be traversed and filtered based on the dialogue behavior of each dialogue statement. This allows for the rapid extraction of the dialogue flow in the dialogue logs based on the effective behavior sequence after traversal and filtering. The extraction efficiency of the dialogue flow is high and the extraction effect is good.

[0009] Optionally, dialogue behaviors include intentional dialogue behaviors, questioning dialogue behaviors, and answering dialogue behaviors;

[0010] The effective behavior sequence is obtained by traversing and filtering each dialogue behavior in the behavior sequence, including: extracting multiple consecutive dialogue behaviors from the behavior sequence according to the order of each type of dialogue behavior in the behavior sequence to form an effective behavior sequence; wherein, among the multiple dialogue behaviors that constitute an effective behavior sequence, the type of the dialogue behavior at the beginning is the intention dialogue behavior, the type of the dialogue behavior at the end is the response dialogue behavior, and the dialogue behaviors between the beginning and the end do not include dialogue behaviors of the type of intention dialogue behavior or response dialogue behavior.

[0011] As can be seen, in this embodiment, dialogue behavior is divided into types of intent dialogue behavior, question dialogue behavior, and answer dialogue behavior, so that the model can determine the dialogue behavior corresponding to each dialogue statement. In the process of filtering to obtain effective behavior sequences, by filtering and judging based on the type and order of dialogue behavior corresponding to each dialogue statement, effective behavior sequences that conform to the dialogue flow dialogue behavior habits can be quickly determined from the behavior sequences corresponding to the dialogue log, thereby facilitating the rapid extraction of the dialogue flow from the dialogue log.

[0012] Optionally, based on the order of dialogue behaviors of each type in the behavior sequence, multiple consecutive dialogue behaviors are extracted from the behavior sequence to form a valid behavior sequence, including: selecting any questioning dialogue behavior from the behavior sequence as the target questioning dialogue behavior; among the intentional dialogue behaviors in the behavior sequence, determining whether there exists an intentional dialogue behavior that precedes the target questioning dialogue behavior and is not related to any other intentional or answering dialogue behaviors between it and the target questioning dialogue behavior; if so, then using this intentional dialogue behavior as the target intentional dialogue behavior of the target questioning dialogue behavior; otherwise, selecting the next questioning dialogue behavior from the behavior sequence as the target questioning dialogue behavior; among the answering dialogue behaviors in the behavior sequence, determining whether there exists an answering dialogue behavior that follows the target questioning dialogue behavior and is not related to any other intentional or answering dialogue behaviors between it and the target questioning dialogue behavior; if so, then using this answering dialogue behavior as the target answering dialogue behavior of the target questioning dialogue behavior; otherwise, selecting the next questioning dialogue behavior from the behavior sequence as the target questioning dialogue behavior; extracting the target intentional dialogue behavior, the target answering dialogue behavior, and all dialogue behaviors between the target intentional dialogue behavior and the target answering dialogue behavior to form a valid behavior sequence.

[0013] It is understood that in the extraction of effective behavior sequences provided in this embodiment, by taking the target question dialogue behavior as the center, judging whether there are target intention dialogue behaviors and target answer dialogue behaviors in the behavior sequence that correspond to the target question dialogue behavior, and then extracting effective behavior sequences that can be used to characterize the question-and-answer meaning in the dialogue log based on the judgment result.

[0014] Dialogue behaviors are categorized into intent dialogue behaviors, question dialogue behaviors, and answer dialogue behaviors. This allows the model to determine the dialogue behavior corresponding to each dialogue statement. In the process of filtering out effective behavior sequences, the model can quickly identify effective behavior sequences that conform to the dialogue flow dialogue behavior habits from the behavior sequences corresponding to each dialogue statement by filtering and judging based on the type and order of dialogue behaviors corresponding to each dialogue statement. This makes it easier to quickly extract the dialogue flow from the dialogue log.

[0015] Optionally, the dialogue behavior classification model includes a customer service dialogue behavior classification sub-model and a customer dialogue behavior classification sub-model;

[0016] The dialogue logs are processed using a pre-trained dialogue behavior classification model to obtain the behavior sequence of the dialogue logs. This includes: inputting the dialogue statements initiated by customer service representatives into the customer service dialogue behavior classification sub-model and outputting the customer service representatives' dialogue behaviors, which include questioning and answering dialogue behaviors; inputting the dialogue statements initiated by customers into the customer dialogue behavior classification sub-model and outputting the customer's dialogue behaviors, which include intent dialogue behaviors; and obtaining the behavior sequence based on the customer service representatives' dialogue behaviors corresponding to the dialogue statements initiated by customer service representatives and the customer's dialogue behaviors corresponding to the dialogue statements initiated by customer service representatives.

[0017] It is evident that by using the customer service dialogue behavior classification sub-model and the customer dialogue behavior classification sub-model to input the dialogue statements initiated by customer service and the dialogue statements initiated by customers in the dialogue log into the corresponding sub-models, the dialogue behavior of each output dialogue statement can be made more accurate, effectively improving the extraction effect of effective behavior sequences.

[0018] Optionally, the dialogue log is segmented according to the effective action sequence to obtain the dialogue flow of the dialogue log, including: among the multiple dialogue actions that constitute the effective action sequence, the dialogue statement corresponding to the dialogue action at the beginning of the effective action sequence is taken as the first sentence of the dialogue flow; the dialogue statement corresponding to the dialogue action at the end of the effective action sequence is taken as the last sentence of the dialogue flow; the first sentence, the last sentence, and the dialogue statements in the dialogue log located between the first sentence and the last sentence constitute the dialogue flow.

[0019] Optionally, determine the dialogue logs to be processed, including:

[0020] Obtain a set of historical dialogue logs, which includes multiple historical dialogue logs generated by customer service representatives interacting with customers; perform scenario localization on each historical dialogue log to obtain the scenario intent of each historical dialogue; and / or determine the interaction rounds of each historical dialogue log; and / or determine whether each historical dialogue log includes dialogue statements from customer service representatives; select historical dialogue logs that meet preset conditions as dialogue logs to be processed; wherein the preset conditions include: the scenario intent of the historical dialogue log is a consultation intent, and / or, the interaction rounds of the historical dialogue log are greater than a preset rounds threshold, and / or, the historical dialogue log includes dialogue statements from customer service representatives.

[0021] It is understood that, in order to achieve better processing results for dialogue logs, this embodiment will also pre-screen each historical dialogue log in the historical dialogue log set, so that historical dialogue logs that meet certain preset conditions are used as dialogue logs to be processed. This makes the dialogue flow extracted based on the dialogue logs to be processed more able to show the key information in the customer service question and answer process, which is conducive to the configuration of customer service robots.

[0022] Secondly, embodiments of this application provide a method for training a dialogue behavior classification model, including:

[0023] Determine the dialogue log set, which includes multiple dialogue logs generated by customer service representatives during dialogues with customers. Each dialogue log contains multiple dialogue statements.

[0024] Based on the dialogue statements in each dialogue log, determine the dialogue rules corresponding to each type of dialogue behavior;

[0025] Based on each dialogue rule, sample extraction processing is performed on each dialogue statement in each dialogue log to obtain a set of positive and negative samples corresponding to each type of dialogue behavior;

[0026] The pre-built dialogue behavior classification model is trained using various positive and negative sample sets to obtain the trained dialogue behavior classification model. The trained dialogue behavior classification model is used to classify and identify the behavior of the dialogue log to be processed, and obtain the behavior sequence of the dialogue log to be processed. The behavior sequence includes the dialogue behavior of each dialogue statement in the dialogue log to be processed. The behavior sequence of the dialogue log is used to process the dialogue log to obtain the dialogue flow of the dialogue log.

[0027] As can be seen, in order to extract the dialogue flow from the dialogue log using the behavior sequence, it is also necessary to train the pre-built dialogue behavior classification model. In this case, by using the unsupervised training method based on dialogue rules, the human resources required for model training can be greatly reduced, and the various costs required for training can be reduced while ensuring the model training effect, so as to facilitate the accurate and fast extraction of the dialogue flow from the dialogue log.

[0028] Optionally, dialogue rules include: scenario-based rules, and / or, regular expression-based rules, and / or, negative example keyword-based rules.

[0029] Optionally, dialogue behaviors include intentional dialogue behaviors, questioning dialogue behaviors, and answering dialogue behaviors;

[0030] Among them, the intent dialogue behavior is used to represent a dialogue statement initiated by a customer with the intention of consulting; the question label is used to represent a dialogue statement initiated by customer service to ask a question in response to the customer's inquiry intention; and the answer label is used to represent a dialogue statement initiated by customer service to respond to the customer's inquiry intention.

[0031] Optionally, the dialogue behavior classification model includes a customer service dialogue behavior classification sub-model and a customer dialogue behavior classification sub-model.

[0032] Optionally, the method further includes:

[0033] Based on the verification results, the dialogue rules corresponding to each type of dialogue behavior are optimized, and an optimized set of positive and negative samples is determined based on the optimized dialogue rules. The optimized set of positive and negative samples is used to train the dialogue behavior classification model.

[0034] As can be seen, in this embodiment, the dialogue rules are optimized based on the verification results by validating the positive and negative sample sets, thereby realizing the positive and negative sample...

[0035] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0036] At least one processor; and

[0037] Memory;

[0038] The memory stores the instructions that the computer executes;

[0039] At least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the method as described in the first aspect or the second aspect.

[0040] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method as described in the first or second aspect.

[0041] Fifthly, embodiments of this application provide a computer program product including computer instructions that, when executed by a processor, implement the method as described in the first or second aspect.

[0042] This application provides a training method for a dialogue behavior classification model, a dialogue log processing method, and an apparatus. The dialogue log can be analyzed and processed using a pre-trained dialogue behavior classification model to classify the dialogue behavior. Then, the behavior sequence of the dialogue log is traversed and filtered based on the dialogue behavior of each dialogue statement. This allows for the rapid extraction of the dialogue flow from the dialogue log based on the effective behavior sequence after traversal and filtering. The extraction efficiency is high and the extraction effect is good. Attached Figure Description

[0043] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0044] Figure 1 This is a schematic diagram of a dialogue log processing method;

[0045] Figure 2 This is a schematic diagram of a network architecture on which this application is based;

[0046] Figure 3 A flowchart illustrating a dialogue log processing method provided in an embodiment of this application;

[0047] Figure 4 A schematic diagram illustrating a scenario for configuring intelligent customer service based on dialogue flow, provided in an embodiment of this application;

[0048] Figure 5 A flowchart illustrating a training method for a dialogue behavior classification model provided in an embodiment of this application;

[0049] Figure 6 A schematic diagram of a dialogue rule optimization process provided in an embodiment of this application;

[0050] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in this application.

[0051] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0052] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0053] The collection, storage, use, processing, transmission, provision, and disclosure of various types of information involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0054] With the development of computer technology, it has become possible to apply customer service robots in the customer service industry.

[0055] The following example, using a merchant's customer service robot hosted on an e-commerce platform, will be used to illustrate the solution upon which this application is based. Figure 1 This is a schematic diagram of a dialogue log processing method, such as... Figure 1 As shown, customers can establish a customer service communication channel with merchants through the customer service interface provided by the e-commerce platform, and enjoy the customer service services provided by the merchants through this communication channel. As mentioned earlier, in order to enable customer service robots to achieve intelligent customer service functions, merchants generally use dialogue flow to pre-train the customer service robots so that the customer service robots can learn and provide customer service like human customer service representatives.

[0056] Combination Figure 1 As shown, for merchants, in order to enable customer service robots to provide accurate customer service like human customer service representatives, it is necessary to utilize dialogue flow to train the robot. In a customer service scenario, dialogue flow refers to a meaningful and complete sequence of conversations, which generally includes the customer's intent statements describing their needs, the customer service representative's questions to further inquire about the customer, and the customer service representative's responses to the customer.

[0057] Typically, the conversation flow is created and mined by the merchant themselves. Currently, there is no solution in the field of intelligent customer service to help merchants retrieve and mine the conversation flow required by intelligent customer service robots. This means that when using customer service robot functions, merchants need to spend a lot of time and manpower to mine the conversation flow in the conversation logs, resulting in low configuration efficiency for customer service robots and making them very inconvenient to use.

[0058] Compared to Figure 1 The proposed solution provides a dialogue log processing method. This method utilizes a pre-trained dialogue behavior classification model to analyze and classify the dialogue logs into dialogue behaviors. Then, based on the dialogue behaviors of each dialogue statement, the behavior sequences in the dialogue logs are traversed and filtered. This allows for the rapid extraction of the dialogue flow from the logs based on the filtered effective behavior sequences, resulting in high extraction efficiency and good extraction quality. Based on this, businesses can directly use the dialogue flow extracted by this method to quickly configure the customer service functions of their intelligent chatbots, enabling the chatbots to provide customer service responses.

[0059] refer to Figure 2 , Figure 2 This is a schematic diagram of a network architecture on which this application is based. Figure 2 The network architecture shown may specifically include server 21, merchant terminal 22 and customer service terminal 23.

[0060] exist Figure 2 In the architecture shown, server 21 can specifically be a server cluster set up in the cloud. Server 21 is used to process the dialogue log to be processed according to the dialogue log processing method provided in this application to obtain the dialogue stream of the dialogue log.

[0061] Merchant terminal 22 and customer terminal 23 can be hardware devices with network communication and user interaction functions, including but not limited to smartphones, tablets, desktop computers, and IoT devices. Merchants can obtain the dialogue stream from the dialogue logs generated by server 21 through merchant terminal 22 and use this dialogue stream to configure the customer service robot hosted on server 21. Customers can establish a customer service communication channel with server 21 through their customer terminal 23 and engage in customer service Q&A with the configured merchant's customer service robot through this channel.

[0062] The training method, dialogue log processing method, and apparatus for the dialogue behavior classification model provided in this application are described in detail below through specific embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0063] It should be noted that the execution entity of the dialogue log processing method provided in this embodiment is the aforementioned Figure 2 The server mentioned, Figure 3 This is a flowchart illustrating a dialogue log processing method provided in an embodiment of this application. Figure 3 As shown, the dialogue log processing method may include the following steps:

[0064] Step 301: Determine the dialogue log to be processed. The dialogue log includes multiple dialogue statements generated by the customer service representative and the customer.

[0065] It should be noted that the dialogue logs to be processed can be offline data pre-stored on the server. These dialogue logs are used to record the dialogue statements generated during customer service conversations.

[0066] For example, the conversation log can be recorded as:

[0067] Customer: I bought product A from your store before, and I found it to be very useful.

[0068] Customer: Can you recommend another product for me today?

[0069] Customer service: What is your skin type?

[0070] Customer: My cheeks and T-zone are prone to oiliness.

[0071] Customer service: What kind of product do you need this time?

[0072] Customer: Anti-aging and blemish removal, I've recently developed some wrinkles on my face.

[0073] Customer service: Okay, dear, I recommend product B.

[0074] Customer: Can this product be used on sensitive skin?

[0075] Customer service: Sure.

[0076] Customer service: Is there anything else I can help you with?

[0077] Customer: No, thank you.

[0078] As in this example, the dialogue log will record the dialogue statements entered by the customer and the customer service representative during a customer service conversation, in the order of the dialogue.

[0079] In order to achieve better processing results for the dialogue logs, in an optional implementation, the dialogue logs to be processed in this implementation are obtained by filtering from the historical dialogue log set.

[0080] Specifically, the server can first obtain a set of historical dialogue logs, which includes multiple historical dialogue logs generated during customer service conversations. It is known that each historical dialogue log contains the dialogue statements entered by the customer and customer service representatives during a single customer service conversation, recorded in the order of the dialogue.

[0081] Subsequently, the server can select dialogue logs to be processed from these historical dialogue logs based on various preset conditions. Specifically, the server can perform scenario localization on each historical dialogue log to obtain the scenario intent of each historical dialogue; and / or determine the interaction rounds of each historical dialogue log; and / or determine whether each historical dialogue log includes dialogue statements from customer service representatives.

[0082] Scene localization is a method for identifying and understanding intent in historical dialogue logs to determine the dialogue scene within those logs. Of course, in the intelligent customer service scenario described in this embodiment, the scene intent obtained through scene localization may include, but is not limited to, recommendation intent, return intent, consultation intent, and other scene intents related to intelligent customer service.

[0083] Here, an interaction round refers to the number of times a customer and customer service engage in a single interactive dialogue. For example, in the scenario described above, "Customer: Can this product be used on sensitive skin? Customer Service: Yes, it can." The customer's question and the customer service representative's answer constitute one interaction round. By analyzing the customer's questions and the customer service representative's answers, the interaction round in each historical dialogue log can be determined.

[0084] Determining whether historical chat logs include customer service responses refers to judging whether customer service provided relevant responses in the historical chat logs. For example, in the previous example, "Customer Service: Okay, dear, I recommend product B." would be considered a customer response.

[0085] By judging and filtering each historical dialogue log, historical dialogue logs that meet preset conditions can be selected as dialogue logs to be processed. These preset conditions include: the scenario intent of the historical dialogue log is a consultation intent, and / or, the number of interaction rounds in the historical dialogue log is greater than a preset round threshold, and / or, the historical dialogue log includes dialogue statements from customer service representatives. It is evident that this processing method increases the probability that the dialogue logs to be processed contain valid information, and thus increases the likelihood of extracting dialogue flow from them.

[0086] Step 302: Process the dialogue log using a pre-trained dialogue behavior classification model to obtain a behavior sequence of the dialogue log, wherein the behavior sequence includes the dialogue behavior of each dialogue statement in the dialogue log.

[0087] Step 303: Iterate through and filter each dialogue behavior in the behavior sequence to obtain the effective behavior sequence.

[0088] Specifically, after acquiring the dialogue logs to be processed, the server will invoke a pre-trained dialogue behavior classification model to process each dialogue statement in the logs individually, outputting the corresponding dialogue behavior for each statement. Based on the order of the dialogue statements in the logs, the dialogue behaviors of each statement will constitute a corresponding behavior sequence.

[0089] The dialogue behavior classification model in the server can be an existing model or a model obtained by training a pre-built model. This implementation will not impose any restrictions on the training process of the model.

[0090] Dialogue behavior is the behavioral label attached to the sender's dialogue. For example, in the classic DAMSL system, dialogue behavior is classified into 42 subcategories and 5 major categories, such as asking questions, raising awareness, agreeing, responding, and interrupting.

[0091] Specifically, the inventors discovered through analysis of a large number of dialogue logs that when a dialogue segment includes dialogue statements with intentional dialogue behavior, dialogue statements with questioning behavior, and dialogue statements with answering behavior, the information in that dialogue segment is relatively complete, and the configuration effect obtained by using such information to train and configure the customer service robot is better.

[0092] Therefore, in this embodiment, the dialogue behavior type of a dialogue statement can specifically include intentional dialogue behavior, questioning dialogue behavior, and answering dialogue behavior. That is, after inputting the dialogue statement from the dialogue log into the model, the model will output the probability that the dialogue statement belongs to intentional dialogue behavior, questioning dialogue behavior, or answering dialogue behavior, and based on this probability, it can be determined which type of dialogue behavior the dialogue statement belongs to.

[0093] Specifically, the dialogue behavior classification model can adopt the BERT model, which is implemented based on the bidirectional encoder representation technology of the transformer and can be used for text encoding and classification.

[0094] Building upon this implementation, to further improve the accuracy of classifying dialogue behavior for each dialogue statement, in an optional implementation, the model in the server may specifically include a dialogue behavior classification model comprising a customer service dialogue behavior classification sub-model and a customer dialogue behavior classification sub-model. That is, when identifying dialogue behavior for each dialogue statement in the dialogue log, each dialogue statement can be input into a different dialogue behavior classification sub-model based on the different initiators of each dialogue statement, in order to perform more accurate identification and thus effectively improve the accuracy of dialogue behavior classification.

[0095] Specifically, the server can input the dialogue statements initiated by customer service representatives from the dialogue log into the customer service dialogue behavior classification sub-model, and output the customer service dialogue behavior, which includes question-and-answer dialogue behavior. The server can also input the dialogue statements initiated by customers from the dialogue log into the customer dialogue behavior classification sub-model, and output the customer dialogue behavior, which includes intent-based dialogue behavior. Finally, the server will obtain a behavior sequence based on the customer service dialogue behavior corresponding to the dialogue statements initiated by customer service representatives, and the customer dialogue behavior corresponding to the dialogue statements initiated by customers.

[0096] Of course, in some implementations, the dialogue statement may not belong to any of the three types of dialogue behavior mentioned above. In this case, the dialogue behavior can be marked as other dialogue behavior.

[0097] For example, suppose the dialogue log S to be processed can be represented as S = {Q1, ..., Q}. k In this context, each dialogue statement will be treated as an element Q in S, while k represents the number of dialogue statements in the dialogue log.

[0098] Modeling the dialogue log S in the aforementioned example yields the following behavior sequence L = {L1, ..., L...} k}=

[0099] {Other dialogue behaviors, intentional dialogue behaviors, questioning dialogue behaviors, other dialogue behaviors, questioning dialogue behaviors, other dialogue behaviors, answering dialogue behaviors, other dialogue behaviors, questioning dialogue behaviors, other dialogue behaviors}.

[0100] In determining the behavior sequence, the server extracts multiple consecutive dialogue behaviors from the behavior sequence according to the order of each type of dialogue behavior in the sequence to form a valid behavior sequence. Among the multiple dialogue behaviors constituting the valid behavior sequence, the first dialogue behavior is of the intent type, and the last dialogue behavior is of the response type. Dialogue behaviors between the first and last positions do not include dialogue behaviors of the intent or response type. For example, the valid behavior sequence obtained based on the above behavior sequence can be represented as {intent dialogue behavior, question dialogue behavior, other dialogue behaviors, question dialogue behavior, other dialogue behaviors, response dialogue behavior}.

[0101] Specifically, the process of extracting a valid behavior sequence can be represented as follows: Select any questioning dialogue behavior from the behavior sequence as the target questioning dialogue behavior; among the intentional dialogue behaviors in the behavior sequence, determine whether there exists an intentional dialogue behavior that precedes the target questioning dialogue behavior and is not connected to the target questioning dialogue behavior by any other intentional or answering dialogue behavior; if so, designate this intentional dialogue behavior as the target intentional dialogue behavior of the target questioning dialogue behavior; otherwise, select the next questioning dialogue behavior from the behavior sequence as the target questioning dialogue behavior; and among the answering dialogue behaviors in the behavior sequence, determine whether there exists an answering dialogue behavior that follows the target questioning dialogue behavior and is not connected to the target questioning dialogue behavior by any other intentional or answering dialogue behavior; if so, designate this answering dialogue behavior as the target answering dialogue behavior of the target questioning dialogue behavior; otherwise, select the next questioning dialogue behavior from the behavior sequence as the target questioning dialogue behavior; extracting the target intentional dialogue behavior, the target answering dialogue behavior, and all dialogue behaviors between the target intentional dialogue behavior and the target answering dialogue behavior constitutes a valid behavior sequence.

[0102] Furthermore, taking the behavioral sequence L = {L1, ..., L...} from the previous example... k Taking {{Other Dialogue Behaviors, Intent Dialogue Behaviors, Questioning Dialogue Behaviors, Other Dialogue Behaviors, Questioning Dialogue Behaviors, Other Dialogue Behaviors, Response Dialogue Behaviors, Other Dialogue Behaviors, Questioning Dialogue Behaviors, Other Dialogue Behaviors} as an example, to facilitate the extraction of effective behavior sequences, we can first classify the dialogue behaviors in the behavior sequence and aggregate the sequence numbers of each type of dialogue behavior in the behavior sequence to obtain the sequence corresponding to each dialogue behavior, that is, to obtain the sequence P corresponding to the intent dialogue behavior. A The sequence P corresponding to the question-and-answer dialogue behavior B The sequence P corresponding to the dialogue response behavior C ; where sequence P A ={2}, sequence P B ={3, 5, 10}, sequence P C ={7}.

[0103] Subsequently, the sequence P corresponding to the question-and-answer dialogue behavior is used. B Centered on each question dialogue behavior, determine the intention dialogue behavior that is closest in ranking to the question dialogue behavior before it, and the answer dialogue behavior that is closest in ranking to the question dialogue behavior after it.

[0104] For example, for sequence P B {3} in the sequence P A {2} and sequence P CAll of {7} in the sequence satisfy the condition. At this point, it is also necessary to determine the sequence P. B {3} in the sequence P A Whether there are other intentional or response dialogue behaviors between {2} in the sequence, and at the same time, it is also necessary to determine whether sequence P B {3} in the sequence P A Does {7} include other intentional or responsive dialogue behaviors? Because P B {3} in the sequence P A There are no other intentional or response dialogue behaviors between {2} in the sequence P. B {3} in the sequence P A There are no other intentional or response dialogue behaviors between {7} in sequence P; therefore, sequence P... A {2} to P C The dialogue behavior of {7} constitutes a valid behavior sequence, that is, the valid behavior sequence M = {L2, ..., L7}.

[0105] Step 304: Extract segments from the dialogue log based on the valid behavior sequence to obtain the dialogue flow of the dialogue log.

[0106] Specifically, once the valid behavior sequence of the dialogue log is determined, fragments of the dialogue log to be processed can be extracted based on the dialogue behaviors in the valid behavior sequence.

[0107] In an optional implementation, the extraction process can be represented as follows: among the multiple dialogue behaviors that constitute a valid behavior sequence, the dialogue statement corresponding to the dialogue behavior at the beginning of the valid behavior sequence is taken as the first sentence of the dialogue flow; the dialogue statement corresponding to the dialogue behavior at the end of the valid behavior sequence is taken as the last sentence of the dialogue flow; the first sentence, the last sentence, and the dialogue statements in the dialogue log located between the first sentence and the last sentence constitute the dialogue flow.

[0108] For example, when the effective behavior sequence M = {L2, ..., L7}, the dialogue statement corresponding to L2 can be determined as "Customer: Can you recommend another product to me today?" and this dialogue statement is taken as the first sentence of the dialogue flow; the dialogue statement corresponding to L7 can be determined as "Customer Service: Okay, dear, I recommend product B to you" and this dialogue statement is taken as the last sentence of the dialogue flow. The final dialogue flow can be represented as: "Customer: Can you recommend another product to me today? Customer Service: What is your skin type? Customer: My cheeks and T-zone are prone to oiliness. Customer Service: What kind of product do you need this time? Customer: Anti-aging and spot removal, I've had some wrinkles on my face recently. Customer Service: Okay, dear, I recommend product B to you."

[0109] Figure 4This is a schematic diagram of a scenario for configuring intelligent customer service based on dialogue flow, provided in an embodiment of this application. Figure 4 As shown, merchants can select the dialogue streams for the products they wish to configure on the current interface. These selectable dialogue streams are obtained through the aforementioned dialogue log processing method. Once a dialogue stream is selected, it will be loaded onto the configuration page and output to the intelligent customer service robot for its learning and training. Alternatively, in a possible implementation, this dialogue stream could be further broken down into a mind map, allowing the intelligent customer service robot to use the mind map to execute corresponding customer service responses.

[0110] This application provides a dialogue log processing method, in which a pre-trained dialogue behavior classification model is first used to analyze and process the dialogue log to classify the dialogue behavior of the dialogue log, and then the behavior sequence of the dialogue log is traversed and filtered based on the dialogue behavior of each dialogue statement, so that the dialogue flow in the dialogue log can be quickly extracted based on the effective behavior sequence after traversal and filtering. The extraction efficiency of the dialogue flow is high and the extraction effect is good.

[0111] Based on the above embodiments, this application also provides a training method for a dialogue behavior classification model. In this embodiment, the execution entity of the training method for the dialogue behavior classification model is the aforementioned server. Figure 5 This is a flowchart illustrating a training method for a dialogue behavior classification model provided in an embodiment of this application. Figure 5 As shown, the training method for this dialogue behavior classification model can include the following steps:

[0112] Step 501: Determine the dialogue log set. The dialogue log set includes multiple dialogue logs generated by customer service representatives during dialogues with customers. Each dialogue log includes multiple dialogue statements.

[0113] Specifically, similar to the aforementioned embodiments, each dialogue log in the dialogue log set can be obtained by filtering from the historical dialogue log set. That is, by performing scenario localization on each historical dialogue log, the scenario intent of each historical dialogue is obtained; and / or, the interaction rounds of each historical dialogue log are determined; and / or, it is determined whether each historical dialogue log includes dialogue statements in which customer service responded; then, historical dialogue logs that meet preset conditions are selected from each historical dialogue log to form the dialogue log set; wherein, the preset conditions include: the scenario intent of the historical dialogue log is a consultation intent, and / or, the interaction rounds of the historical dialogue log are greater than a preset round threshold, and / or, the historical dialogue log includes dialogue statements in which customer service responded.

[0114] Step 502: Based on the dialogue statements in each dialogue log, determine the dialogue rules corresponding to each type of dialogue behavior.

[0115] Specifically, the dialogue rules include: scenario-based rules, and / or regular expression-based rules, and / or negative example keyword-based rules.

[0116] Among them, scenario-based rules can represent the type of intent scenario in which such dialogue behavior occurs. For example, scenario-based rules corresponding to intent dialogue behavior may include consultation scenarios.

[0117] Among them, regular expression class rules can represent the regular expressions used to characterize keyword-type or key sentence patterns in this type of dialogue behavior. For example, the regular expression class rules for question dialogue behavior may include "Is your......?";

[0118] Among them, negative example keyword rules can represent keywords or key phrases that will not be used in this type of dialogue behavior. For example, negative example keyword rules corresponding to the question dialogue behavior include: "Do you have any other questions?"

[0119] In an optional implementation, the dialogue behavior includes intent dialogue behavior, question dialogue behavior, and answer dialogue behavior; wherein, intent dialogue behavior is used to characterize a dialogue statement initiated by a customer with the intention of consulting; question tag is used to characterize a dialogue statement initiated by customer service to ask a question in response to the customer's consulting intention; and answer tag is used to characterize a dialogue statement initiated by customer service to respond to the customer's consulting intention.

[0120] Of course, it is known that the dialogue rules mentioned above can be obtained by extracting dialogue logs from the dialogue log set using existing algorithms, or by manually annotating and extracting dialogue logs from the dialogue log set.

[0121] Step 503: Based on each dialogue rule, perform sample extraction processing on each dialogue statement in each dialogue log to obtain the positive and negative sample sets corresponding to each type of dialogue behavior.

[0122] Specifically, based on dialogue rules for different types of dialogue behaviors, the dialogue statements in each dialogue log can be processed using each dialogue rule. Dialogue statements that satisfy each type of dialogue rule are designated as the positive sample set for that type of dialogue behavior, while dialogue statements that do not satisfy each type of dialogue rule are designated as the negative sample set for that type of dialogue behavior. Through this processing, the positive and negative sample sets corresponding to each type of dialogue behavior can be obtained.

[0123] Step 504: Train the pre-built dialogue behavior classification model using each set of positive and negative samples to obtain the trained dialogue behavior classification model. The trained dialogue behavior classification model is used to perform behavior classification and recognition processing on the dialogue log to be processed to obtain the behavior sequence of the dialogue log to be processed. The behavior sequence includes the dialogue behavior of each dialogue statement in the dialogue log to be processed. The behavior sequence of the dialogue log is used to process the dialogue log to obtain the dialogue flow of the dialogue log.

[0124] Specifically, a pre-built dialogue behavior classification model can be trained using the positive and negative sample sets corresponding to each type of dialogue behavior to obtain a dialogue behavior classification model that can be used to identify dialogue behaviors of each dialogue statement, as described in the aforementioned embodiments. The pre-built dialogue behavior classification model can specifically employ the BERT model, which is implemented using a bidirectional encoder representation technique based on a transformer and can be used for text encoding and classification.

[0125] In an optional implementation, the dialogue behavior classification model specifically includes a customer service dialogue behavior classification sub-model and a customer dialogue behavior classification sub-model. Specifically, the positive and negative sample sets corresponding to the aforementioned intent dialogue behaviors can be used to train the customer dialogue behavior classification sub-model, enabling it to identify whether dialogue text belongs to intent dialogue behaviors. Similarly, the positive and negative sample sets corresponding to the aforementioned question dialogue behaviors and answer dialogue behaviors can be used to train the customer service dialogue behavior classification sub-model, enabling it to identify whether dialogue text belongs to question dialogue behaviors and answer dialogue behaviors.

[0126] Based on the above implementation methods, in order to improve the training effect of the model, the training method further includes: verifying the positive and negative sample sets corresponding to each type of dialogue behavior; optimizing the dialogue rules corresponding to each type of dialogue behavior according to the verification results, and determining the optimized positive and negative sample sets according to the optimized dialogue rules. The optimized positive and negative sample sets are used to train the dialogue behavior classification model.

[0127] Figure 6 This is a schematic diagram illustrating a dialogue rule optimization process provided in an embodiment of this application. Figure 6 Specifically, as shown, an initial dialogue rule can first be established, which can be constructed based on past experience. Then, this initial dialogue rule is used to process each dialogue log in the dialogue log set to determine the positive and negative sample sets.

[0128] Subsequently, after completing a round of processing to determine the set of positive and negative samples using the current dialogue rules, the correctness or accuracy of the current set of positive and negative samples can be verified through manual verification or algorithm verification, and the current dialogue rules can be optimized based on the verification results.

[0129] Next, the optimized current dialogue rules can be used to process each dialogue log again to obtain a new optimized set of positive and negative samples. Optionally, the optimized set of positive and negative samples can be validated again, and the above process can be repeated to iteratively optimize the current dialogue rules.

[0130] Finally, the dialogue logs are processed using the optimized dialogue rules to obtain a set of positive and negative samples, which can be used to train the aforementioned model.

[0131] Of course, it should be noted that the specific processing flow of the dialogue log processing using the model in this embodiment can be found in the aforementioned embodiments, and this embodiment will not repeat the details of that part.

[0132] This application provides a training method for a dialogue behavior classification model. In order to extract the dialogue flow from the dialogue log using the behavior sequence, it is also necessary to train the pre-built dialogue behavior classification model. By using an unsupervised training method based on dialogue rules, the human resources required for model training can be greatly reduced. While ensuring the model training effect, the various costs required for training are reduced, which facilitates the accurate and rapid extraction of the dialogue flow from the dialogue log.

[0133] Figure 7 A hardware structure diagram of an electronic device provided in this application is shown below. Figure 7 As shown, this application embodiment provides an electronic device. The memory of the electronic device can be used to store at least one program instruction, and the processor is used to execute at least one program instruction to implement the technical solution of the above method embodiment. Its implementation principle and technical effects are similar to those of the above-described method-related embodiments, and will not be repeated here.

[0134] This application provides a chip. The chip includes a processor, which is used to call a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.

[0135] This application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the technical solutions described in the above embodiments. Its implementation principle and technical effects are similar to the related embodiments described above, and will not be repeated here.

[0136] This application provides a computer-readable storage medium storing program instructions. When executed by an electronic device, the program instructions cause the electronic device to perform the technical solution described in the above embodiments. Its implementation principle and technical effects are similar to the related embodiments described above, and will not be repeated here.

[0137] The above specific embodiments further illustrate the purpose, technical solution and beneficial effects of this application. It should be understood that the above are only specific embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of this application should be included within the scope of protection of this application.

Claims

1. A method for processing dialogue logs, characterized in that, include: Identify the dialogue logs to be processed, which include multiple dialogue statements generated during customer service conversations between customer service representatives and customers. The dialogue log is processed using a pre-trained dialogue behavior classification model to obtain a behavior sequence of the dialogue log, wherein the behavior sequence includes the dialogue behavior of each dialogue statement in the dialogue log. The effective behavior sequence is obtained by traversing and filtering each dialogue behavior in the behavior sequence. Based on the effective behavior sequence, the dialogue log is segmented to obtain the dialogue flow of the dialogue log; The dialogue behaviors include intentional dialogue behaviors, questioning dialogue behaviors, and answering dialogue behaviors; The process of traversing and filtering each dialogue behavior in the behavior sequence to obtain a valid behavior sequence includes: Based on the order of each type of dialogue behavior in the behavior sequence, multiple consecutive dialogue behaviors are extracted from the behavior sequence to form the effective behavior sequence; Among the multiple dialogue behaviors constituting the effective behavior sequence, the dialogue behavior at the beginning is of the type of intention dialogue behavior, the dialogue behavior at the end is of the type of response dialogue behavior, and the dialogue behaviors between the beginning and the end do not include dialogue behaviors of the type of intention dialogue behavior or response dialogue behavior.

2. The processing method according to claim 1, characterized in that, The step of extracting multiple consecutive dialogue behaviors from the behavior sequence to form the effective behavior sequence according to the order of each type of dialogue behavior in the behavior sequence includes: Select any one of the questioning dialogue behaviors from the sequence of behaviors as the target questioning dialogue behavior; In each intentional dialogue behavior in the behavior sequence, it is determined whether there is an intentional dialogue behavior that is arranged before the target question dialogue behavior and there are no other intentional dialogue behaviors or answer dialogue behaviors between it and the target question dialogue behavior; if there is, the intentional dialogue behavior is taken as the target intentional dialogue behavior of the target question dialogue behavior; otherwise, the next question dialogue behavior is selected from the behavior sequence as the target question dialogue behavior. In each response dialogue behavior in the behavior sequence, it is determined whether there is a response dialogue behavior that is arranged after the target question dialogue behavior and there are no other intentional dialogue behavior or response dialogue behavior between it and the target question dialogue behavior; if there is, the response dialogue behavior is taken as the target response dialogue behavior of the target question dialogue behavior; otherwise, the next question dialogue behavior is selected from the behavior sequence as the target question dialogue behavior. The target intent dialogue behavior, the target response dialogue behavior, and the dialogue behaviors between the target intent dialogue behavior and the target response dialogue behavior are extracted to form the effective behavior sequence.

3. The processing method according to claim 1, characterized in that, The dialogue behavior classification model includes a customer service dialogue behavior classification sub-model and a customer dialogue behavior classification sub-model. The process of processing the dialogue log using a pre-trained dialogue behavior classification model to obtain the behavior sequence of the dialogue log includes: The dialogue statements initiated by the customer service representative in the dialogue log are input into the customer service dialogue behavior classification sub-model, and the customer service representative's dialogue behavior is output. The customer service representative's dialogue behavior includes question dialogue behavior and answer dialogue behavior. The dialogue statements initiated by the customer in the dialogue log are input into the customer dialogue behavior classification sub-model, and the customer's dialogue behavior is output, wherein the customer's dialogue behavior includes intentional dialogue behavior. The behavior sequence is obtained based on the dialogue behavior of the customer service representative corresponding to the dialogue statement initiated by the customer and the dialogue behavior of the customer corresponding to the dialogue statement initiated by the customer.

4. The processing method according to any one of claims 1-3, characterized in that, The step of extracting segments from the dialogue log based on the effective behavior sequence to obtain the dialogue stream of the dialogue log includes: In the multiple dialogue behaviors that constitute the effective behavior sequence, the dialogue statement corresponding to the dialogue behavior that is at the beginning of the effective behavior sequence is taken as the first sentence of the dialogue flow. The dialogue statement corresponding to the dialogue action at the end of the effective action sequence is taken as the last sentence of the dialogue flow. The first sentence, the last sentence, and the dialogue statements in the dialogue log located between the first sentence and the last sentence constitute the dialogue flow.

5. The processing method according to any one of claims 1-3, characterized in that, The process of determining the dialogue logs to be processed includes: Obtain a set of historical dialogue logs, which includes multiple historical dialogue logs generated by customer service representatives during dialogues with customers. Analyze the scenarios of each historical dialogue log to obtain the scenario intent of each historical dialogue; and / or determine the interaction rounds of each historical dialogue log; and / or determine whether each historical dialogue log includes dialogue statements from customer service representatives. Select historical dialogue logs that meet preset conditions from each historical dialogue log as the dialogue logs to be processed; wherein, the preset conditions include: the scenario intent of the historical dialogue log is a consultation intent, and / or, the number of interaction rounds of the historical dialogue log is greater than a preset round threshold, and / or, the historical dialogue log includes dialogue statements in which customer service responded.

6. The processing method according to any one of claims 1-3, characterized in that, The training steps for the dialogue behavior classification model are as follows: Determine a set of dialogue logs, which includes multiple dialogue logs generated by customer service representatives during dialogues with customers, and each dialogue log includes multiple dialogue statements. Based on the dialogue statements in each dialogue log, determine the dialogue rules corresponding to each type of dialogue behavior; Based on each dialogue rule, sample extraction processing is performed on each dialogue statement in each dialogue log to obtain a set of positive and negative samples corresponding to each type of dialogue behavior; A pre-constructed dialogue behavior classification model is trained using various positive and negative sample sets to obtain a trained dialogue behavior classification model. The trained dialogue behavior classification model is used to perform behavior classification and recognition processing on the dialogue log to be processed to obtain the behavior sequence of the dialogue log to be processed. The behavior sequence includes the dialogue behavior of each dialogue statement in the dialogue log to be processed. The behavior sequence of the dialogue log is used to process the dialogue log to obtain the dialogue flow of the dialogue log.

7. The processing method according to claim 6, characterized in that, The dialogue rules include: scenario-based rules, and / or, regular expression-based rules, and / or, negative example keyword-based rules.

8. The processing method according to claim 6, characterized in that, The dialogue behaviors include intentional dialogue behaviors, questioning dialogue behaviors, and answering dialogue behaviors; The intent dialogue behavior is used to characterize a dialogue statement initiated by a customer with the intent to consult; the question tag is used to characterize a dialogue statement initiated by customer service to ask a question in response to the customer's intent to consult; and the answer tag is used to characterize a dialogue statement initiated by customer service to respond to the customer's intent to consult.

9. The processing method according to claim 6, characterized in that, The dialogue behavior classification model includes a customer service dialogue behavior classification sub-model and a customer dialogue behavior classification sub-model.

10. The processing method according to any one of claims 7-9, characterized in that, Also includes: The positive and negative sample sets corresponding to each type of dialogue behavior are verified; Based on the verification results, the dialogue rules corresponding to each type of dialogue behavior are optimized, and an optimized set of positive and negative samples is determined based on the optimized dialogue rules. The optimized set of positive and negative samples is used to train the dialogue behavior classification model.

11. An electronic device, wherein, include: At least one processor; as well as Memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1-10.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-10.

13. A computer program product comprising computer instructions, characterized in that, When executed by a processor, the computer instructions implement the method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Method and system for designing introspection dialogue streams

    CN113282730A

  • Dialogue model establishing method and device

    CN113836275A