Intention recognition model training method and apparatus
By segmenting the dialogue text into fragments and encoding and pooling them, combined with prediction unit transformation and parameter tuning, the shortcomings of existing intent recognition models in global information fusion are solved, the accuracy of intent recognition is improved, and it is suitable for intent recognition in various business scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-18
- Publication Date
- 2026-04-07
AI Technical Summary
Existing intent recognition models have low accuracy in recognizing global dialogue information and cannot effectively integrate contextual information, resulting in insufficient recognition accuracy.
The target dialogue text is segmented into at least two text segments, encoded by an encoding unit, averaged by a pooling unit, and transformed by a prediction unit. The initial intent recognition model is then tuned based on standard intent category information until the training conditions are met.
This improved the accuracy of intent prediction based on the global representation of dialogue text, and enhanced the processing capabilities of downstream businesses.
Smart Images

Figure CN115827831B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present specification relates to the technical field of machine learning, and particularly relates to an intent recognition model training method and device. BACKGROUND
[0002] With the development of computer technology, deep learning has penetrated into various business scenarios of modern life and has become an important supporting technology for various interconnected businesses. It has varying degrees of application in daily scenarios such as search, recommendation, intelligent customer service, text processing, and automatic driving. As a processing technology for connecting different downstream businesses, the recognition accuracy of intent recognition determines the processing method of the downstream business. For example, in the course recommendation scenario, by analyzing the conversation content of course recommendation, the demand degree of users for purchasing courses can be determined, and based on this, course recommendation can be carried out. Not only can it hit users with high demand degree, but also can avoid disturbing users with low demand degree. As can be seen, the accuracy of intent recognition determines the degree of advancement of downstream business. In the prior art, intent recognition is mostly based on models, but it is affected by model architecture and samples. Although it can achieve the purpose of intent recognition, the accuracy is low and cannot complete intent recognition from global information of the conversation. Therefore, an effective solution is needed to solve the above problems. SUMMARY
[0003] Therefore, an intent recognition model training method is provided in the embodiments of the present specification. The present specification also relates to an intent recognition model training device, an intent recognition method, an intent recognition device, a computing device, and a computer-readable storage medium to solve the technical defects in the prior art.
[0004] According to a first aspect of the embodiments of the present specification, an intent recognition model training method is provided, comprising:
[0005] obtaining a target conversation text and dividing the target conversation text into at least two text segments;
[0006] inputting the at least two text segments into an initial intent recognition model, wherein the initial intent recognition model comprises an encoding unit, a pooling unit, and a prediction unit;
[0007] performing encoding processing on the at least two text segments by the encoding unit to obtain text features, wherein the text features include segment features corresponding to each text segment;
[0008] performing pooling processing on the text features containing the segment features by the pooling unit, converting the pooling processing result by the prediction unit to obtain prediction intent category information and output;
[0009] The initial intent recognition model is tuned based on the standard intent category information corresponding to the target dialogue text and the predicted intent category information until an intent recognition model meeting a training condition is obtained.
[0010] According to a second aspect of the embodiments of the present specification, an intent recognition model training apparatus is provided, including:
[0011] An obtaining module is configured to obtain a target dialogue text and split the target dialogue text into at least two text segments;
[0012] An input module is configured to input the at least two text segments into an initial intent recognition model, wherein the initial intent recognition model includes an encoding unit, a pooling unit and a prediction unit;
[0013] An encoding module is configured to perform encoding processing on the at least two text segments through the encoding unit to obtain text features, wherein the text features include segment features corresponding to each text segment;
[0014] A pooling module is configured to perform pooling processing on the text features including the segment features through the pooling unit, convert the pooling processing result by using the prediction unit, obtain predicted intent category information and output the predicted intent category information;
[0015] A training module is configured to tune the initial intent recognition model based on the standard intent category information corresponding to the target dialogue text and the predicted intent category information until an intent recognition model meeting a training condition is obtained.
[0016] According to a third aspect of the embodiments of the present specification, an intent recognition method is provided, including:
[0017] Obtaining a to-be-processed dialogue text associated with a target user in a target service;
[0018] Splitting the to-be-processed dialogue text into at least two to-be-processed text segments;
[0019] Inputting the at least two to-be-processed text segments into an intent recognition model in the above method for processing to obtain intent category information corresponding to the to-be-processed dialogue text;
[0020] Determining a participation intent of the target user in the target service according to the intent category information.
[0021] According to a fourth aspect of the embodiments of the present specification, an intent recognition apparatus is provided, including:
[0022] An obtaining text module is configured to obtain a to-be-processed dialogue text associated with a target user in a target service;
[0023] The segmentation text module is configured to segment the to-be-processed dialogue text into at least two to-be-processed text segments.
[0024] The input model module is configured to input the at least two to-be-processed text segments into the intent recognition model in the above method for processing to obtain intent category information corresponding to the to-be-processed dialogue text.
[0025] The determination intent module is configured to determine, according to the intent category information, an engagement intent of the target user in the target business.
[0026] According to a fifth aspect of an embodiment of the present specification, a computing device is provided, comprising:
[0027] a memory and a processor;
[0028] The memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions to implement the steps of the intent recognition model training method or the intent recognition method.
[0029] According to a sixth aspect of an embodiment of the present specification, a computer readable storage medium is provided, which stores computer executable instructions, and the instructions are executed by a processor to implement the steps of the intent recognition model training method or the intent recognition method.
[0030] The intent recognition model training method provided by the present specification can improve the model recognition accuracy. After obtaining the target dialogue text, the target dialogue text is divided into at least two text segments, and then input into the initial intent recognition model. The encoding unit in the model is used to perform encoding processing to obtain text features containing segment features corresponding to each text segment, so as to realize the representation of all text segments through one text feature. Then, the text features are input into the pooling unit for average pooling processing, and the prediction unit is used for conversion after the pooling processing, so as to obtain the intent recognition category information. Finally, based on the standard intent category information and the predicted intent category information corresponding to the target dialogue text, the initial intent recognition model is adjusted until the intent recognition model meeting the training condition is obtained. In the model training process, the representation of the target dialogue text is fused through the average pooling of the pooling unit, and the model is trained based on this. In this way, the model learns to predict the intent based on the global representation of the dialogue text in the training process, so that the prediction accuracy of the trained model is higher, and the downstream business is facilitated. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 is a flowchart of an intent recognition model training method provided by an embodiment of the present specification;
[0032] Figure 2 is a schematic diagram of an intent recognition model training method provided by an embodiment of the present specification;
[0033] Figure 3 is a structural schematic diagram of an intent recognition model training apparatus provided by an embodiment of the present specification;
[0034] Figure 4 is a flowchart of an intent recognition method provided by an embodiment of the present specification;
[0035] Figure 5 is a structural schematic diagram of an intent recognition apparatus provided by an embodiment of the present specification;
[0036] Figure 6 is a processing flowchart of an intent recognition method provided by an embodiment of the present specification;
[0037] Figure 7 is a structural block diagram of a computing device provided by an embodiment of the present specification. DETAILED DESCRIPTION
[0038] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present specification. However, the present specification can be practiced without the specific details, other than in the examples provided herein. In other instances, well-known methods, procedures, and components have not been described in detail so as not to unnecessarily obscure aspects of the present specification.
[0039] The terminology used in one or more embodiments of the present specification is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present specification. As used in one or more embodiments of the present specification and the accompanying claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in one or more embodiments of the present specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0040] It will be understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal or chronological order. Rather, these terms are used solely to distinguish one from another. For example, a first entity discussed below could be termed a second entity, and, similarly, a second entity could be termed a first entity without departing from the scope of one or more embodiments of the present specification. As used herein, the term "if' can be interpreted to mean "when" or "in response to determining" or "in response to a determination" depending on the context.
[0041] First, the noun terms related to one or more embodiments of the present specification are explained.
[0042] BERT: BERT stands for Bidirectional Encoder Representation from Transformers. It is a pre-trained language model for natural language processing, which is a self-encoding language model that can obtain vector representations of text by encoding bidirectional information of text.
[0043] Text classification: Text classification is a classic task in natural language processing. The task is to assign text to its category according to a certain classification system or standard. In the field of machine learning, given labeled training data, the model can predict the category of text after training.
[0044] In this specification, a method for training an intent recognition model is provided. This specification also relates to a device for training an intent recognition model, a method for intent recognition, a device for intent recognition, a computing device, and a computer-readable storage medium. In the following embodiments, they are described in detail one by one.
[0045] In practical applications, intent prediction can be regarded as a text classification task. For a piece of text, first input it into the encoding model for processing to obtain a vector representation, and then calculate the probability of each category through a neural network. The highest probability is taken as the category of the text. In the language model modeling stage, there are several effective encoders for the problem of how to improve the ability of the encoder to capture long-distance dependencies. LSTM is used to model long-distance dependencies, using a gating mechanism and gradient clipping, and its average longest encoding distance is about 200 words. Transformer uses a self-attention mechanism to allow words to establish direct connections and better capture long-distance dependencies. Although its encoding ability exceeds that of LSTM, it is limited to fixed-length context. The maximum input length of the BERT model based on Transformer is 512, but in the dialogue scenario, the total number of words is mostly greater than this number, which causes the model to be unable to encode at once. This results in the inability to integrate context information for subsequent processing.
[0046] The intention recognition model training method provided in the specification can improve the model recognition accuracy. After obtaining the target dialogue text, it is divided into at least two text segments, and then uniformly input into the initial intention recognition model. The encoding unit in the model first performs encoding processing to obtain text features containing segment features corresponding to each text segment, realizing the representation of all text segments through one text feature. Then the text feature is input into the pooling unit for average pooling processing, and the prediction unit is used for conversion after the pooling processing, so as to obtain the intention recognition category information. Finally, based on the standard intention category information and the predicted intention category information corresponding to the target dialogue text, the initial intention recognition model is adjusted until the intention recognition model meeting the training condition is obtained, so that in the model training process, the representation of the target dialogue text is fused through the average pooling of the pooling unit, and the model is trained based on this, so that the model learns to predict the intention based on the global representation of the dialogue text in the training process, so that the prediction accuracy of the trained model is higher, and the downstream business is convenient to use.
[0047] Figure 1 A flowchart of an intention recognition model training method according to an embodiment of the specification is shown, which specifically includes the following steps:
[0048] In step S102, a target dialogue text is obtained, and the target dialogue text is divided into at least two text segments.
[0049] Specifically, the target dialogue text specifically refers to the text formed by the dialogue content between the operator of the business project and the user in the actual business project. Training the intention recognition model based on this text can determine the user's intention to participate in the business project in the business project, so as to realize the processing of the downstream business according to the intention recognition result. It should be noted that the intention recognition model trained in different business project scenarios has different intention recognition capabilities, i.e. different intention categories are recognized, and the recognition capability is affected by the target dialogue text. Different target dialogue texts can be selected in different business scenarios, and the present embodiment does not make any limitation here.
[0050] The present embodiment takes the purchase of online courses as an example to describe the process of the intention model training method. The same or corresponding description in other scenarios can be referred to in the present embodiment, and will not be described in detail here.
[0051] Furthermore, at least two text fragments specifically refer to the fragments obtained after segmenting the target dialogue text. These fragments are used to process the target dialogue text into segments that conform to the input length of the model, so that they can be input into the model for training purposes. At the same time, the model can combine the semantics between different fragments of the same text to complete the prediction process during the prediction phase.
[0052] Furthermore, considering that a large amount of text is needed to train the initial intent recognition model during the model training phase in order to obtain an intent recognition model that meets the usage requirements, it is necessary to first determine the dialogue information set associated with the target business, and then select the target dialogue text from the set for training. In this embodiment, the specific implementation method is as follows:
[0053] Obtain a set of dialogue information related to the target business; perform data cleaning on the initial dialogue information contained in the dialogue information set to obtain a target dialogue information set containing the target dialogue information; determine at least two dialogue texts corresponding to the target dialogue information in the target dialogue information set, and obtain the target dialogue text by concatenating the at least two dialogue texts; wherein each of the at least two dialogue texts contains a speaker identifier.
[0054] Specifically, the target business refers to business projects that users can participate in and that provide corresponding services to users. The target business also involves interaction between call center operators and users, serving to help the target business provide better services and reach more users. Correspondingly, the dialogue information set refers to the collection of dialogue information between call center operators and users related to the target business. The initial dialogue information refers to the unprocessed dialogue information in the dialogue information set, containing non-standardized text content, such as modal particles, repeated word units, and missing word units. Data cleaning refers to the filtering and / or standardization of the initial dialogue information, used to remove unclear content, convert spoken content to written content, and eliminate initial dialogue information that does not meet business requirements, ensuring that the target dialogue information in the target dialogue information set meets the needs of subsequent model training. Accordingly, the dialogue text specifically refers to the speech content corresponding to any speaker involved in the dialogue information, that is, each dialogue text corresponds to one speaker, and each dialogue text contains a speaker identifier; wherein, the speaker identifier specifically refers to the identifier that represents the speaker, which can be a text identifier, a string identifier, etc., and this embodiment does not make any limitations here.
[0055] Therefore, when it is determined that an intent recognition model needs to be trained for a target business, a dialogue information set associated with the target business can be obtained first, so that the trained intent recognition model can be applied to prediction in the target business scenario. Furthermore, considering that the initial dialogue information contained in the dialogue information set is not standardized, training the model based on this may lead to a decrease in prediction accuracy. Therefore, before model training, the initial dialogue information contained in the dialogue information set can be cleaned to standardize the initial dialogue information and remove initial dialogue information that does not meet the needs of the business scenario, so as to obtain a target dialogue information set containing the target dialogue information based on the processing results.
[0056] Furthermore, after obtaining the target dialogue information set, since each target dialogue information is formed from the dialogue content between at least two users, and intent recognition not only needs to combine the speech content of the users involved in the target business, but also needs to consider the speech content of the call center staff interacting with the users, the training model samples can be built based on this, which can make the model's prediction accuracy higher. Therefore, the at least two dialogue texts contained in each target dialogue information can be concatenated to obtain multiple target dialogue texts based on the concatenation result. The target dialogue texts also contain the speaker identifiers of each user, which facilitates subsequent model training based on the speaker identifiers and text content.
[0057] In practical applications, considering that the data cleaning phase involves multiple cleaning rules defined by the target business, and that different cleaning rules will produce different modifications to the initial dialogue information, in specific implementation, one or more cleaning rules can be selected to process the initial dialogue information based on business needs to achieve the data cleaning objective. For example, if the cleaning rules include rules A, B, and C, when cleaning the initial dialogue information, rule A can be selected to process the initial dialogue information, and the cleaned dialogue information is the target dialogue information; or rules A, B, and C can be selected simultaneously to clean the initial dialogue information, and the initial dialogue information processed by the three rules is the target dialogue information.
[0058] In the target business scenario, the cleaning rules include, but are not limited to: removing initial dialogue information whose text length does not reach the length threshold, removing initial dialogue information with incorrect speaker identification, removing meaningless characters (such as interjections) from the initial dialogue information, and repairing punctuation marks in the initial dialogue information. In practical applications, cleaning rules can be set according to actual needs, and the data cleaning stage can be selected according to needs; this embodiment does not impose any limitations here.
[0059] For example, in the online course renewal business scenario, after determining the user's renewal intention, different approaches can be used to connect with the user based on different intentions. If the user's renewal intention is strong, the renewed course can be directly recommended; if the user's renewal intention is weak, a trial online course can be recommended, thereby improving the user's experience in participating in the online course renewal business. Accurate identification of the user's renewal intention is crucial in this process. Identifying the user's renewal intention can be achieved using an intent recognition model. Before that, it is necessary to train an intent recognition model that meets the current business scenario.
[0060] Furthermore, firstly, the dialogue information set related to the online course renewal business is obtained, that is, the set of dialogues between teachers and users; secondly, considering that the initial dialogue information contained in the dialogue information set may not meet the sample usage standards, the initial dialogue information contained in the dialogue information set can be cleaned; initial dialogue information with short dialogue content can be filtered, such as filtering initial dialogue information with less than 20 sentences in total between the two parties; initial dialogue information with incorrect identity labeling can be filtered, such as filtering initial dialogue information where the teacher's words are labeled as the user's words; initial dialogue information where any one person speaks more than n sentences continuously can be filtered, such as initial dialogue information where one person speaks more than 15 sentences continuously; meaningless characters in the initial dialogue information can be deleted, such as deleting the interjection "ai" in the initial dialogue information; punctuation can be corrected in the initial dialogue information, such as adding a period at the end of a sentence.
[0061] Furthermore, after cleaning the initial dialogue information contained in the dialogue information set, a target dialogue information set consisting of clearly expressed target dialogue information can be obtained. Subsequently, considering that each target dialogue information is a dialogue between a user and a teacher, in order to be usable during the model training phase and to complete intent recognition by combining the dialogue content of the two, the dialogue texts corresponding to the teacher and the user in each target dialogue text can be concatenated. The target dialogue text corresponding to the target dialogue information can then be obtained based on the concatenation result for subsequent model training.
[0062] It should be noted that in the stage of determining the speaker identifier for each dialogue text, regular expression search can be used to determine the user identity to which the initial speech text in each initial dialogue information belongs. Then, the statements identifying the user identity are used to annotate subsequent speech texts, thus determining the speaker identifier for each dialogue text. For example, in a communication between user A and user B, user A's first sentence is {a1}, and user B's first sentence is {b1}, with a total of 10 sentences exchanged. In the identity determination stage, the first and second sentences can be identified first to determine which user's first sentence corresponds to. Then, based on the speech characteristics corresponding to the first sentence, the remaining 10 sentences are identified to determine the speech content corresponding to user A, and the rest are the speech content of user B.
[0063] Alternatively, a regular expression can be used to search for the identity between user A and user B. The regular expression search is: I am user A of {1,10} | This is user A of {1,10} | Are you a parent of {1,5}? If the search conditions are met, the corresponding user is determined to be user A. If neither of them meets the conditions, the user with the most speech content is selected as user A (user A is associated with the target business).
[0064] In practical applications, the speaker identification can be selected according to actual needs, or it can be achieved by timbre recognition or manual annotation. This embodiment does not impose any limitations on this.
[0065] In summary, data cleaning of samples before model training removes redundant information, thereby improving the model's predictive ability during training. Furthermore, concatenating at least two dialogue texts within the target dialogue information allows the model to incorporate contextual information from the dialogue content, enabling it to learn latent features with identity influence during training and further enhancing its predictive capabilities.
[0066] Furthermore, considering that the dialogue content involved in business projects may be obtained through chat software or telephone calls, it is necessary to convert the audio into text before using the model. In this embodiment, the specific implementation method is as follows:
[0067] Obtain the dialogue audio set associated with the target service; input the dialogue audio contained in the dialogue audio set into the speech recognition model for processing to obtain dialogue information containing the speaker identifier, and form the dialogue information set.
[0068] Specifically, the dialogue audio set refers to the audio content corresponding to the target business, which consists of dialogue audio content between at least two users; correspondingly, the speech recognition model refers to the model that can convert dialogue audio into text. It should be noted that the speech recognition model can, while converting the audio, combine the corresponding timbre of the audio to complete the annotation of dialogue information, which is used to annotate the speaker identifier of the dialogue information.
[0069] Based on this, after obtaining the dialogue audio set associated with the target business, the dialogue audios contained in the dialogue audio set can be input into the speech recognition model for processing. According to the processing result of the model, the dialogue information corresponding to each dialogue audio can be obtained, and the dialogue information contains the speaker identifier corresponding to each dialogue sentence. Based on the dialogue information, a dialogue information set can be formed.
[0070] It should be noted that the dialogue audio set contains dialogue audio that consists of conversations between at least two users, and therefore the dialogue sentences contained in the dialogue information also consist of text content of conversations between at least two users.
[0071] In summary, by combining the speech recognition model with the speech recognition capabilities during the conversion process, and labeling each sentence in the dialogue information with the corresponding speaker identifier, the speaker identity identifier can be incorporated into the dialogue information. This method of constructing samples can improve the learning dimension of the intent recognition model and enhance the model's intent recognition capability.
[0072] Furthermore, in order to perform high-precision data cleaning on the initial dialogue information, it can be done in conjunction with a data cleaning chain. That is, the dialogue information set is cleaned sequentially by combining all the data cleaning stages included in the data cleaning chain. In this embodiment, the specific implementation method is as follows:
[0073] A data cleaning link containing multiple data cleaning nodes is identified; the data cleaning rule corresponding to the i-th data cleaning node is selected in the data cleaning link to perform data cleaning on the initial dialogue information contained in the dialogue information set, thereby obtaining an initial dialogue information set; it is determined whether the data cleaning link contains any unexecuted data cleaning nodes; if so, i is incremented by 1, the initial dialogue information set is used as the dialogue information set, and the step of selecting the data cleaning rule corresponding to the i-th data cleaning node in the data cleaning link is executed; if not, the initial dialogue information set is used as the target dialogue information set containing the target dialogue information.
[0074] Specifically, a data cleaning chain refers to a chain consisting of at least two data cleaning nodes, which are executed sequentially, with different nodes corresponding to different data cleaning rules. Correspondingly, a data cleaning node is a node used to perform data cleaning processing on the initial dialogue information contained in the dialogue information set. Accordingly, data cleaning rules include, but are not limited to, removing initial dialogue information whose text length does not reach a certain threshold, removing initial dialogue information with incorrect speaker identification, removing meaningless characters (such as interjections) from the initial dialogue information, and repairing punctuation marks in the initial dialogue information. In practical applications, cleaning rules can be set according to actual needs, and the data cleaning stage can be selected according to requirements; this embodiment does not impose any limitations.
[0075] Based on this, in the data cleaning phase, the data cleaning chain related to the target business can be determined first. Then, the data cleaning rule corresponding to the i-th data cleaning node in the chain is selected to clean all the initial dialogue information contained in the dialogue information set. The initial dialogue information set is obtained based on the cleaning result, where i is a positive integer starting from 1. After that, it is determined whether there are any unexecuted data cleaning nodes in the data cleaning chain. If so, i is incremented by 1, and the initial dialogue information set is used as the dialogue information set. The data cleaning rule corresponding to the selected data cleaning node is executed again to clean the dialogue information set. This process continues until all data cleaning nodes in the data cleaning chain have been executed. The final initial dialogue information set can then be used as the target dialogue information set for subsequent model training.
[0076] It should be noted that the data cleaning rules corresponding to each data cleaning node can refer to the data cleaning process in the above embodiment when cleaning the initial dialogue information. This embodiment will not elaborate further here.
[0077] In summary, by employing a data cleaning process to clean the initial dialogue information, it is possible to ensure that all initial dialogue information contained in the dialogue information set is cleaned, thereby making the target dialogue information set more standardized and enabling the training of an intent recognition model with higher prediction accuracy.
[0078] Furthermore, after obtaining the target dialogue text, it needs to be segmented to obtain at least two text fragments, which can then be input into the model for processing. During the segmentation process, in order to ensure that the length of the segmented text fragments matches the model's predicted processing length, it can be done according to the segmentation window parameters. In this embodiment, the specific implementation method is as follows:
[0079] Determine the segmentation window parameters that match the input parameters of the initial intent recognition model; segment the target dialogue text according to the segmentation window parameters to obtain the at least two text fragments.
[0080] Specifically, the input parameters refer to the parameters corresponding to the input standards set by the initial intent recognition model, which are used to standardize the text length of the input model; correspondingly, the segmentation window parameters refer to the size of the segmentation window that matches the input parameters, which is used to segment the target dialogue text into text lengths that match the input parameters.
[0081] Based on this, after obtaining the target dialogue text, in order to enable the initial intent recognition model to complete intent recognition processing in combination with the context, the input parameters corresponding to the initial intent recognition model can be determined before inputting it into the model, and the segmentation window parameters corresponding to the input parameters can be determined. At this time, the target dialogue text is segmented according to the segmentation window parameters, and at least two text segments can be obtained. These at least two text segments belonging to the target dialogue text can be uniformly input into the initial intent recognition model to complete training under the premise of meeting the model input requirements.
[0082] In practice, considering the variable length of the target dialogue text, after segmentation according to the segmentation window parameters, at least two text segments may be obtained, some of which may not meet the model's input parameters. To avoid impacting model training, these segments can be discarded or have characters added. For example, if the model input is 512 characters, and the segmented text segments correspond to 512 and 12 characters respectively, the segment corresponding to 12 characters can be discarded. Alternatively, if the segmented text segments correspond to 512 and 510 characters respectively, characters can be added to the segment corresponding to 510 characters to obtain a segment with 512 characters, which can then be processed by the model. The added characters should not affect the semantics of the text segment.
[0083] Following the previous example, after concatenating the dialogue content between user A and user B, a target dialogue text of length 4096 is obtained. Then, the target dialogue text of length 4096 can be segmented according to the window {512} that matches the parameters of the initial intent recognition model. Based on the segmentation result, eight text segments, namely S1 to S8, will be obtained, which can be used to input the model for training.
[0084] In summary, by processing the target dialogue text according to the segmentation window parameters that match the input parameters, text fragments that meet the model's input requirements are obtained. Based on this, the model can be trained, enabling it to improve its prediction accuracy by combining the hierarchical structure of the model with the contextual information of each text fragment during the training phase.
[0085] Step S104: Input the at least two text fragments into the initial intent recognition model, wherein the initial intent recognition model includes an encoding unit, a pooling unit, and a prediction unit.
[0086] Specifically, after obtaining at least two text fragments corresponding to the target dialogue text, all text fragments can be uniformly input into the initial intent recognition model for processing. The initial intent recognition model, which includes encoding units, pooling units, and prediction units, processes the at least two text fragments separately. After the model outputs the prediction results, its parameters can be tuned based on the sample labels.
[0087] The initial intent recognition model specifically refers to the intent recognition model corresponding to the target business. It includes an encoding unit, a pooling unit, and a prediction unit. The encoding unit encodes text segments, and the pooling unit pools the encoded results, fusing the various text segments together. This fusion is then used as the basis for the prediction unit to perform intent recognition. The encoding unit can be implemented using the BERT model, the pooling unit can use average pooling, and the prediction unit can use a linear transformation.
[0088] Step S106: The encoding unit encodes the at least two text segments to obtain text features. The text features include segment features corresponding to each text segment.
[0089] Specifically, after inputting at least two text segments into the initial intent recognition model, the encoding unit can first encode the at least two text segments. During the encoding process, although the text segments are input into the initial intent recognition model uniformly, the encoding unit in the initial intent recognition model can only process one text segment at a time. Therefore, during the encoding process, each text segment needs to be encoded sequentially by the encoding unit to obtain text features containing the segment features corresponding to each text segment based on the encoding results.
[0090] Here, fragment features are the vector representations obtained after encoding each text fragment, while text features are the vector representations that integrate the text features corresponding to all text fragments. These are used to characterize the target text to be processed.
[0091] Step S108: The text features containing the fragment features are pooled by the pooling unit, and the pooling result is transformed by the prediction unit to obtain the predicted intent category information and output it.
[0092] Specifically, after encoding at least two text segments using the encoding unit, text features composed of segment features corresponding to each text segment are obtained. Furthermore, to enable the intent recognition model to predict user intent during the training phase by incorporating contextual information, a pooling unit can be used to pool the text features containing segment features. This pooling process integrates and compresses the segment features corresponding to at least two text segments together. The prediction unit then transforms the pooling result to obtain the predicted intent category information corresponding to the target dialogue text, facilitating subsequent model parameter tuning.
[0093] Pooling refers to the average pooling of fragment features contained in the text features, so as to represent the full expression of the target dialogue text through the pooling result; correspondingly, the predicted intent category information refers to the information corresponding to the intent category obtained after the initial intent recognition model predicts the target dialogue text, which can be used to tune the initial intent recognition model in combination with the label corresponding to the target dialogue text.
[0094] Furthermore, in the process of pooling text features containing fragment features through the pooling unit, considering that the text features contain fragment features corresponding to each text fragment, it is necessary to first perform average pooling on each fragment feature in the text features, and then perform average pooling again after obtaining the pooling processing corresponding to each text fragment to obtain the pooling processing result. In this embodiment, the specific implementation method is as follows:
[0095] The pooling unit performs initial pooling on the text features containing the fragment features to obtain pooled text features, wherein the pooled text features include pooled fragment features corresponding to each text fragment; the pooling unit performs target pooling on the pooled text features containing the pooled fragment features to obtain target text features, which are used as the pooling result; the prediction unit transforms the pooling result to obtain the predicted intent category information corresponding to the target dialogue text, and outputs the initial intent recognition model.
[0096] Specifically, pooled text features refer to the vector representation of features obtained by performing average pooling on each text segment contained in the text features through pooling units. Correspondingly, pooled segment features are the vector representations obtained after average pooling each text segment, and the dimensionality of pooled text features is smaller than the dimensionality of the text features; similarly, the dimensionality of pooled segment features is smaller than the dimensionality of the segment features. Correspondingly, target text features refer to the vector representation obtained by average pooling on the pooled text features containing pooled segment features, and the target text features are the vector representation obtained by fusing all text segments; the dimensionality of the target text features is smaller than the dimensionality of the pooled text features.
[0097] Based on this, after encoding at least two text segments through the encoding unit, text features containing segment features are obtained. At this point, the pooling unit performs average pooling on these text features to obtain pooled text features containing pooled segment features corresponding to each text segment. Then, the pooled text features containing pooled segment features are further averaged through the pooling unit to obtain the target text features. This allows the contextual information of each text segment feature to be incorporated into the target text features. Finally, the prediction unit transforms the target text features to obtain the predicted intent category information, and the model is output for subsequent parameter tuning.
[0098] The initial pooling process refers to performing average pooling on each segment feature contained in the text features. Let the segment feature of each text segment be represented as h. i ∈R L*d Where i starts from 1 and is a positive integer. By using average pooling, the pooled segment feature representation for each text segment is obtained as follows: Here, `avgpool` is the function used for average pooling. After obtaining the pooled text features containing the pooled fragment features, average pooling can be performed on all the pooled fragment features to obtain the target text features corresponding to the target dialogue text. Finally, by performing a linear transformation on the target text feature r corresponding to the target dialogue text, the probability p corresponding to each intent category of the target dialogue text can be obtained, p = (c n |r)softmax(Wr), where c n Let W represent the various intent categories, and let W represent the parameter matrix to be learned for the text classification task. After obtaining the probabilities corresponding to each intent category, the predicted intent category of the target dialogue text can be selected from it for subsequent calculation of the loss value and parameter tuning of the model.
[0099] In summary, by using the pooling unit to perform average pooling twice consecutively, it is possible to merge various text fragments together to obtain the target text features, thereby fully combining the relationships between text fragments to complete intent prediction and improving the model's prediction accuracy.
[0100] Furthermore, after obtaining the pooling result, since intent prediction is a text classification task, it is necessary to select the most suitable intent prediction result from multiple intent prediction results for output. This ensures that the model can be accurately tuned during the parameter tuning stage. In this embodiment, the specific implementation method is as follows:
[0101] The prediction unit transforms the pooling result to obtain the category probability of each intent category information in at least two intent category information; the category probabilities of each intent category information are compared, and the target intent category information is selected from at least two intent category information according to the comparison result as the predicted intent category information.
[0102] Specifically, intent category information refers to the intent description information corresponding to multiple preset categories related to the target business; correspondingly, category probability refers to the probability of obtaining each intent category information after the target dialogue text has been processed by the initial intent recognition model. The higher the probability, the closer the target dialogue text is to its corresponding intent category. Correspondingly, target intent category information refers to the intent category information obtained by comparing category probabilities.
[0103] Based on this, after obtaining the pooling processing result, the pooling processing result can be linearly transformed by the prediction unit to obtain the category probability corresponding to each intent category information according to the transformation result. Then, by comparing the category probabilities corresponding to each intent category information, the intent category information with the highest probability can be selected as the predicted intent category information and output as the model, so that the model parameters can be adjusted in subsequent steps by combining sample labels.
[0104] See Figure 2 The diagram illustrates that after text fragments S1 to S8 are uniformly input into the initial intent recognition model, the BERT model sequentially encodes these fragments, resulting in text features containing the sequence representation of each fragment. Then, a first average pooling process is performed on the sequence representation of each text fragment to obtain the fragment representation for each fragment. Finally, by performing average pooling on the pooled text features containing the fragment representation, the text representation of the corresponding target dialogue text is obtained.
[0105] Furthermore, by performing a linear transformation on the text representation of the target dialogue text, we can obtain the probability p1 corresponding to the continuation intent level A1, the probability p2 corresponding to the continuation intent level A2, and the probability p3 corresponding to the continuation intent level A3. Then, we compare the probabilities p1, p2, and p3 and determine that p1 > p2 > p3. At this point, we can select the continuation intent A1 as the predicted intent category information corresponding to the target dialogue text and output the initial intent recognition model, which facilitates subsequent parameter tuning of the model by combining labels.
[0106] In summary, by comparing the category probabilities of each intent category, the initial intent recognition model can output the intent category information with the highest probability to determine the intent represented by the target dialogue text. Then, by combining the sample labels to calculate the loss value, the model parameters can be tuned, resulting in higher prediction accuracy.
[0107] Step S110: Based on the standard intent category information corresponding to the target dialogue text and the predicted intent category information, the parameters of the initial intent recognition model are tuned until an intent recognition model that meets the training conditions is obtained.
[0108] Specifically, after obtaining the predicted intent category information, the next step is to acquire the standard intent category information corresponding to the target dialogue text. Then, the predicted intent category information and the standard intent category information are combined to determine the model's prediction accuracy. Based on the determined results, the model's parameters are tuned. After parameter tuning, the model is trained again until it meets the training conditions. The final model can then be used as an intent recognition model for practical applications. The standard intent category information specifically refers to the true intent category information corresponding to the target dialogue text. By comparing and calculating the predicted intent category information and the standard intent category information, the prediction accuracy of the initial intent recognition model can be determined, allowing for parameter adjustment to achieve high prediction accuracy.
[0109] Furthermore, when tuning the model's parameters, the training conditions can include iteration count conditions, loss value comparison conditions, etc. When the training condition is a loss value comparison condition, the specific implementation is as follows:
[0110] In the training set, the standard intent category information corresponding to the target dialogue text is determined; the target loss value is calculated based on the standard intent category information and the predicted intent category information; the parameters of the initial intent recognition model are tuned based on the target loss value until the intent recognition model that meets the training conditions is obtained; wherein, the training conditions are loss value comparison conditions.
[0111] Specifically, the target loss value refers to the loss value calculated based on the standard intent category information and the predicted intent category information combined with a loss function. The loss function includes, but is not limited to, cross-entropy loss function, maximum value loss function, absolute value loss function, etc. In specific applications, the appropriate function can be selected according to actual needs; this embodiment does not impose any limitations. Correspondingly, the loss value comparison condition refers to the condition of comparing the loss value with a preset loss value threshold. If the loss value is less than the preset loss value threshold, the model of the current node is determined to meet the training conditions.
[0112] Based on this, after obtaining the predicted intent category information, standard intent category information corresponding to the target dialogue text can be selected from the training set to which the target dialogue text belongs. Then, combined with the cross-entropy loss function, a target loss value is calculated based on the standard intent category information and the predicted intent category information. The target loss value is then compared with a preset loss threshold. If it is greater than the threshold, the initial intent recognition model is tuned based on the target loss threshold. After the tuning is completed, samples are selected from the set for training. This process continues until the loss value is less than the preset loss threshold, at which point the model at the current stage can be considered the intent recognition model.
[0113] In summary, by combining loss functions with model parameter tuning, the model can be made more accurate during the parameter adjustment process, thereby enabling the model to learn intent prediction capabilities and making it easier to achieve accurate predictions for target business scenarios during the application phase.
[0114] Furthermore, considering that the model's fitting ability varies at different training stages, in order to avoid overtraining and reduced prediction accuracy, the model can be validated using a validation set. In this embodiment, the specific implementation method is as follows:
[0115] The intermediate intent recognition model is determined based on the parameter tuning results; the verification dialogue text is extracted from the verification set and segmented into at least two verification text segments; the at least two verification text segments are input into the intermediate intent recognition model for processing to obtain verification intent category information; the target intent category information corresponding to the verification dialogue text is compared with the verification intent category information; if the comparison result meets the training conditions, the intermediate intent recognition model is used as the intent recognition model.
[0116] Specifically, the intermediate intent recognition model refers to the intent recognition model obtained after preliminary training, whose accuracy has not yet met the requirements; correspondingly, the validation set refers to the set of sample pairs used to verify the model's prediction accuracy.
[0117] Based on this, after obtaining the intermediate intent recognition model according to the parameter tuning results, to improve the model's prediction accuracy, the model at the current stage can be validated using a validation set. First, the validation dialogue text is extracted from the validation set and segmented into at least two validation text fragments. Second, these at least two validation text fragments are input into the intermediate intent recognition model for processing to obtain validation intent category information. Third, the target intent category information corresponding to the validation dialogue text is compared with the validation intent category information. The model's prediction accuracy can be determined based on the comparison result. If the comparison result does not meet the training conditions, it indicates that the model still needs training, and training should continue. If the comparison result meets the training conditions, it indicates that the model is ready for use, and the intermediate intent recognition model is adopted as the intent recognition model.
[0118] It should be noted that the processing of the verification text fragment by the intermediate intent recognition model can be found in the above embodiments, with corresponding or identical descriptions. This embodiment will not elaborate further here.
[0119] The intent recognition model training method provided in this manual, in order to improve the model's recognition accuracy, involves dividing the target dialogue text into at least two text segments after acquisition, and then inputting them uniformly into the initial intent recognition model. The model's encoding unit first encodes these segments to obtain text features containing the segment features corresponding to each text segment, thus representing all text segments with a single text feature. These text features are then input into the pooling unit for average pooling, and after pooling, a prediction unit is used for transformation to obtain intent recognition category information. Finally, based on the standard intent category information and predicted intent category information corresponding to the target dialogue text, the initial intent recognition model is tuned until an intent recognition model that meets the training conditions is obtained. This method achieves the fusion of the target dialogue text representation through average pooling during model training, allowing the model to learn to predict intent based on the global representation of the dialogue text. This results in higher prediction accuracy for the trained model, facilitating its use in downstream applications.
[0120] Corresponding to the above method embodiments, this specification also provides embodiments of an intent recognition model training device. Figure 3 A schematic diagram of an intent recognition model training device according to an embodiment of this specification is shown. Figure 3 As shown, the device includes:
[0121] The acquisition module 302 is configured to acquire target dialogue text and segment the target dialogue text into at least two text fragments.
[0122] The input module 304 is configured to input the at least two text fragments into an initial intent recognition model, wherein the initial intent recognition model includes an encoding unit, a pooling unit, and a prediction unit;
[0123] The encoding module 306 is configured to encode the at least two text segments through the encoding unit to obtain text features, wherein the text features include segment features corresponding to each text segment;
[0124] Pooling module 308 is configured to perform pooling processing on text features containing the fragment features through the pooling unit, and use the prediction unit to transform the pooling processing result to obtain and output the predicted intent category information.
[0125] The training module 310 is configured to tune the parameters of the initial intent recognition model based on the standard intent category information corresponding to the target dialogue text and the predicted intent category information, until an intent recognition model that meets the training conditions is obtained.
[0126] In an optional embodiment, the acquisition module 302 is further configured to:
[0127] Obtain a set of dialogue information related to the target business; perform data cleaning on the initial dialogue information contained in the dialogue information set to obtain a target dialogue information set containing the target dialogue information; determine at least two dialogue texts corresponding to the target dialogue information in the target dialogue information set, and obtain the target dialogue text by concatenating the at least two dialogue texts; wherein each of the at least two dialogue texts contains a speaker identifier.
[0128] In an optional embodiment, the acquisition module 302 is further configured to:
[0129] A data cleaning link containing multiple data cleaning nodes is identified; the data cleaning rule corresponding to the i-th data cleaning node is selected in the data cleaning link to perform data cleaning on the initial dialogue information contained in the dialogue information set, thereby obtaining an initial dialogue information set; it is determined whether the data cleaning link contains any unexecuted data cleaning nodes; if so, i is incremented by 1, the initial dialogue information set is used as the dialogue information set, and the step of selecting the data cleaning rule corresponding to the i-th data cleaning node in the data cleaning link is executed; if not, the initial dialogue information set is used as the target dialogue information set containing the target dialogue information.
[0130] In an optional embodiment, the acquisition module 302 is further configured to:
[0131] Determine the segmentation window parameters that match the input parameters of the initial intent recognition model; segment the target dialogue text according to the segmentation window parameters to obtain the at least two text fragments.
[0132] In an optional embodiment, the pooling module 308 is further configured to:
[0133] The pooling unit performs initial pooling on the text features containing the fragment features to obtain pooled text features, wherein the pooled text features include pooled fragment features corresponding to each text fragment; the pooling unit performs target pooling on the pooled text features containing the pooled fragment features to obtain target text features, which are used as the pooling result; the prediction unit transforms the pooling result to obtain the predicted intent category information corresponding to the target dialogue text, and outputs the initial intent recognition model.
[0134] In an optional embodiment, the pooling module 308 is further configured to:
[0135] The prediction unit transforms the pooling result to obtain the category probability of each intent category information in at least two intent category information; the category probabilities of each intent category information are compared, and the target intent category information is selected from at least two intent category information according to the comparison result as the predicted intent category information.
[0136] In an optional embodiment, the training module 310 is further configured to:
[0137] In the training set, the standard intent category information corresponding to the target dialogue text is determined; the target loss value is calculated based on the standard intent category information and the predicted intent category information; the parameters of the initial intent recognition model are tuned based on the target loss value until the intent recognition model that meets the training conditions is obtained; wherein, the training conditions are loss value comparison conditions.
[0138] In an optional embodiment, the training module 310 is further configured to:
[0139] The intermediate intent recognition model is determined based on the parameter tuning results; the verification dialogue text is extracted from the verification set and segmented into at least two verification text segments; the at least two verification text segments are input into the intermediate intent recognition model for processing to obtain verification intent category information; the target intent category information corresponding to the verification dialogue text is compared with the verification intent category information; if the comparison result meets the training conditions, the intermediate intent recognition model is used as the intent recognition model.
[0140] In an optional embodiment, the acquisition module 302 is further configured to:
[0141] Obtain the dialogue audio set associated with the target service; input the dialogue audio contained in the dialogue audio set into the speech recognition model for processing to obtain dialogue information containing the speaker identifier, and form the dialogue information set.
[0142] The intent recognition model training device provided in this manual, in order to improve the model's recognition accuracy, divides the target dialogue text into at least two text segments after acquisition, and then inputs them uniformly into the initial intent recognition model. The encoding unit in the model first encodes the segments to obtain text features containing the segment features corresponding to each text segment, thus representing all text segments with a single text feature. The text features are then input into the pooling unit for average pooling, and after pooling, the prediction unit performs a transformation to obtain intent recognition category information. Finally, based on the standard intent category information and predicted intent category information corresponding to the target dialogue text, the initial intent recognition model is tuned until an intent recognition model that meets the training conditions is obtained. During model training, the representation of the target dialogue text is fused through average pooling by the pooling unit. Based on this, the model is trained, allowing it to learn to predict intent from the global representation of the dialogue text, resulting in higher prediction accuracy and facilitating downstream business applications.
[0143] The above is an illustrative scheme of an intent recognition model training device according to this embodiment. It should be noted that the technical solution of this intent recognition model training device and the technical solution of the aforementioned intent recognition model training method belong to the same concept. For details not described in detail in the technical solution of the intent recognition model training device, please refer to the description of the technical solution of the aforementioned intent recognition model training method.
[0144] This specification also provides an intent recognition method, see [link to documentation]. Figure 4 , Figure 4 A flowchart of an intent recognition model training method according to an embodiment of this specification is shown, which specifically includes the following steps:
[0145] Step S402: Obtain the unprocessed dialogue text associated with the target user in the target business.
[0146] Step S404: Divide the dialogue text to be processed into at least two text segments to be processed.
[0147] Step S406: Input the at least two text fragments to be processed into the intent recognition model in the intent recognition model training method for processing, and obtain the intent category information corresponding to the dialogue text to be processed.
[0148] Step S408: Determine the target user's participation intention in the target service based on the intent category information.
[0149] Specifically, the target user refers to a user who is related to the target business. For example, if the target business is online course sales, then the target user is a user associated with the online course sales business, including but not limited to users who have inquired about a particular online course or who have already purchased an online course. This embodiment does not impose any limitations on this. Correspondingly, the dialogue text to be processed refers to the dialogue text between the target user and the call center staff who are dealing with the online course sales business. Correspondingly, the participation intention refers to the target user's intention to participate in the target business, that is, the intention to purchase an online course, including but not limited to high purchase intention, low purchase intention, or medium purchase intention.
[0150] In practice, different approaches can be used to connect with users who have different purchase intentions. For example, for users with high purchase intentions, a dedicated person can be assigned to connect with them and introduce the course; for users with low purchase intentions, a tag can be added to their information to avoid disturbing them later; and for users with medium purchase intentions, a trial lesson can be recommended to them to experience the course content.
[0151] In practical applications, different target businesses can set their own connection methods according to their needs when connecting with users based on their participation intentions. This embodiment does not impose any limitations on these methods.
[0152] The training process of the intent recognition model involved in the intent recognition method provided in this embodiment can be found in the above embodiments, and will not be described in detail here.
[0153] The intent recognition method provided in this manual, after acquiring the dialogue text of the target user associated with the target business, can obtain at least two text fragments through preprocessing. These fragments are then input into the intent recognition model obtained by the training method described above. This allows the determination of the intent category information corresponding to the dialogue text, which in turn enables the accurate identification of the target user's intent to participate in the target business. This facilitates the business owner to follow up based on the participation intent, ensuring that the follow-up method aligns with the user's intention to participate in the target business and improving the user experience.
[0154] Corresponding to the above method embodiments, this specification also provides embodiments of an intent recognition device. Figure 5A schematic diagram of an intent recognition device according to an embodiment of this specification is shown. Figure 5 As shown, the device includes:
[0155] The text acquisition module 502 is configured to acquire the unprocessed dialogue text associated with the target user in the target business.
[0156] The text segmentation module 504 is configured to segment the dialogue text to be processed into at least two text segments to be processed.
[0157] The input model module 506 is configured to input the at least two text fragments to be processed into the intent recognition model in the intent recognition model training method for processing, and obtain the intent category information corresponding to the dialogue text to be processed.
[0158] The intent determination module 508 is configured to determine the participation intent of the target user in the target service based on the intent category information.
[0159] The intent recognition device provided in this specification, after acquiring the dialogue text of the target user associated with the target service, can obtain at least two text fragments to be processed through preprocessing. These fragments are then input into the intent recognition model obtained by the training method described above. This allows the determination of the intent category information corresponding to the dialogue text to be processed. Based on this, the participation intent of the target user in the target service can be accurately determined. This enables the service provider to follow up according to the participation intent, ensuring that the follow-up method aligns with the user's intention to participate in the target service and improving the user experience.
[0160] The above is an illustrative scheme of an intent recognition device according to this embodiment. It should be noted that the technical solution of this intent recognition device and the technical solution of the aforementioned intent recognition method belong to the same concept. For details not described in detail in the technical solution of the intent recognition device, please refer to the description of the technical solution of the aforementioned intent recognition method.
[0161] The following is in conjunction with the appendix Figure 6 Taking the application of the intent recognition method provided in this specification in the online course renewal business scenario as an example, the intent recognition method will be further explained. Among them, Figure 6 The present specification illustrates a processing flowchart of an intent recognition method according to an embodiment, which specifically includes the following steps:
[0162] Step S602: Obtain the dialogue audio set associated with the target business, input the dialogue audio contained in the dialogue audio set into the speech recognition model for processing, obtain dialogue information containing speaker identifiers, and form a dialogue information set.
[0163] Step S604: Clean the initial dialogue information contained in the dialogue information set to obtain the target dialogue information set containing the target dialogue information.
[0164] Step S606: Determine at least two dialogue texts corresponding to the target dialogue information in the target dialogue information set, and obtain the target dialogue text by concatenating the at least two dialogue texts.
[0165] Each of the at least two dialogue texts contains a speaker identifier.
[0166] Step S608: Determine the segmentation window parameters that match the input parameters of the initial intent recognition model.
[0167] Step S610: Segment the target dialogue text according to the segmentation window parameters to obtain at least two text fragments.
[0168] Step S612: Input at least two text fragments into the initial intent recognition model, wherein the initial intent recognition model includes an encoding unit, a pooling unit, and a prediction unit.
[0169] Step S614: Encode at least two text segments using an encoding unit to obtain text features, wherein the text features include the segment features corresponding to each text segment.
[0170] Step S616: Initial pooling processing is performed on the text features containing fragment features through the pooling unit to obtain pooled text features, wherein the pooled text features include pooled fragment features corresponding to each text fragment.
[0171] Step S618: The pooled text features containing pooled fragment features are subjected to target pooling processing through the pooling unit to obtain target text features, which are then used as the pooling processing result.
[0172] Step S620: The pooling processing result is transformed by the prediction unit to obtain the category probability of each intent category information corresponding to at least two intent category information.
[0173] Step S622: Compare the category probabilities of each intent category information, and select the target intent category information from at least two intent category information based on the comparison results, as the predicted intent category information.
[0174] Step S624: Determine the standard intent category information corresponding to the target dialogue text in the training set.
[0175] Step S626: Calculate the target loss value based on the standard intent category information and the predicted intent category information.
[0176] Step S628: Adjust the parameters of the initial intent recognition model based on the target loss value until an intent recognition model that meets the training conditions is obtained; wherein, the training conditions are loss value comparison conditions.
[0177] Step S630: Obtain the unprocessed dialogue text associated with the target user in the target business, and divide the unprocessed dialogue text into at least two unprocessed text segments.
[0178] Step S632: Input at least two text fragments to be processed into the intent recognition model for processing to obtain intent category information corresponding to the dialogue text to be processed;
[0179] Step S634: Determine the target user's participation intent for the target service based on the intent category information.
[0180] In summary, to improve the accuracy of model recognition, after obtaining the target dialogue text, it can be divided into at least two text segments, which are then uniformly input into the initial intent recognition model. The encoding unit in the model first encodes these segments to obtain text features containing the segment features corresponding to each text segment, thus representing all text segments with a single text feature. The text features are then input into the pooling unit for average pooling, and after pooling, the prediction unit transforms the data to obtain intent recognition category information. Finally, based on the standard intent category information and predicted intent category information corresponding to the target dialogue text, the initial intent recognition model is tuned until an intent recognition model that meets the training conditions is obtained. This approach, through average pooling in the pooling unit during model training, fuses the representation of the target dialogue text. Training the model based on this fusion allows the model to learn to predict intent from the global representation of the dialogue text, resulting in higher prediction accuracy and facilitating downstream business applications.
[0181] Figure 7 A structural block diagram of a computing device 700 according to an embodiment of this specification is shown. The components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and a database 750 is used to store data.
[0182] The computing device 700 also includes an access device 740, which enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 740 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0183] In one embodiment of this specification, the above-described components of the computing device 700 and Figure 7 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 7 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0184] The computing device 700 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 700 can also be a mobile or stationary server.
[0185] The processor 720 is used to implement the steps of the intent recognition model training method or the intent recognition method when executing computer-executable instructions.
[0186] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device belongs to the same concept as the above-described intention recognition model training method or intention recognition method. For details not described in detail in the technical solution of the computing device, please refer to the description of the above-described intention recognition model training method or intention recognition method.
[0187] An embodiment of this specification also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, are used for an intent recognition model training method or an intent recognition method.
[0188] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the above-described intention recognition model training method or intention recognition method. For details not described in detail in the technical solution of the storage medium, please refer to the description of the above-described intention recognition model training method or intention recognition method.
[0189] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0190] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0191] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this specification is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this specification. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this specification.
[0192] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0193] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. These embodiments have been selected and specifically described in this specification to better explain the principles and practical applications of this specification, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A method for training an intent recognition model, characterized in that, include: Obtain the target dialogue text and segment the target dialogue text into at least two text fragments; The at least two text fragments are input into an initial intent recognition model, wherein the initial intent recognition model includes an encoding unit, a pooling unit, and a prediction unit; The encoding unit encodes the at least two text segments to obtain text features, wherein the text features include segment features corresponding to each text segment; The text features containing the fragment features are initially pooled by the pooling unit to obtain pooled text features, wherein the pooled text features include pooled fragment features corresponding to each text fragment. The pooling unit performs target pooling on the pooled text features containing the pooled fragment features to obtain the target text features, which are then used as the pooling result. The prediction unit transforms the pooling result to obtain the category probability of each intent category information in at least two intent category information. The class probabilities of each intent category information are compared. Based on the comparison results, the target intent category information is selected from at least two intent category information as the predicted intent category information, and the initial intent recognition model is output. Based on the standard intent category information corresponding to the target dialogue text and the predicted intent category information, the parameters of the initial intent recognition model are tuned until an intent recognition model that meets the training conditions is obtained.
2. The method according to claim 1, characterized in that, The acquisition of the target dialogue text includes: Obtain the dialogue information set related to the target business; Data cleaning is performed on the initial dialogue information contained in the dialogue information set to obtain a target dialogue information set containing the target dialogue information; Determine at least two dialogue texts corresponding to the target dialogue information in the target dialogue information set, and obtain the target dialogue text by concatenating the at least two dialogue texts; Each of the at least two dialogue texts contains a speaker identifier.
3. The method according to claim 2, characterized in that, The step of cleaning the initial dialogue information contained in the dialogue information set to obtain a target dialogue information set containing the target dialogue information includes: Identify the data cleaning chain that includes multiple data cleaning nodes; In the data cleaning chain, select the data cleaning rule corresponding to the i-th data cleaning node, perform data cleaning on the initial dialogue information contained in the dialogue information set, and obtain the initial dialogue information set. Determine whether the data cleaning chain contains any unexecuted data cleaning nodes; If so, i is incremented by 1, the initial dialogue information set is used as the dialogue information set, and the step of selecting the data cleaning rule corresponding to the i-th data cleaning node in the data cleaning link is executed. If not, the initial dialogue information set shall be used as the target dialogue information set containing the target dialogue information.
4. The method according to claim 1, characterized in that, The step of dividing the target dialogue text into at least two text segments includes: Determine the segmentation window parameters that match the input parameters of the initial intent recognition model; The target dialogue text is segmented according to the segmentation window parameters to obtain at least two text fragments.
5. The method according to any one of claims 1-4, characterized in that, The step of tuning the initial intent recognition model based on the standard intent category information corresponding to the target dialogue text and the predicted intent category information until an intent recognition model that meets the training conditions is obtained includes: Determine the standard intent category information corresponding to the target dialogue text in the training set; Calculate the target loss value based on the standard intent category information and the predicted intent category information; The initial intent recognition model is tuned based on the target loss value until an intent recognition model that meets the training conditions is obtained; wherein, the training conditions are loss value comparison conditions.
6. The method according to any one of claims 1-4, characterized in that, Also includes: The intermediate intent recognition model is determined based on the parameter tuning results; Extract the verification dialogue text from the verification set and divide the verification dialogue text into at least two verification text segments; The at least two verification text fragments are input into the intermediate intent recognition model for processing to obtain verification intent category information; Compare the target intent category information corresponding to the verification dialogue text with the verification intent category information; If the comparison results meet the training conditions, the intermediate intent recognition model is used as the intent recognition model.
7. The method according to claim 2, characterized in that, The acquisition of the dialogue information set related to the target service includes: Obtain the set of dialogue audio associated with the target service; The dialogue audio contained in the dialogue audio set is input into the speech recognition model for processing to obtain dialogue information containing the speaker identifier, and the dialogue information set is formed.
8. An intent recognition model training device, characterized in that, include: The acquisition module is configured to acquire target dialogue text and segment the target dialogue text into at least two text fragments. An input module is configured to input the at least two text fragments into an initial intent recognition model, wherein the initial intent recognition model includes an encoding unit, a pooling unit, and a prediction unit; An encoding module is configured to encode the at least two text segments through the encoding unit to obtain text features, wherein the text features include segment features corresponding to each text segment; The pooling module is configured to perform initial pooling processing on the text features containing the fragment features through the pooling unit to obtain pooled text features, wherein the pooled text features include pooled fragment features corresponding to each text fragment; and to perform target pooling processing on the pooled text features containing the pooled fragment features through the pooling unit to obtain target text features, which are used as the pooling processing result. The prediction unit transforms the pooling result to obtain the category probability of each intent category information in at least two intent category information; the category probabilities of each intent category information are compared, and the target intent category information is selected from at least two intent category information as the predicted intent category information based on the comparison result, and the initial intent recognition model is output. The training module is configured to tune the parameters of the initial intent recognition model based on the standard intent category information corresponding to the target dialogue text and the predicted intent category information, until an intent recognition model that meets the training conditions is obtained.
9. An intent recognition method, characterized in that, include: Obtain the pending dialogue text of the target user associated with the target business; The dialogue text to be processed is divided into at least two text segments to be processed; The at least two text fragments to be processed are input into the intent recognition model in any one of claims 1-7 for processing to obtain intent category information corresponding to the dialogue text to be processed. The participation intention of the target user in the target service is determined based on the intent category information.
10. An intent recognition device, characterized in that, include: The text acquisition module is configured to acquire the unprocessed dialogue text associated with the target user in the target business. The text segmentation module is configured to segment the dialogue text to be processed into at least two text segments to be processed. The input model module is configured to input the at least two text fragments to be processed into the intent recognition model in any one of claims 1-7 for processing, and obtain intent category information corresponding to the dialogue text to be processed. The intent determination module is configured to determine the participation intent of the target user in the target service based on the intent category information.
11. A computing device, characterized in that, It includes a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the method according to any one of claims 1 to 7 or 9.
12. A computer-readable storage medium storing computer instructions, characterized in that, When executed by the processor, this instruction implements the steps of the method according to any one of claims 1 to 7 or 9.
Citation Information
Patent Citations
Intent recognition method, device and equipment based on artificial intelligence and storage medium
CN113935333A
Predicting Intent of a User from Anomalous Profile Data
US20190236204A1