Training methods, intent understanding methods and devices for semantic segmentation models
By splicing and semantically segmenting multiple customer service voice messages, the problem of semantic understanding errors in existing customer service chatbots has been solved, resulting in more accurate customer service responses and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2026-03-06
AI Technical Summary
Existing customer service chatbots are prone to semantic misunderstandings when faced with multiple dialogues from users, resulting in irrelevant answers and negatively impacting user experience.
By splicing together the target customer service text from multiple customer service voice recordings, the trained semantic segmentation model is used to identify semantic segmentation points and perform text segmentation to generate semantic text segments for subsequent semantic recognition and response processing.
This improved the accuracy of customer service responses and the user experience, ensuring that customer service responses better match the user's intent.
Smart Images

Figure CN115018516B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a training method, intent understanding method and apparatus for a semantic segmentation model. Background Technology
[0002] With the development of computer technology, it has become possible to apply customer service chatbots in the customer service industry.
[0003] In existing technologies, customer service chatbots need to acquire the content of the conversation initiated by the user, and perform intent understanding and other processing on the content to determine the meaning of the conversation expressed by the user, and then respond and provide feedback based on the meaning of the conversation.
[0004] However, in customer service scenarios, users often use multiple dialogue segments to describe the same business problem. This can easily lead to semantic misunderstandings when customer service chatbots try to understand the dialogue content initiated by users, resulting in chatbots giving irrelevant answers and affecting user experience. Summary of the Invention
[0005] This application provides a method for training a semantic segmentation model, an intent understanding method, and an apparatus, which can provide users with better customer service responses and improve user experience.
[0006] In a first aspect, embodiments of this application provide an intent understanding method, including:
[0007] The system acquires at least one customer service voice message initiated by the user and determines the target customer service text corresponding to each voice message. It then concatenates these target customer service texts to obtain the target long text and uses a trained semantic segmentation model to identify the semantic segmentation points of the target long text. The trained semantic segmentation model is obtained by deep learning training on a long text sample dataset, which includes multiple long text samples and a label sequence of semantic segmentation points corresponding to each long text sample. The system then segments the target long text according to the semantic segmentation points to obtain semantic text segments. Finally, it performs semantic recognition on the semantic text segments to obtain the user's semantic recognition result.
[0008] As can be seen, unlike existing technologies, this application adds steps to concatenate multiple customer service voice messages into target customer service text and then performs text segmentation based on semantic segmentation points on the resulting long target text. This process replaces the individual customer service texts in existing technologies with the processed semantic text segments, enabling subsequent semantic recognition and response processing to obtain a customer service reply. The customer service reply obtained in this way is more closely matched to the user's intent, resulting in better response effectiveness and a superior user experience.
[0009] Optionally, the step of using the trained semantic segmentation model to identify the target long text and obtain the semantic segmentation points of the target long text includes: inputting the target long text into the trained semantic segmentation model to obtain a prediction sequence of the target long text output by the trained semantic segmentation model, wherein the prediction sequence includes the prediction value corresponding to each text field in the target long text; and determining the semantic segmentation points in the target long text based on the prediction values corresponding to each text field.
[0010] Optionally, determining the semantic segmentation point in the target long text based on the predicted value corresponding to each text field includes: for any predicted value in the prediction sequence, if the predicted value is greater than a preset predicted value threshold, then there is a semantic segmentation point between the text field corresponding to the predicted value and the next text field adjacent to the text field.
[0011] It is known that by utilizing a pre-trained semantic segmentation model, semantic segmentation points in target long texts can be effectively identified, thereby improving the accuracy of customer service responses.
[0012] Optionally, the method further includes: continuously collecting customer service voice messages initiated by users, and when it is determined that the sum of the text lengths of the target customer service texts corresponding to the continuously collected customer service voice messages is greater than a preset text length threshold, performing splicing processing on each target customer service text.
[0013] It is known that when this solution is applied to online customer service scenarios, due to the limitations of the customer service server's processing resources and processing efficiency, the customer service server will only trigger the intent understanding processing of the customer service voice once under the premise of meeting preset conditions. In this way, the processing resources of the customer service server can be effectively utilized to improve the overall processing efficiency of online processing.
[0014] Secondly, embodiments of this application provide a method for training a semantic segmentation model, comprising: generating a long text sample dataset based on acquired historical customer service dialogue logs; wherein the long text sample dataset includes multiple long text samples and a label sequence of semantic segmentation points corresponding to each long text sample; using the long text sample dataset to perform deep learning training on the semantic segmentation model to be trained, thereby obtaining a trained semantic segmentation model; wherein the trained semantic segmentation model is used to identify semantic segmentation points in a target long text.
[0015] It is understood that the training method of the semantic segmentation model provided in this embodiment can generate multiple long text samples and a label sequence for representing the semantic segmentation points of each long text sample based on historical customer service dialogue logs. The long text samples conform to the language habits of users when conducting interpersonal dialogues. In addition, this application embodiment will also construct a long text sample dataset based on the long text samples and the label sequence, and perform deep learning training on the semantic segmentation model to be trained to obtain the trained semantic segmentation model.
[0016] Optionally, the historical customer service dialogue log includes at least one customer service dialogue text segment generated during a customer service response process, and each customer service dialogue text segment includes at least one round of customer service dialogue text.
[0017] The step of generating a long text sample dataset based on the acquired historical customer service dialogue logs includes: determining the text length and number of dialogue turns for each customer service dialogue text segment, and calculating the ratio between the text length and the number of dialogue turns for each customer service dialogue text segment; selecting multiple customer service dialogue text segment samples from each customer service dialogue text segment based on the ratio of each customer service dialogue text segment; and generating long text samples in the long text sample dataset based on the customer service dialogue text segment samples.
[0018] Optionally, generating long text samples from the long text sample dataset based on the customer service dialogue text segment samples includes:
[0019] The customer service texts in each customer service dialogue text segment sample are concatenated to obtain multiple long text samples in the long text sample dataset; the label value of the semantic segmentation point of each text field in each long text sample is determined to obtain the label sequence of the semantic segmentation point corresponding to each long text sample in the long text sample dataset.
[0020] It is known that by fully considering the number of customer service dialogue rounds and the text length of the customer service dialogue text segment, samples of customer service dialogue text segments that can reflect the aforementioned situation can be selected from each customer service dialogue text segment in the historical customer service dialogue log. This allows for targeted model training, thereby improving the data quality of the long text sample dataset and ensuring the training effect of the model.
[0021] Optionally, the step of using the long text sample dataset to train the semantic segmentation model to be trained using deep learning to obtain the trained semantic segmentation model includes: sequentially inputting each long text sample in the long text sample dataset into the current semantic segmentation model to be trained to obtain the predicted sequence of semantic segmentation points corresponding to each long text sample input to the semantic segmentation model to be trained; determining the model loss of the current semantic segmentation model to be trained based on the predicted sequence and the label sequence of each long text sample; updating the current semantic segmentation model to be trained based on the model loss, and training the updated semantic segmentation model to be trained using the long text sample dataset until the obtained model loss converges; and using the current semantic segmentation model to be trained when the model loss converges as the trained semantic segmentation model.
[0022] Optionally, the prediction sequence of the long text sample includes the predicted value of the semantic segmentation point corresponding to each text field in the long text sample; the label sequence of the long text sample includes the label value of the semantic segmentation point corresponding to each text field in the long text sample.
[0023] The step of determining the model loss of the current semantic segmentation model to be trained based on the predicted sequence and the label sequence of each long text sample includes: determining the cross-entropy between the predicted value and the corresponding label value of each text field in each long text sample, and determining the model loss of the current semantic segmentation model to be trained based on the cross-entropy corresponding to each long text sample.
[0024] It is known that in order to ensure the training effect of the semantic segmentation model, the model needs to be trained multiple times during the training process. Based on the convergence of the model's loss after each training, it is determined whether the model has completed training. When the model loss converges, the trained model is obtained.
[0025] Thirdly, embodiments of this application provide an intent understanding apparatus, including:
[0026] The acquisition module is used to acquire at least one customer service voice message initiated by the user;
[0027] The processing module is used to determine the target customer service text corresponding to each customer service voice message; concatenate the target customer service texts to obtain the target long text, and use a trained semantic segmentation model to identify the target long text to obtain the semantic segmentation points of the target long text; wherein, the trained semantic segmentation model is obtained by deep learning training on the semantic segmentation model to be trained using a long text sample dataset, the long text sample dataset including multiple long text samples and a label sequence of semantic segmentation points corresponding to each long text sample; and perform text segmentation processing on the target long text according to the semantic segmentation points to obtain semantic text segments;
[0028] The recognition module is used to perform semantic recognition on the semantic text segment and obtain the semantic recognition result for the user.
[0029] Fourthly, embodiments of this application provide a training apparatus for a semantic segmentation model, comprising:
[0030] The dataset generation module is used to generate a long text sample dataset based on the acquired historical customer service dialogue logs; wherein, the long text sample dataset includes multiple long text samples and a label sequence of semantic segmentation points corresponding to each long text sample;
[0031] The training module is used to perform deep learning training on the semantic segmentation model to be trained using the long text sample dataset to obtain the trained semantic segmentation model; wherein, the trained semantic segmentation model is used to identify semantic segmentation points in the target long text.
[0032] Fifthly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0033] At least one processor; and
[0034] Memory;
[0035] The memory stores the instructions that the computer executes;
[0036] 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.
[0037] This application provides a training method, intent understanding method, and apparatus for a semantic segmentation model. Unlike existing technologies, this application adds steps to concatenate multiple customer service voice messages into target customer service text and then performs text segmentation based on semantic segmentation points on the resulting target long text. The processed semantic text segments replace the individual customer service texts in existing technologies, enabling subsequent semantic recognition and response processing to obtain a customer service reply. The customer service reply obtained in this way better matches the user's intent, resulting in a better response effect and a superior user experience. Attached Figure Description
[0038] 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.
[0039] Figure 1 This is a schematic diagram of an intent understanding method in the prior art;
[0040] Figure 2 This is a schematic diagram of a network architecture on which this application is based;
[0041] Figure 3 This is a schematic diagram of another network architecture on which this application is based;
[0042] Figure 4 A flowchart illustrating an intent understanding method provided in an embodiment of this application;
[0043] Figure 5 A flowchart illustrating a training method for a semantic segmentation model provided in an embodiment of this application;
[0044] Figure 6 A schematic diagram illustrating the training process of a semantic segmentation model provided in an embodiment of this application;
[0045] Figure 7 A structural block diagram of the intent understanding device provided in the embodiments of this application;
[0046] Figure 8 A structural block diagram of the training device for the semantic segmentation model provided in the embodiments of this application;
[0047] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in this application.
[0048] 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
[0049] 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.
[0050] The collection, storage, use, processing, transmission, provision, and disclosure of user 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.
[0051] With the development of computer technology, it has become possible to apply customer service chatbots in the customer service industry.
[0052] In existing technologies, customer service chatbots need to acquire the content of the conversation initiated by the user, and perform intent understanding and other processing on the content to determine the meaning of the conversation expressed by the user, and then respond and provide feedback based on the meaning of the conversation.
[0053] Taking a customer service chatbot running on an e-commerce platform as an example, this application is based on the existing technology. Figure 1 This is a schematic diagram of an intent understanding method in the prior art. Users can establish a customer service communication channel with the e-commerce platform through the customer service interface provided by the e-commerce platform, and leave customer service voice messages on the e-commerce platform. The e-commerce platform's customer service chatbot will obtain the customer service voice messages and perform speech recognition, semantic recognition, and response processing in sequence, so as to feed back the generated customer service reply voice to the user through the customer service interface.
[0054] However, in this scenario, users often use multiple customer service voice messages to describe the same business issue. When processing multiple customer service voice messages, the customer service chatbot typically needs to perform speech recognition on each segment of the voice message and then perform semantic recognition and response processing on the corresponding customer service text for each segment. For example, the following dialogue might exist in an existing scenario:
[0055] Customer service chatbot: Hello, this is Customer Service 003. What problem are you experiencing?
[0056] User: I would like to ask if product A is still in stock?
[0057] User: I heard that product A is a cheaper alternative to product B, and I really want to buy it.
[0058] User: I asked several stores and they were all out of stock.
[0059] Customer service chatbot: This product is out of stock. We suggest you check back later.
[0060] Customer service chatbot: Are you looking for the link to product B? We will send you the link to product B.
[0061] Customer service chatbot: Is there anything else I can do for you?
[0062] User: I don't want product B.
[0063] User: Is product C in stock?
[0064] Customer service chatbot: Do you need any other products?
[0065] Customer service chatbot: Product C is in stock, you can place an order to purchase it.
[0066] User: Okay, thank you.
[0067] Clearly, in the aforementioned customer service dialogue scenario, the user initiated multiple customer service voice messages regarding "product A," all revolving around the semantics of "inquiring whether product A is in stock." However, existing customer service chatbots process each of these voice messages separately, generating multiple customer service responses. Some of these responses are obviously mismatched with the user's desired answer, resulting in a poor user experience.
[0068] In other words, existing customer service chatbots perform semantic recognition and response processing on each customer service voice message initiated by the user. This processing effect is poor and can easily lead to the chatbot giving irrelevant answers, thus affecting the user experience.
[0069] In response to the above problems, relative to Figure 1 The customer service chatbot described in this application performs semantic recognition and response processing based on multiple customer service voice messages initiated by the user. Unlike existing technologies, this application adds steps to concatenate the target customer service text from the multiple voice messages and then performs text segmentation based on semantic segmentation points on the resulting long target text. The processed semantic text segments replace the individual customer service texts in existing technologies, allowing for subsequent semantic recognition and response processing to obtain a customer service reply. The customer service reply obtained in this way is more closely matched to the user's intent, resulting in better response effectiveness and a superior user experience.
[0070] refer to Figure 2 , Figure 2 This is a schematic diagram of a network architecture on which this application is based. Figure 2The network architecture shown may specifically include a model training server 21, a customer service server 22, and a terminal 23.
[0071] exist Figure 2 In the architecture shown, the model training server 21 and the customer service server 22 can be specifically set up as a server cluster in the cloud. The model training server 21 can be used to train the semantic segmentation model according to the training method of the semantic segmentation model. The trained semantic segmentation model will be deployed in the customer service server 22, and the customer service server 22 will call the deployed semantic segmentation model according to the intent understanding method to process the customer service voice messages sent by the user of the terminal 23.
[0072] Terminal 23 can be a hardware device with network communication and user interaction functions, including but not limited to smartphones, tablets, desktop computers, and IoT devices. Users can establish a communication channel with customer service server 22 through terminal 23 and send customer service voice messages to customer service server 22 in real time through this communication channel, so that customer service server 22 can process the customer service voice messages online.
[0073] refer to Figure 3 , Figure 3 This is a schematic diagram of another network architecture on which this application is based. Figure 3 The network architecture shown may specifically include a model training server 31 and a terminal 32.
[0074] exist Figure 3 In the architecture shown, the model training server 31 can specifically be a server cluster located in the cloud. This model training server 31 can be used to train the semantic segmentation model according to the training method of the semantic segmentation model. The trained semantic segmentation model will then be deployed locally on the terminal 32.
[0075] Terminal 32 can be a hardware device with network communication and user interaction functions, including but not limited to smartphones, tablets, desktop computers, and IoT devices. Terminal 32 can collect customer service voice messages input by users and call a locally deployed model to recognize and process the customer service voice messages according to the intent understanding method mentioned in this application.
[0076] The training method, intent understanding method, and apparatus for the semantic segmentation model provided in this application are described in detail below through specific embodiments. The embodiments below can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0077] It should be noted that the execution entity of the intent understanding method provided in this embodiment is the aforementioned Figure 2 The mentioned customer service server, or, for Figure 3 The terminal mentioned, Figure 4 This is a flowchart illustrating an intent understanding method provided in an embodiment of this application. Figure 4 As shown, this intent understanding method may include the following steps:
[0078] Step 401: Obtain at least one customer service voice message initiated by the user, and determine the target customer service text corresponding to each customer service voice message.
[0079] Unlike existing technologies, this application aims to enable customer service chatbots to accurately segment and recognize semantics from multiple segments of customer service voice input by users. In this embodiment, at least one customer service voice message initiated by the user is first processed for speech recognition, converting each message into a corresponding target customer service text.
[0080] It should be noted that when this intent understanding scheme is carried out in, for example... Figure 3 In the offline customer service scenario shown, the computational power for intent understanding is relatively sufficient in offline scenarios, thus enabling... Figure 3 The terminal can acquire at least one customer service voice message initiated by the user within a certain period of time, and perform intent understanding on each customer service voice message within that period of time; alternatively, the terminal can also acquire one or more customer service voice messages initiated by the user, up to a preset number, and perform intent understanding on the preset number of customer service voice messages.
[0081] And when this intent understanding scheme is applied in, for example Figure 2 In the online customer service scenario shown, due to the limitations of the customer service server's processing resources and efficiency, the customer service server will only trigger the intent understanding processing of the customer service voice once when preset conditions are met.
[0082] Specifically, the customer service server continuously collects customer service voice messages initiated by users, and when it determines that the sum of the text lengths of the target customer service texts corresponding to the continuously collected customer service voice messages is greater than a preset text length threshold, it executes subsequent step 402. In this way, the processing resources of the customer service server can be effectively utilized, improving the overall processing efficiency of online processing.
[0083] Step 402: Concatenate the target customer service texts to obtain the target long text, and use the trained semantic segmentation model to identify the target long text and obtain the semantic segmentation points of the target long text; wherein, the trained semantic segmentation model is obtained by deep learning training the semantic segmentation model to be trained using the long text sample dataset. The long text sample dataset includes multiple long text samples and the label sequence of the semantic segmentation points corresponding to each long text sample.
[0084] Step 403: Perform text segmentation on the target long text based on semantic segmentation points to obtain semantic text segments.
[0085] Step 404: Perform semantic recognition on the semantic text segment to obtain the user's semantic recognition result.
[0086] In steps 402-404, after obtaining the aforementioned target customer service text, the target customer service texts can be spliced together to connect the beginning and end of each target customer service text to obtain the target long text.
[0087] For example, the multiple customer service texts obtained through step 401 are as follows:
[0088] "Hello." "I'd like to ask if the items I ordered have been shipped?" "If they haven't been shipped, please don't ship them, I don't want them anymore." "Also, I'd like to purchase item A." "Please send it to me, thank you."
[0089] By concatenating the above customer service text, the following target long text can be obtained: "Hello / I would like to ask / has the item I purchased been shipped / If it has not been shipped, please do not ship it / I don't want it / Also, I would like to purchase item A / Please send it to me / Thank you."
[0090] Then, the target long text is input into a pre-trained semantic segmentation model, enabling the model to identify and analyze semantic segmentation points within the target long text. This trained semantic segmentation model is obtained by deep learning training on a long text sample dataset. The long text sample dataset includes multiple long text samples and a label sequence of semantic segmentation points corresponding to each long text sample. The model training process can be found in subsequent implementation methods; this implementation method will not elaborate on the specific training process of the model.
[0091] In other words, in the optional implementation, the customer service server or terminal inputs the target long text into the trained semantic segmentation model to obtain the predicted sequence of the target long text output by the trained semantic segmentation model. The predicted sequence includes the predicted value corresponding to each text field in the target long text. The semantic segmentation points in the target long text are determined based on the predicted values corresponding to each text field.
[0092] In an optional implementation, when the customer service server or terminal determines the semantic segmentation point in the target long text based on the predicted value corresponding to each text field, for any predicted value in the prediction sequence, if the predicted value is greater than a preset predicted value threshold, then there is a semantic segmentation point between the text field corresponding to the predicted value and the next text field adjacent to the text field.
[0093] Exemplarily, if a certain target long text is expressed as "Hello, are you there? / Does this piece of clothing have XL size?", the predicted sequence output by the model can be expressed as: "0.01 0.21 0.01 0.87 0.01 0.22 0.15 0.33 0.01 0.20 0.11 0.20 0.11 0.11". Among them, this predicted sequence is composed of the predicted values corresponding to each text field in the target long text. And the predicted value of each text field is used to characterize the probability that there is a semantic segmentation point between this text field and its next text field. Assuming that the predicted value threshold is 0.5, then there is a semantic segmentation point between the fourth text field "me" and the fifth text field "this".
[0094] Subsequently, as described in step 403, based on the semantic segmentation point, the customer service server or the terminal will also perform text segmentation processing on this target long text:
[0095] Exemplarily, taking the target long text "Hello / I would like to ask / I wonder if the goods I purchased before have been shipped / If not, please don't ship them / I don't want them anymore / Also, I want to buy product A / Send it to me, please / Thank you" as an example, there is a semantic segmentation point between "good / I"; there is a semantic segmentation point between "already / also".
[0096] That is, the semantic text segments corresponding to this target long text are obtained as: "Hello", "I would like to ask / I wonder if the goods I purchased before have been shipped / If not, please don't ship them / I don't want them anymore", and "Also, I want to buy product A / Send it to me, please / Thank you"
[0097] And as described in step 404, after obtaining the semantic text segments, similar to the prior art, the customer service server or the terminal will perform subsequent semantic recognition processing on the semantic text segments. It can be known that the same or similar semantics will be expressed in the same semantic text segment, and they can be respectively used as target texts and input into the subsequent semantic recognition model or semantic recognition module for semantic recognition processing to obtain semantic recognition results.
[0098] In an optional implementation manner, the customer service server or the terminal can also call a response processing model or a response processing module to generate a corresponding customer service reply according to the semantic recognition result.
[0099] Exemplarily, the present application can obtain the following customer service Q&A:
[0100] "Customer service chatbot: Hello, this is customer service 003. How can I help you?
[0101] User: Hello?
[0102] User: I would like to ask, have the goods I purchased before been shipped?
[0103] User: Please do not ship if the item has not yet been shipped.
[0104] User: I don't want it anymore.
[0105] User: Also, I want to buy product A.
[0106] User: Please send it to me, thank you.
[0107] Customer service chatbot: Hello, it's a pleasure to assist you.
[0108] Customer service chatbot: We have cancelled your order.
[0109] Customer service chatbot: Here is the product link for product A. Please take a look.
[0110] Customer service chatbot: Is there anything else I can do for you?
[0111] It is evident that by utilizing this solution, the customer service chatbot can provide targeted and accurate customer service responses based on the semantics of six customer service voice messages input by the user. Compared to existing technologies, the customer service responses obtained in this way are more closely matched to the user's intent, resulting in better response effectiveness and a superior user experience.
[0112] This application provides an intent understanding method. Unlike existing technologies, this application adds steps to concatenate multiple customer service voice messages into a target customer service text and then performs text segmentation based on semantic segmentation points on the resulting target long text. The processed semantic text segments replace the individual customer service texts in existing technologies, allowing for subsequent semantic recognition and response processing to obtain a customer service reply. The customer service reply obtained in this way better matches the user's intent, resulting in a better response effect and a superior user experience.
[0113] Based on the above embodiments, this application also provides a training method for a semantic segmentation model. In this embodiment, the execution entity of the semantic segmentation model training method is the aforementioned model training server. Figure 5 This is a flowchart illustrating a training method for a semantic segmentation model provided in an embodiment of this application. Figure 5 As shown, the training method for this semantic segmentation model can include the following steps:
[0114] Step 501: Generate a long text sample dataset based on the obtained historical customer service dialogue logs; the long text sample dataset includes multiple long text samples and the label sequence of semantic segmentation points corresponding to each long text sample.
[0115] To enable customer service chatbots to accurately segment and recognize semantics from multiple segments of user-inputted customer service voice messages, this application's implementation will also utilize long text samples to train the model.
[0116] Specifically, firstly, the model training server can obtain historical customer service dialogue logs. These historical customer service dialogue logs refer to the log data generated each time the customer service chatbot provided customer service answers to users.
[0117] The historical customer service dialogue log includes data on the customer service dialogue robot's responses to different users. The data for each customer service response is represented in the form of customer service dialogue text. The historical customer service dialogue log includes at least one customer service dialogue text segment generated during a customer service response process, and each customer service dialogue text segment includes at least one round of dialogue text.
[0118] For example, a customer service dialogue scenario can be described as follows:
[0119] Customer service chatbot: Hello, this is Customer Service 003. What problem are you experiencing?
[0120] User: I would like to ask if product A is still in stock?
[0121] User: Because someone recommended product A as very useful.
[0122] User: Product A is currently on sale, and I'd like to buy a few more.
[0123] Customer service chatbot: This product is out of stock. We suggest you check back later.
[0124] User: Is product B in stock?
[0125] Customer service chatbot: This product is in stock; you can place an order to purchase it.
[0126] User: Okay, thank you.
[0127] In the above customer service dialogue scenario, the historical customer service dialogue log will be written with the following data as the customer service dialogue text segment generated during the customer service response process: "Hello, this is Customer Service 003 at your service. What problem are you encountering?" "I would like to ask if product A is still in stock?" "Because someone recommended product A as very useful." "Product A is currently on sale." "This product is out of stock. We suggest you check back later." "I would like to buy a few more." "Is product B in stock?" "This product is in stock. You can place an order." "Okay." Thank you.
[0128] After obtaining the historical customer service dialogue logs as shown above, the model training server will generate a long text sample dataset.
[0129] Specifically, research has found that during the semantic analysis of customer service voice messages by chatbots, when users encounter the same business question, and when users use multiple voice inputs or short sentences to describe the question, existing chatbots tend to make semantic errors in these types of voice messages, resulting in low semantic recognition accuracy.
[0130] In order to improve the data quality of long text sample datasets and ensure the training effect of the model, in an optional implementation, the number of customer service dialogue rounds and the text length of the customer service dialogue text segment can be fully considered to select customer service dialogue text segment samples that can reflect the above situation from each customer service dialogue text segment in the historical customer service dialogue log, so as to conduct targeted model training.
[0131] Specifically, when generating a long text sample dataset based on the acquired historical customer service dialogue logs, the text length and number of dialogue turns for each customer service dialogue text segment can be determined first, and the ratio between the text length and the number of dialogue turns for each customer service dialogue text segment can be calculated. Then, multiple customer service dialogue text segment samples can be selected from each customer service dialogue text segment based on the ratio of each customer service dialogue text segment. Finally, long text samples in the long text sample dataset can be generated based on each customer service dialogue text segment sample.
[0132] Using the example above, the text length in the above customer service dialogue segment is 112 characters, and the number of dialogue rounds is 3 (each reply from the customer service chatbot is counted as one dialogue round), with a ratio of 37.333.
[0133] Similarly, the ratios of each customer service dialogue text segment in the historical customer service dialogue logs are calculated to obtain the corresponding ratio for each segment. A smaller ratio indicates that the text length in the customer service dialogue text within the same number of dialogue turns is relatively short, suggesting that the user in that segment may have used more short sentences to describe the problem. Conversely, a smaller ratio also indicates that there were more dialogue turns within the text length, suggesting that the user in that segment may have used multiple voice inputs to describe the same problem. Therefore, to train the model more effectively, customer service dialogue text segments with smaller ratios can be used for training.
[0134] In other words, in this embodiment, the customer service dialogue text segments are sorted from smallest to largest according to the calculated ratios, and the top 50% (i.e., those with smaller ratios) are selected as customer service dialogue text segment samples. Then, these customer service dialogue text segment samples with smaller ratios are used to generate a long text sample dataset.
[0135] Based on the above implementation method, this implementation method can generate a long text sample dataset in the following way so that the sample data in the long text sample dataset is consistent with the target long text input in real situation.
[0136] Specifically, when generating a long text sample dataset using these customer service dialogue text segment samples with smaller ratios, the customer service texts in each customer service dialogue text segment sample can be concatenated first to obtain multiple long text samples in the long text sample dataset. Then, the label value of the semantic segmentation point of each text field in each long text sample is determined to obtain the label sequence of the semantic segmentation point corresponding to each long text sample in the long text sample dataset.
[0137] Of course, during the splicing process, the text of the user-initiated statement can be selected from each customer service text and spliced together.
[0138] Using the previous example, by concatenating the customer service text initiated by the user, we can obtain the following long text sample: "I would like to ask if product A is still in stock / because someone recommended product A as very useful / product A is currently on sale / I would like to buy a few more / is product B in stock / okay / thank you." Then, the long customer service conversation was tagged, resulting in the tagging result: "I want to ask if product A is still in stock / / (semantic segmentation point) / / Because someone recommended product A as very useful / Product A is currently discounted / I want to buy a few more / / (semantic segmentation point) / / Is product B in stock / / (semantic segmentation point) / / Okay / Thank you." A corresponding tag sequence was generated, such as "00 00 00 00 00 00 00 00 00 00 00 01 0 ... 00 00". Here, "00" and "01" are both label values for semantic segmentation points of the text field. "00" indicates that there is no semantic segmentation point between the current text field and the next text field, while "01" indicates that there is a semantic segmentation point between the current text field and the next text field.
[0139] The above method can generate the label sequence corresponding to each long text sample, and each long text sample and its corresponding label sequence constitute the long text sample dataset.
[0140] Step 502: Use the long text sample dataset to train the semantic segmentation model to be trained using deep learning to obtain the trained semantic segmentation model; wherein, the trained semantic segmentation model is used to identify semantic segmentation points in the target long text.
[0141] Specifically, once a long text sample dataset is obtained, the model training server will use this long text sample dataset to train the pre-built semantic segmentation model to be trained.
[0142] During training, to ensure the training effect of the semantic segmentation model, the model needs to be trained multiple times, and the model's training completion is determined based on the convergence of the model's loss after each training iteration. Specifically, in an optional implementation, each long text sample from the long text sample dataset is sequentially input into the current semantic segmentation model to be trained, obtaining the predicted sequence of semantic segmentation points corresponding to each long text sample input to the semantic segmentation model; the model loss of the current semantic segmentation model to be trained is determined based on the predicted sequence and label sequence of each long text sample; the current semantic segmentation model to be trained is updated based on the model loss, and the updated semantic segmentation model is trained using the long text sample dataset until the model loss converges; the current semantic segmentation model to be trained when the model loss converges is used as the trained semantic segmentation model.
[0143] To explain the training process more clearly, Figure 6 This is a schematic diagram illustrating the training process of a semantic segmentation model provided in an embodiment of this application, as shown below. Figure 6 As shown, firstly, an arbitrary long text sample will be selected from the long text sample dataset as the long text to be processed.
[0144] Then, the long text to be processed is input into the current semantic segmentation model, and the model will output the prediction sequence corresponding to the long text to be processed, such as "0.01 0.21 0.01……0.87 0.01 0.22……". Similar to the label sequence mentioned above, the prediction sequence includes the predicted value of the semantic segmentation point of each text field in the long text to be processed. However, unlike the label sequence mentioned above, each predicted value in the prediction sequence is used to characterize the probability that the text field corresponding to the predicted value is a semantic segmentation point with the next text field. That is, the predicted value is a probability value.
[0145] Once the predicted sequence of the long text to be processed is obtained, the model loss of the current semantic segmentation model can be calculated based on the label sequence of the text. Subsequently, the model loss can be used to update the model parameters, including inversion, and to determine whether the model meets the training completion criteria, that is, whether the model loss has converged.
[0146] If the model loss does not converge, the next long text sample can be selected from the long text sample dataset as the long text to be processed, and the above steps can be repeated to train the current semantic segmentation model using the new long text to be processed until the trained semantic segmentation model with converged model loss is obtained.
[0147] Of course, in this implementation, the model loss can be calculated by cross-entropy, that is, by determining the cross-entropy between the predicted value and the corresponding label value of each text field in each long text sample, and by determining the model loss of the current semantic segmentation model to be trained based on the cross-entropy corresponding to each long text sample.
[0148] At this point, the model training server will have completed training the model and obtained the trained semantic segmentation model.
[0149] The semantic segmentation model training method provided in this embodiment generates multiple long text samples and a label sequence for representing the semantic segmentation points of each long text sample based on historical customer service dialogue logs. The long text samples conform to the language habits of users when conducting interpersonal dialogues. In addition, this embodiment will also construct a long text sample dataset based on the long text samples and the label sequence, and perform deep learning training on the semantic segmentation model to be trained to obtain the trained semantic segmentation model.
[0150] Corresponding to the intent understanding method provided in the above embodiments, Figure 7 This is a structural block diagram of an intent understanding device provided for embodiments of this application. For ease of explanation, only the parts relevant to embodiments of this application are shown. (Refer to...) Figure 7 The intent understanding device includes:
[0151] The acquisition module 710 is used to acquire at least one customer service voice message initiated by the user;
[0152] The processing module 720 is used to determine the target customer service text corresponding to each customer service voice message; concatenate the target customer service texts to obtain the target long text, and use a trained semantic segmentation model to identify the target long text to obtain the semantic segmentation points of the target long text; wherein, the trained semantic segmentation model is obtained by deep learning training on the semantic segmentation model to be trained using a long text sample dataset, the long text sample dataset including multiple long text samples and a label sequence of semantic segmentation points corresponding to each long text sample; and perform text segmentation processing on the target long text according to the semantic segmentation points to obtain semantic text segments;
[0153] The recognition module 730 is used to perform semantic recognition on the semantic text segment and obtain the user's semantic recognition result.
[0154] Optionally, the processing module 720 is specifically used for: inputting the target long text into the trained semantic segmentation model to obtain a prediction sequence of the target long text output by the trained semantic segmentation model, wherein the prediction sequence includes the prediction value corresponding to each text field in the target long text; and determining the semantic segmentation points in the target long text based on the prediction values corresponding to each text field.
[0155] Optionally, the processing module 720 is specifically used to: for any predicted value in the predicted sequence, if the predicted value is greater than a preset predicted value threshold, then there is a semantic segmentation point between the text field corresponding to the predicted value and the next text field adjacent to the text field.
[0156] Optionally, the acquisition module 710 is further configured to: continuously collect customer service voice messages initiated by the user, and when it is determined that the sum of the text lengths of the target customer service texts corresponding to the continuously collected customer service voice messages is greater than a preset text length threshold, the processing module 720 performs splicing processing on each target customer service text.
[0157] This application provides an intent understanding device. Unlike existing technologies, this application adds steps to concatenate multiple customer service voice messages into target customer service text and then performs text segmentation based on semantic segmentation points on the resulting target long text. The processed semantic text segments replace the individual customer service texts in existing technologies, enabling subsequent semantic recognition and response processing to obtain a customer service reply. The customer service reply obtained in this way better matches the user's intent, resulting in a better response effect and a superior user experience.
[0158] Corresponding to the training method of the semantic segmentation model provided in the above embodiments, Figure 8This is a structural block diagram of a training apparatus for a semantic segmentation model provided in an embodiment of this application. For ease of explanation, only the parts relevant to the embodiments of this application are shown. (Refer to...) Figure 8 The training apparatus for this semantic segmentation model includes:
[0159] The dataset generation module 810 is used to generate a long text sample dataset based on the acquired historical customer service dialogue logs; wherein, the long text sample dataset includes multiple long text samples and a label sequence of semantic segmentation points corresponding to each long text sample.
[0160] The training module 820 is used to perform deep learning training on the semantic segmentation model to be trained using the long text sample dataset to obtain the trained semantic segmentation model; wherein, the trained semantic segmentation model is used to identify semantic segmentation points in the target long text.
[0161] Optionally, the historical customer service dialogue log includes at least one customer service dialogue text segment generated during a customer service response process, and each customer service dialogue text segment includes at least one round of customer service dialogue text.
[0162] The dataset generation module 810 is specifically used for: determining the text length and number of dialogue turns of each customer service dialogue text segment, calculating the ratio between the text length and the number of dialogue turns of each customer service dialogue text segment; selecting multiple customer service dialogue text segment samples from each customer service dialogue text segment based on the ratio of each customer service dialogue text segment; and generating long text samples in the long text sample dataset based on the customer service dialogue text segment samples.
[0163] Optionally, the dataset generation module 810 is specifically used to: concatenate each customer service text in each customer service dialogue text segment sample to obtain multiple long text samples in the long text sample dataset; determine the label value of the semantic segmentation point of each text field in each long text sample to obtain the label sequence of the semantic segmentation point corresponding to each long text sample in the long text sample dataset.
[0164] Optionally, the training module 820 is specifically used for: sequentially inputting each long text sample in the long text sample dataset into the current semantic segmentation model to be trained, to obtain the predicted sequence of semantic segmentation points corresponding to each long text sample input to the semantic segmentation model to be trained; determining the model loss of the current semantic segmentation model to be trained based on the predicted sequence and the label sequence of each long text sample; updating the current semantic segmentation model to be trained based on the model loss, and training the updated semantic segmentation model to be trained using the long text sample dataset until the obtained model loss converges; and using the current semantic segmentation model to be trained when the model loss converges as the trained semantic segmentation model.
[0165] Optionally, the prediction sequence of the long text sample includes the predicted value of the semantic segmentation point corresponding to each text field in the long text sample; the label sequence of the long text sample includes the label value of the semantic segmentation point corresponding to each text field in the long text sample.
[0166] The training module 820 is specifically used to: determine the cross-entropy between the predicted value and the corresponding label value of each text field in each long text sample, and determine the model loss of the current semantic segmentation model to be trained based on the cross-entropy corresponding to each long text sample.
[0167] The semantic segmentation model training device provided in this embodiment generates multiple long text samples and a label sequence for representing the semantic segmentation points of each long text sample based on historical customer service dialogue logs. The long text samples conform to the language habits of users when conducting interpersonal dialogues. In addition, this embodiment will also construct a long text sample dataset based on the long text samples and the label sequence, and perform deep learning training on the semantic segmentation model to be trained to obtain the trained semantic segmentation model.
[0168] Figure 9 A hardware structure diagram of an electronic device provided in this application is shown below. Figure 9 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.
[0169] 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.
[0170] 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.
[0171] 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.
[0172] 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. An intention understanding method, characterized by, The method comprises: obtaining at least one customer service voice initiated by a user, and determining target customer service texts corresponding to the customer service voices; splicing the target customer service texts to obtain a target long text, and inputting the target long text into a trained semantic segmentation model to obtain a predicted sequence of the target long text output by the trained semantic segmentation model; wherein the trained semantic segmentation model is obtained by deep learning training of a semantic segmentation model to be trained using a long text sample data set, the long text sample data set comprises a plurality of long text samples and a label sequence of semantic segmentation points corresponding to each long text sample, and the predicted sequence comprises a predicted value of each text field in the target long text; determining semantic segmentation points in the target long text according to the predicted value of each text field; performing text segmentation processing on the target long text according to the semantic segmentation points to obtain at least one semantic text segment; performing semantic recognition on each semantic text segment to obtain a semantic recognition result of the user.
2. The intention understanding method according to claim 1, characterized in that, The method comprises: for any predicted value in the predicted sequence, if the predicted value is greater than a preset predicted value threshold, there is a semantic segmentation point between the text field corresponding to the predicted value and a next text field adjacent to the text field.
3. The intention understanding method according to claim 1 or 2, characterized in that, The method further comprises: continuously collecting customer service voices initiated by a user, and performing splicing processing on the target customer service texts when it is determined that a sum of text lengths of the continuously collected customer service voices is greater than a preset text length threshold.
4. A method for training a semantic segmentation model, the method comprising: The method comprises: generating a long text sample data set according to obtained historical customer service dialogue logs; wherein the long text sample data set comprises a plurality of long text samples and a label sequence of semantic segmentation points corresponding to each long text sample; inputting each long text sample in the long text sample data set into a current semantic segmentation model to be trained in sequence to obtain a predicted sequence of each long text sample input by the semantic segmentation model to be trained, the predicted sequence of the long text sample comprising a predicted value of a semantic segmentation point corresponding to each text field in the long text sample; determining a model loss of the current semantic segmentation model to be trained according to the predicted sequence of each long text sample and the label sequence of each long text sample; updating the current semantic segmentation model to be trained according to the model loss, and training the updated semantic segmentation model to be trained using the long text sample data set until the obtained model loss converges; taking the current semantic segmentation model to be trained when the model loss converges as a trained semantic segmentation model; wherein the trained semantic segmentation model is used to identify semantic segmentation points in a target long text.
5. The training method of claim 4, wherein, The historical customer service dialogue logs comprise at least one customer service dialogue text segment generated in a customer service reply process, and each customer service dialogue text segment comprises customer service texts of at least one round of dialogue; The method comprises: determine the text length and the number of dialogue rounds of each customer service dialogue text segment, and calculate the ratio between the text length and the number of dialogue rounds of each customer service dialogue text segment; select a plurality of customer service dialogue text segment samples from the customer service dialogue text segments according to the ratios of the customer service dialogue text segments; generate long text samples in the long text sample data set according to the customer service dialogue text segment samples.
6. The training method of claim 5, wherein, The generating of the long text samples in the long text sample data set according to the customer service dialogue text segment samples comprises: splicing each customer service text in the customer service dialogue text segment sample to obtain a plurality of long text samples in the long text sample data set; determine the label value of the semantic segmentation point of each text field in each long text sample to obtain the label sequence of the semantic segmentation point corresponding to each long text sample in the long text sample data set.
7. The training method of claim 5, wherein, The label sequence of the long text sample comprises the label value of the semantic segmentation point corresponding to each text field in the long text sample. The determining of the model loss of the current to-be-trained semantic segmentation model according to the prediction sequence of each long text sample and the label sequence of each long text sample comprises: determining the cross-entropy between the prediction value of each text field in each long text sample and the corresponding label value, and determining the model loss of the current to-be-trained semantic segmentation model according to the cross-entropies corresponding to each long text sample.
8. An intention understanding apparatus characterized by comprising: comprise: an acquisition module configured to acquire at least one customer service voice initiated by a user; a processing module configured to determine target customer service texts corresponding to the customer service voices; splicing the target customer service texts to obtain a target long text, and inputting the target long text into a trained semantic segmentation model to obtain a prediction sequence of the target long text output by the trained semantic segmentation model; wherein the trained semantic segmentation model is obtained by performing deep learning training on a to-be-trained semantic segmentation model using a long text sample data set, the long text sample data set comprises a plurality of long text samples and a label sequence of a semantic segmentation point corresponding to each long text sample, the prediction sequence comprises prediction values of text fields in the target long text, and the semantic segmentation point in the target long text is determined according to the prediction values of the text fields; performing text segmentation processing on the target long text according to the semantic segmentation point to obtain at least one semantic text segment; an identification module configured to perform semantic identification on the semantic text segments to obtain a semantic identification result of the user.
9. A training device for a semantic segmentation model, characterized in that, comprise: a data set generation module configured to generate a long text sample data set according to historical customer service dialogue logs; wherein the long text sample data set comprises a plurality of long text samples and a label sequence of a semantic segmentation point corresponding to each long text sample; a training module configured to input each long text sample in the long text sample data set into a current to-be-trained semantic segmentation model in sequence to obtain a prediction sequence of each long text sample input by the to-be-trained semantic segmentation model, the prediction sequence of the long text sample comprising prediction values of semantic segmentation points corresponding to text fields in the long text sample; determine a model loss of the current semantic segmentation model to be trained according to the predicted sequence of each long text sample and the label sequence of each long text sample; update the current semantic segmentation model to be trained according to the model loss, and train the updated semantic segmentation model to be trained by using the long text sample dataset until a model loss obtained converges; take the current semantic segmentation model to be trained when the model loss converges as a trained semantic segmentation model; wherein the trained semantic segmentation model is used to identify semantic segmentation points in a target long text.
10. An electronic device, comprising: comprise: at least one processor; and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method according to any one of claims 1-7.
11. A computer readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1-7 is implemented.
12. A computer program product comprising computer instructions, characterized in that, The computer instructions are executed by the processor to implement the method according to any one of claims 1-7.
Citation Information
Patent Citations
Intention recognition model training method and device, intention recognition method and device, equipment and medium
CN113886548A
Intent recognition method, device and equipment based on artificial intelligence and storage medium
CN113935333A